Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Misconceptions probably come from Java or Python where a bunch of things are implicitly done for you. I much prefer Golang’s explicitness. The stuff with slices are confusing though


What a reach to blame Java.


Agreed on this one, the "fix" involving the capacity flag, e.g. "2:3:3" is unintuitive compared to Python where there is no such concept.

Still, as far as sharp edges go these are nothing compared to Java.

See the discussion from:

Common I/O Tasks in Modern Java

https://news.ycombinator.com/item?id=41142737

House of horrors, especially the URL equality triggering DNA requests.


> URL equality triggering DNS requests

I agree it can be confusing, as the URL also can act as a client that performs actual connections. The documentation actually mentions that URI is a better choice when you want only a representation

In general I don't think the other examples are that bad. The reason why there are so many different ways of performing I/O, is because Java is evolving and adding better solutions, but can't really remove older stuff like "URL" because it is widely used.

I see similar issues with other languages as they evolve, and I think Java has managed it well. The IDEs are also often good at making suggestions on how to replace outdated code.


[flagged]


> Maybe you meant Zig or C

This seems hubris for someone who depends on types, looping constructs, and compilers.

Maybe you meant writing machine code or 6502, then I'd likely agree, but C is quite literally (& excellently) designed for quiche eaters.

/s




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: