Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
sirwhinesalot
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
6 ms
·
31.
▲
by
sirwhinesalot
4mo ago
No it is not a fault of OOP, it is just that OOP does not really provide the tools to help either. It is the fault of people with the wrong expectations or of those trying to sell snake oil. OOP allows to create decoupled systems but it doe
32.
▲
by
sirwhinesalot
4mo ago
I think dogma is far worse than "tight coupling" or introducing mutation or even inheritance when it is the simplest and most direct solution to a problem. People get too hung up on the "ideal" way to do things. I can cr
33.
▲
by
sirwhinesalot
4mo ago
It's not really true that components in physical engineering domains have no memory. The behavior of many physical components can only be described with access to a recent history. Other components, specially controllers, are typically
34.
▲
by
sirwhinesalot
4mo ago
Languages with refinement types (or contracts) like Dafny and Liquid Haskell can typically handle numerical predicates directly. Some can even handle string predicates directly, including regular expressions. They also allow you to write co
35.
▲
by
sirwhinesalot
4mo ago
To be clear I'm not arguing against objects here, I don't disagree with anything you wrote. I'm only arguing against the somewhat commonly held idea that OOP helps with loose coupling. Interfaces (a feature of OOP) can be use
36.
▲
by
sirwhinesalot
4mo ago
The computer-science answer to this problem are called "refinement types", where you can attach arbitrary predicates to a type, e.g. (pseudo-code): fn send_birthday_mail(user: {u: User, u.birthday != null}) Contracts are
37.
▲
by
sirwhinesalot
4mo ago
It's crazy to me that Linda came out 40 years ago. I think our field is completely blind to what was achieved in the past. Smalltalk is to me the most obvious case where people somehow don't realize we had a fully live environment
38.
▲
by
sirwhinesalot
4mo ago
Yes, for example if you are doing any sort of mechatronic systems engineering (cars, planes, rockets, etc.), you're typically using tools like Simcenter Amesim or Modelica or Simulink/Stateflow to digitally prototype the system.
39.
▲
by
sirwhinesalot
4mo ago
Dependency Injection frameworks are a workaround for limitations of the paradigm, much like Design Patterns also are. They're necessary (by a very stretched definition of necessary) because people want to do certain things and the para
40.
▲
by
sirwhinesalot
4mo ago
The Alan Kay variant of OOP is superior in this regard, and I'd argue the Erlang variant even more so (Actors are just asynchronous objects). But both of them are still suboptimal because they allow objects to instantiate one another a
41.
▲
by
sirwhinesalot
4mo ago
I agree "high cohesion, loose coupling" is a good architectural property to strive for, but OOP is terrible at it and there's no reason to use it for this. Trying to achieve "high cohesion, loose coupling" in OOP ha
42.
▲
by
sirwhinesalot
4mo ago
Another commenter pointed it out already but might as well stress the point: objects are bundles of data and behavior. Your example is missing data.
43.
▲
by
sirwhinesalot
4mo ago
I have in the past made fun of the Linux kernel devs, supposedly some of the best C developers in the world, for not knowing how to make stringbuffer and stringview types, but to be fair to them we didn't have the consensus we have tod
44.
▲
I tried making a UI library
(btmc.substack.com)
6 points
by
sirwhinesalot
4mo ago
|
0 comments
45.
▲
by
sirwhinesalot
4mo ago
It didn't happen when they introduced Leopard, because the new design was legitimately better than the ugly brushed aluminium look that preceeded it. When they toned down the horrific excesses of skeumorphism (like leather textures) on
46.
▲
by
sirwhinesalot
4mo ago
They fixed all the extremely egregious issues with Liquid Glass, good to see. It's still an extremely ugly, "worst of both worlds" combination of wasted space (from early-gen flat design) with gaudy effects (from late-gen ske
47.
▲
by
sirwhinesalot
4mo ago
It wasn't just that. Speaking from both personal experience and from second-hand experience I got from my parents and grandparents, there was a very obvious shift that went beyond that. My mother when she was younger used to live surro
48.
▲
by
sirwhinesalot
4mo ago
I'm a father of 2. If not for my mother in law I would have gone insane by now. Way harder than 1. 1 was mainly hard because we had no idea what we were doing. With 1 it is pretty easy for a parent to take over while the other rests. N
49.
▲
by
sirwhinesalot
4mo ago
The real reason why nobody is having kids can be summarized by the sentence: "It takes a village to raise a kid". Look up how much time a mother actually used to spend holding their own child vs other people holding that same chil
50.
▲
by
sirwhinesalot
5mo ago
Yeah, there's three things you're supposed to implement: try/handle, perform, and resume. The names can vary (e.g., perform is often called "raise" or "do"). They have well defined interactions. I don'
51.
▲
by
sirwhinesalot
5mo ago
I'm thinking a less formally than that. Protocol in a very layman-y "perform is supposed to do this, resume is supposed to do this". For example, Koka compiles handlers differently depending if they do multi-shot continuation
52.
▲
by
sirwhinesalot
5mo ago
They're really just a protocol. You can implement them in various ways. They will always be some sort of delimited continuations but a "function call" or continuation passing style or anything of the sort does not have to be
53.
▲
by
sirwhinesalot
5mo ago
I agree but I also think it's important to point out that Algebraic Effects typically refers both to a runtime feature (the try/handle delineated continuation stuff) and also a type system feature. The latter is very important bec
54.
▲
by
sirwhinesalot
5mo ago
We disagree that they're just continuations (only one of many possible implementation strategies) but agree they're nothing special ;)
55.
▲
by
sirwhinesalot
5mo ago
Equating "algebraic effects" with "continuations" is like saying "if" is just "goto" (which isn't even true, e.g., an if can turn into a cmov or whatever). The only mystique around algebraic effe
56.
▲
by
sirwhinesalot
5mo ago
NSLinkAttributeName?
57.
▲
by
sirwhinesalot
5mo ago
If you need to display HTML content (what Markdown usually translates to) then WKWebView is the control to use! Or use something like litehtml which should be more than enough for Markdown unless you want to support "Animated Gifs"
58.
▲
by
sirwhinesalot
5mo ago
This is actually what I do. I'm extremely picky about the code and force the LLM to rewrite it 1000x times until it is basically exactly what I want. You might be wondering what is the point when it would be faster for me to just write
59.
▲
by
sirwhinesalot
6mo ago
I love this thought experiment. If you pick red you survive. If you pick blue and at least 50% of people picked blue, you survive, otherwise you die. There's 0 advantage to picking blue, none what so ever, the only reason you'd pi
60.
▲
by
sirwhinesalot
6mo ago
There is good quality stuff at Microsoft, it's just on some of the innards. NT Kernel, Direct3D, .NET Runtime. Also a lot of stuff that came out of Microsoft Research like Z3. Which also happen to be the sort of projects older devs wou
More ›