Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
justinsb
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
40 ms
·
361.
▲
by
justinsb
13y ago
If I was responsible for this decision at Apple, I would definitely be much more open to doing this now (post-WhatsApp). I'd hope Google and Apple are at least trying to get first-class interoperability between iOS / Android. Ma
362.
▲
by
justinsb
13y ago
It is a weird omission, not least because it seems that anyone that wants to use Futures ends up extending it in the same (but incompatible) way. Guava has ListenableFuture, Netty has its own version, etc. I'm not sure how this happen
363.
▲
by
justinsb
13y ago
I consider defer to be part of handling exceptions, but I can see how we differ here. We're seriously drifting off track here, but if we should rely on Go to check array indexes, that seems like you _would_ want a recover block, so tha
364.
▲
by
justinsb
13y ago
My understanding is that defer is the broad equivalent of a Java finally block, and recover is the broad equivalent of a Java catch block. I think of both as ways of handling exceptions, although I see how the word "handle" could
365.
▲
by
justinsb
13y ago
Agreed, you should be using defer, not recover. The canonical examples are closing a file and releasing a mutex. Both have code samples here: http://blog.golang.org/defer-panic-and-recover I'm confused as to what you
366.
▲
by
justinsb
13y ago
Sadly, you do, but Go makes it tolerable with "defer". Defer also produces nicer code. Without defer, to be correct you would have to explicitly 'recover' (and re-panic?)
367.
▲
by
justinsb
13y ago
To sort an array/collection in Go, you must implement an interface with 3 methods: https://gobyexample.com/sorting-by-functions It's boilerplate, which generic methods would avoid. There are shortcuts for sorting
368.
▲
by
justinsb
13y ago
I think I've answered this elsewhere: the issue for me is that you have to handle exceptions _and_ error codes. Though you raise an interesting point: Should you check array indexes if the runtime is also checking it for you? In Java,
369.
▲
by
justinsb
13y ago
You say panic, I say exception :-) My concern is not nomenclature, but that correct code must handle paniceptions. And that it must also handle return value errors. Go code IMHO ends up spending a lot of code on error handling, I think be
370.
▲
by
justinsb
13y ago
It's clear you shouldn't throw. But correct code must assume that any function you call might throw; which is why you should use defer blocks e.g. to release resources, instead of C-style "cleanup at the bottom of the functio
371.
▲
by
justinsb
13y ago
Genuinely interested: do you have a trick for making sorting a collection less copy-and-pasty?
372.
▲
by
justinsb
13y ago
Exceptions are already in the language: panic/recover. Though discouraged, you can't assume they won't happen. To me, this seems like the "worst of both worlds". It doesn't feel like a final position to me,
373.
▲
by
justinsb
13y ago
A sample set of "people that will tolerate the lack of generics" might be slightly biased on this question!
374.
▲
by
justinsb
13y ago
As I understand it, the position is that there are error return codes _and_ exceptions. Error return codes are for bad stuff, Exceptions are for really bad stuff. So correct Go code pays the price twice: it should be exception-safe, _and_
375.
▲
by
justinsb
13y ago
I totally agree; I've "gone off Go" until they figure out (1) errors vs exceptions, and (2) generics. I have no problem with them saying "we're not Going there", but if so I wish they would at least say that.
376.
▲
by
justinsb
13y ago
So "liblink" means that the compilers now generate native instructions, rather than pseudo-instructions. Seems like that would make it much tougher to implement generic methods. Anyone know if that's true?
377.
▲
by
justinsb
13y ago
I think the suggestion in the presentation was that it's a tradeoff: C++'s slowness at compilation is what enables it to be both fast at runtime and fast to program (at least when it comes to generic methods; it obviously has othe
378.
▲
by
justinsb
13y ago
I'm delighted to see that they're thinking about implementing generic methods, and even included the canonical Sort worst-case example. The framing of the tradeoffs (slow programmer, slow compiler or slow execution) is interesting
379.
▲
by
justinsb
13y ago
The arrow keys don't work for you? If it's got to be a slideshow, I much prefer this to SlideShare!
380.
▲
by
justinsb
13y ago
Kudos to the authors for releasing their source code on github. The code may have some rough edges at the moment, but putting it on Github is a great way to encourage collaboration / improvements, and can only encourage greater adopti
381.
▲
by
justinsb
13y ago
You will likely be happy with PostgreSQL or MySQL. If you don't know why you're not using a SQL database, likely you should be. If you do want to experiment with NoSQL databases, MongoDB is probably the easiest to get going with
382.
▲
by
justinsb
13y ago
It's been repeatedly discussed (ad nauseam?) - I recommend checking out hnsearch.com. I dislike MongoDB, but if I had to try to summarize objectively: 1) It is marketed very heavily, including to use cases to which it is poorly suited
383.
▲
by
justinsb
13y ago
That procedure is ridiculous, and they even admit that it is broken e.g. other callers can see intermediate results. If you are even thinking about following any of the advice on that page, you are no longer in the MongoDB use case: you pla
384.
▲
by
justinsb
13y ago
Comcast has it deployed very widely. Definitely in (most of?) SF. Note that you need an IPv6 capable cable modem & router. Recent cable modems are mostly capable, and most (all?) Apple routers are.
385.
▲
by
justinsb
13y ago
Thanks. For anyone reading along, reboot does now work, and I was just able to install systemd (apt-get update, apt-get install systemd, edit /etc/default/grub, edit /etc/fstab to remove the systemd-unsupported nobo
386.
▲
by
justinsb
13y ago
If you're running Debian on EC2, do you have the problem where restart from within the instance doesn't complete? (Have you found a way around it?) Edit: Not sure whether there was a real problem before (vs PEBKAC), but the new i
387.
▲
by
justinsb
13y ago
What makes you think they won't? I don't think they will ever have the gravitas of a dot-com, but the unavailability of good .com domain names has led people to accept other TLDs. The popularity of .io in tech is a good example;
388.
▲
by
justinsb
13y ago
This is a long-standing argument in OpenStack. The root problem is that the AWS API exposes only what AWS exposes (trivial example: no live-migration.) The AWS API precludes features better than AWS, which is a big driver for some private
389.
▲
by
justinsb
13y ago
Yes, I'm thinking of the big picture. Might be more like Java 12 than Java 9... Or Quasar today!
390.
▲
by
justinsb
13y ago
Well, I appreciate the honesty! I'm excited by the idea that threads are going to be "the right way", once these improvements make it out of the 'plex. I also like that I can get a similar API today with Quasar :-)
More ›