Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
jolux
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
48 ms
·
781.
▲
by
jolux
5y ago
Depends what you mean by “custom types.” Elixir supports structs, but they’re not really as rich as classes in another language, for example. If you just want to write type signatures for your functions though, this is a pretty good guide:
782.
▲
by
jolux
5y ago
Maybe it does, maybe it doesn’t. Maybe somebody gave you a keyword list that they thought had unique keys and it didn’t. The point is, the two structures are not semantically equivalent, and I think it’s a mistake to conflate them in genera
783.
▲
by
jolux
5y ago
The work scheduler example involves writing a work scheduler, though :). The logic is going to go somewhere, is what I’m saying.
784.
▲
by
jolux
5y ago
Well yes, because not finding a key in a map is not an error typically. Map.get is the same way, as is Access. It returns nil. If you want it to be an error you can use the version that raises.
785.
▲
by
jolux
5y ago
In Elixir’s standard library at least, it is pretty consistent. Functions that can fail return tagged tuples, and functions that will throw when they fail end in !.
786.
▲
by
jolux
5y ago
I would recommend writing specs for your functions and using Dialyzer, too :)
787.
▲
by
jolux
5y ago
The scenario is not invented per se, it’s something that really happens sometimes. Maybe the systems you interact with never return malformed data more than a few times, but the ones I work with do. Throwing an exception on a deserializatio
788.
▲
by
jolux
5y ago
> The use case I had in mind was specifically how people will use `Keyword.get` to grab configuration values or options. It seems like this advice is very dependent. I think you should decide whether a function accepts maps or keyword li
789.
▲
by
jolux
5y ago
Kinda, see https://hexdocs.pm/elixir/1.12/Kernel.SpecialForms.html#with...
790.
▲
by
jolux
5y ago
I disagree about not using the module-specific `get` functions. They should be used when you expect what you’re operating on to be a specific type. Sometimes I want to write a function that only operates on maps, and Map.get will throw an e
791.
▲
by
jolux
5y ago
Which other ultrabooks, specifically? It’s definitely not all of them, if you’ve been reading the benchmarks.
792.
▲
by
jolux
5y ago
It’s open-source, and the author has a long history of supporting his product for free as an ethical good, even while some of his collaborators have went commercial and cashed out, once even taking the project name.
793.
▲
by
jolux
5y ago
If you thought a MacBook Air was going to replace a purpose-built machine learning workstation of course buying it would be a mistake, because it won’t do that. It only supports up to 16GB of RAM! But what other computer in that form factor
794.
▲
by
jolux
5y ago
I believe it was tptacek who once commented half-jokingly that the ideal thing to do would be to leave the API open to uBlock Origin exclusively and kill it for everything else. The privileges required by that extension and others like it a
795.
▲
by
jolux
5y ago
> As long as the user in question is informed and alerted to the potential security risks shouldn't it be within the user's purview to decide what to allow and what not? In a purely ethical sense, absolutely yes. But we're
796.
▲
by
jolux
5y ago
> I get it, I'm just saying it's not like they're selling essential oils or healing crystals. You might have more of an argument here if this drug was only going to cost as much as essential oils or healing crystals, ironi
797.
▲
by
jolux
5y ago
This is an epistemologically leaky argument. The goal of an Alzheimer’s drug is not to reduce amyloid plaques, it’s to treat Alzheimer’s. There is, as of now, no evidence that it does so. Giving people false hope of treating a horrible dise
798.
▲
by
jolux
5y ago
They have failed to prove efficacy in a trial. Why believe it has a 3% chance of working? Do you think arbitrary chemicals have a 3% chance of curing some disease, even when it has yet to be shown? There’s absolutely no reason to believe th
799.
▲
by
jolux
5y ago
Well past a certain scale you almost certainly have infrastructure that isn’t an iOS app.
800.
▲
by
jolux
5y ago
Sure but that's nothing like deterministic destruction, where I can tell you the order that things will be deallocated just from looking at a block.
801.
▲
by
jolux
5y ago
M1 Macs can already run iOS apps.
802.
▲
by
jolux
5y ago
How is RC deallocation deterministic? Besides which I don't want to have to keep track of weak references, at that point I would rather just have a full ownership model: https://github.com/apple/swift/blob
803.
▲
by
jolux
5y ago
Swift is currently reference counted, which is more or less GC but worse because it’s not tracing/cycle-detecting.
804.
▲
by
jolux
5y ago
> I mean, what if the world's billionaires are eventually forced to transect on a public blockchain? That’s never going to happen because the technology is not going to get that far. How do you have effective monetary policy with a
805.
▲
by
jolux
5y ago
Absolutely, but that doesn’t mean we shouldn’t be trying to resolve problems all the same. Teams not having control over their work is inefficient.
806.
▲
by
jolux
5y ago
Sounds like you have a dysfunctional organization.
807.
▲
by
jolux
5y ago
I wouldn’t choose it because I don’t like it. I’m not going to change a housing situation I like a lot just to make it easier to work from where I live. That’s the opposite of work-life balance, to me.
808.
▲
by
jolux
5y ago
Yeah, I have to work in the same room that I sleep in, and I only have one monitor and one desk.
809.
▲
by
jolux
5y ago
It’s funny because I feel like I’ve been reading article after article recently about how working in offices is dumb and they can’t imagine why anyone would do it anymore unless they were zombified corporate stooges. My feeling is that work
810.
▲
by
jolux
5y ago
Less stress probably, but don’t they pay pretty well?
More ›