Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
mrkeen
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
30 ms
·
601.
▲
by
mrkeen
1y ago
The only decisions that matter for languages that get adopted are the decisions that cause adoption. JS went without static types, Go went without generics, PHP was just a tool for reducing html boilerplate. New languages love to stick nul
602.
▲
by
mrkeen
1y ago
And Rich Hickey calls out even that last feature as a mistake, and I tend to agree. https://gist.github.com/reborg/dc8b0c96c397a56668905e2767fd6...
603.
▲
by
mrkeen
1y ago
If only! Java gives you just enough non-objects to make pass-by-value or pass-by-reference something you need to be aware of, likewise with == and equals.
604.
▲
by
mrkeen
1y ago
The problem is when you take out mistakes, there's not much left of OOP. We take out 'dog-is-an-animal' inheritance. We take out object-based delegation of responsibility (an object shall know how to draw itself). A Painter
605.
▲
by
mrkeen
1y ago
Someone ought to write an article explaining the right way to do these things, rather than just telling us to do it right: > Thawing vacuum-packed fish correctly > Improper thawing of vacuum-packed fish can lead to a foodborne illness
606.
▲
by
mrkeen
1y ago
Nope. Stack Overflow partnered with OpenAI. It's just us humans that get the bad experience.
607.
▲
by
mrkeen
1y ago
Any day now https://motherfrunker.ca/fsd/
608.
▲
by
mrkeen
1y ago
Dozens of comments and no mention of DIP yet. You should absolutely use dependencies, and your should be able to tear them out as soon as you don't like them anymore. Including the dependency can even be part of your NIH if you're
609.
▲
by
mrkeen
1y ago
> Why doesn't anyone get upset by the fact that the use of Executive Orders has been massively abused by both parties Because all you can do in a two-party system is vote in the other EO abuser.
610.
▲
by
mrkeen
1y ago
Batteries included is a fat, opinionated standard library. I think for some devs, if you import from the standard library, that somehow counts as DIY, whereas if you import from libraries that aren't distributed with the compiler, it&#
611.
▲
by
mrkeen
1y ago
I encountered this trying out PureScript. Looks like a good language, but I gave up after a couple of trips through npm, bower, yarn...
612.
▲
by
mrkeen
1y ago
It could be the other way around. There may not be anything worth paying attention to.
613.
▲
by
mrkeen
1y ago
IOW return something for the caller to validate.
614.
▲
by
mrkeen
1y ago
https://web.archive.org/web/20250711041059/https://www.scien...
615.
▲
by
mrkeen
1y ago
In pure C however, you still get the types-in-source-code explosion, for lack of parametric polymorphism. You need an email_or_error and a name_or_error, etc. The alternative is to fake PP with a void*, but that's so ugly I think I&#
616.
▲
by
mrkeen
1y ago
I've re-read the article again since getting a bunch of up and down votes across the comment section, and I think you've chosen a better name for this article than PdV. It really is just about using newtype wrappers.
617.
▲
by
mrkeen
1y ago
I'm not smart enough to suggest a fix here, I'm just pointing out that this article is not the PdV from the well known article. But I can spot when code is doing exactly what the cited article says not to do , This line is the
618.
▲
by
mrkeen
1y ago
There's a huge difference. One is an email_t to validate and one is a char* to validate. As established, head is partial because there is no element to return if the list is empty: we’ve made a promise we cannot possibly fulfill.
619.
▲
by
mrkeen
1y ago
Every C programmer is already doing it the 'good' way (validation), so this article doesn't really add anything. The only fundamentalism involved in PdV is: if you have an email, it's actually an email. It's not ar
620.
▲
by
mrkeen
1y ago
This is validate . You made an email-or-error type and named it email_t and then manually checked it. PDV returns an non-error-email type from the check method .
621.
▲
by
mrkeen
1y ago
Correct. You'll never see a raw float on the LHS of a PDV expression.
622.
▲
by
mrkeen
1y ago
Correct, it is fairly standard C code. It is not Parse, Don't Validate .
623.
▲
by
mrkeen
1y ago
It's the parse-versus-validate hill in this case. This pseudocode is "Validate" for at least 3 reasons: Forgetting to check: this check is fragile: it’s extremely easy to forget. Because its return value is unused, it can
624.
▲
by
mrkeen
1y ago
This stuck out: email_t theEmail = parseEmail(untrustedInput); if (theEmail == PARSE_ERROR) { return error; } An email_t is not a parse error, and a parse error is not one of the emails, so this shouldn't compile (and I
625.
▲
by
mrkeen
1y ago
Alright, so where can I read more about the visitor pattern's "reject" method?
626.
▲
by
mrkeen
1y ago
Me too. No-one's denying that recursion is happening. We're just not sure about it being synonymous with the Visitor Pattern.
627.
▲
by
mrkeen
1y ago
Nope, you had it right. Visitor thoroughly confuses me in the context of parsing (maybe in all contexts.) visit and accept are not the verbs I want to be seeing in the code. I want to see then , or , and try .
628.
▲
Krafton slams ex-Subnautica 2 execs – who now say they're suing
(theverge.com)
4 points
by
mrkeen
1y ago
|
0 comments
629.
▲
by
mrkeen
1y ago
Since the 90s
630.
▲
by
mrkeen
1y ago
Sweet, aside from n/0==0 and no native compilation, it seems like the perfect language!
More ›