@rebane2001 tbh this might actually be good for me compared to habitually refreshing reddit đ
jnkrtech
Posts
-
i made a version of wikipedia you can doomscrollhttps://xikipedia.org/ -
I've been musing on #OOP style.@thelastpsion my 2 cents:
If itâs tightly coupled to the structure of the class or breaks the classâs encapsulation somehow, it goes on the class
Otherwise, if youâre using a language that allows you to control what functions are exported separately from what class members are exported, then it depends on the tradeoff between easy testing and a clean interface.
If itâs a private method then itâs generally best to not unit test it directly (in a perfect world). If itâs a separate function then thatâs much easier to unit test.
If thereâs no way to make it clear to consumers of your module that this code is supposed to be internal, then moving it out of the class increases the chances of people depending on it when you donât want them to, or it can make your interfaces more cluttered.
Once you have unit tests for the thing, it will want to settle towards where youâve put it. So if you could see this function one day becoming part of its own class, I would lean towards extracting and testing it separately early.
-
Things no one believes me about from movies that they think they remember well:Home Alone is nearly two hours long. Watch it as an adult with another adult who has never seen it before. It is grueling.
-
Things no one believes me about from movies that they think they remember well:Things no one believes me about from movies that they think they remember well:
- Only like 5% of the runtime of Home Alone involves booby traps. Significantly more time is spent focusing on the mother.
- Also the movie is anti-feminist propaganda, holding up a clearly business-coded woman as neglectful of her child, unable to use her wealth to rectify the situation, and only able to redeem herself via extensive self-sacrifice.
- At one point in the LEGO movie the villain forces a guy to kill his own parents. Fully on-screen.
-
Of all the existential questions that plague me, this is perhaps the most thorny:@intrepidhero are you familiar with http://langsec.org/ ? The idea of âweird machinesâ was mindblowing for me and is what first set me into this viewpoint
-
Of all the existential questions that plague me, this is perhaps the most thorny:@intrepidhero IMO most programs are interpreters and their inputs are languages which control their functioning when interpreted. YAML config file, video file, HTTP request body, parser CLI args⌠all code.
This is just the view from where Iâm standing though. From a different direction code is data, too.