@@Go_with-Christ That's neither your nor my business. Please go somewhere else with your sealioning, this podcast is about programming not your triggered rants.
0 is called exit code; the idea is that there's only one way to succeed, but many ways to fail. there's nothing wrong with that. (and yes you can just do "if that_thing".)
I was a lil disappointed at 44:24 when Sarah said she isn't a big fan of encapsulation. if done correctly it can make code more modular and maintainable, and being private/public isn't the only thing it's about. it can definitely improve readability too. the problem is too many people don't know when and how to apply it in an effective way. it's a great thing if applied well, and a pain if not.
public fields are okay only if the value under that field does not have to uphold to some property at all times, otherwise getters and setters are almost an necessity, or one would have to put "assert(property(this.x));" at the beginning of every function that uses "x"
Yep all the Clean Code stuff is about a mythical platonic abstract realm where anything can be swapped for anything as long as you add 9 layers of boilerplate indirection. I'm struggling to get myself coworkers to not write bugs everywhere even without ivory tower type hierarchies.
I went the self-built NAS route first, but also made the same decision that I want storage to just work because it's the part of my homelab that I want to be the most stable. I also wanted to be able to gradually add drives over time, and Synology handles that very well.
I think have to get past the gatekeepers back in the day made me think more before I asked a question, but it did also make me question if it was worth it. Though if someone is going out of their way to help me on their own time I can tolerate quite a lot of rudeness.
I find encapsulation in specifically video game development libraries extremely annoying. It's like the library author is trying to come up with this perfect way for you to set up and use their functions, with everything being represented as different objects or whatever. It's all well and good until you need something that the class isn't representing, then you basically have to throw it all out start from scratch in the worst case, or fork their library and make a bunch of stuff public just so you can get this one thing buried in the hierarchy out of it. I'm like... get this enterprise bullshit out of my video game code, man.
@@TheKennyWorld reflection is slow and I consider it a hack in most cases, but it’s probably a solution if you’re in a bind. It’s probably fast enough for loading but too slow for gameplay. I’m just personally trying to move past situations where I have to come up with something crazy just to work around an API
It's so much harder to keep track of how the data is used within the application when it's a global variable. You literally have to look at every file in your codebase. And when you don't know how your data is being used, it's harder to refactor. And when it's harder to refactor, it's easier for your codebase to degenerate. I like grouping related functions into singleton classes, and any would be global state gets passed into the constructor and stored as a private instance variable. This makes it super easy to know which data is used for any function. You just need to look at one place and you know everywhere the data is used.
@@backendbanterfm Having getters and setters to private field should be considered as part of the documentation. If you have read only fields, not providing a setter is _the_ documentation. If it is protected, that again is documentation. You cannot achieve this by making fields pubic.
Yay, Sarah is such a fantastic guest. Always super interesting to listen into anything she's on :)
thats a woman?
@@Go_with-Christ That's neither your nor my business. Please go somewhere else with your sealioning, this podcast is about programming not your triggered rants.
he
Fair question.
Intimidatingly correct means that you were just pragmatic. Normies hate it when you're pragmatic.
Down with the normies!
I like
0 is called exit code; the idea is that there's only one way to succeed, but many ways to fail. there's nothing wrong with that. (and yes you can just do "if that_thing".)
interesting, from the perspective of how bash was designed it'd still be preferable for 1 and 0 to be switched (success/failure)
Don't tell me how to protect me from me.
bingo
I was a lil disappointed at 44:24 when Sarah said she isn't a big fan of encapsulation. if done correctly it can make code more modular and maintainable, and being private/public isn't the only thing it's about. it can definitely improve readability too. the problem is too many people don't know when and how to apply it in an effective way. it's a great thing if applied well, and a pain if not.
great interview.
glad to see badcop once again
public fields are okay only if the value under that field does not have to uphold to some property at all times, otherwise getters and setters are almost an necessity, or one would have to put "assert(property(this.x));" at the beginning of every function that uses "x"
Yep all the Clean Code stuff is about a mythical platonic abstract realm where anything can be swapped for anything as long as you add 9 layers of boilerplate indirection. I'm struggling to get myself coworkers to not write bugs everywhere even without ivory tower type hierarchies.
I went the self-built NAS route first, but also made the same decision that I want storage to just work because it's the part of my homelab that I want to be the most stable. I also wanted to be able to gradually add drives over time, and Synology handles that very well.
I think have to get past the gatekeepers back in the day made me think more before I asked a question, but it did also make me question if it was worth it. Though if someone is going out of their way to help me on their own time I can tolerate quite a lot of rudeness.
This is my private variable I don’t know you!
I find encapsulation in specifically video game development libraries extremely annoying. It's like the library author is trying to come up with this perfect way for you to set up and use their functions, with everything being represented as different objects or whatever. It's all well and good until you need something that the class isn't representing, then you basically have to throw it all out start from scratch in the worst case, or fork their library and make a bunch of stuff public just so you can get this one thing buried in the hierarchy out of it. I'm like... get this enterprise bullshit out of my video game code, man.
Probably a dumb question but can't you just use reflection?
@@TheKennyWorld reflection is slow and I consider it a hack in most cases, but it’s probably a solution if you’re in a bind. It’s probably fast enough for loading but too slow for gameplay. I’m just personally trying to move past situations where I have to come up with something crazy just to work around an API
Global variable bad. Therefore I will jump through hoops to access a variable that has a life time of the app
Sounds like a global context needs to be passed around all throughout the program?
dEsIGn PaTTeRns
It's so much harder to keep track of how the data is used within the application when it's a global variable. You literally have to look at every file in your codebase. And when you don't know how your data is being used, it's harder to refactor. And when it's harder to refactor, it's easier for your codebase to degenerate.
I like grouping related functions into singleton classes, and any would be global state gets passed into the constructor and stored as a private instance variable. This makes it super easy to know which data is used for any function. You just need to look at one place and you know everywhere the data is used.
Badcop looks absolutely not bad at all... I like her!
She's incredible ong fr
Ok... That is not hacking.
You thinking something as "silly" doesn't disqualify it.
Many are saying this
@@backendbanterfm Having getters and setters to private field should be considered as part of the documentation. If you have read only fields, not providing a setter is _the_ documentation. If it is protected, that again is documentation. You cannot achieve this by making fields pubic.
@@gwaptiva too idealistic but i think i agree with the premise
@@gwaptivaPlease don't make fields pubic.
@@backendbanterfm And yet no one is saying this
It's weird to be against classes for Python....
not if you're just against classes!
But pointer receiver struct methods are ok? It's the same thing
👍
no u
sorry, is this a man or woman. i'm not trolling, genuine question
R0N1N are the protectors of #secrets 🕯