3 ms·
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
by _lvbh 2y ago
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
- deleted 2y ago[deleted]
- jsfysdfwmyasdf 2y ago[flagged]
- fredrikholm 2y ago> 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
- metadat 2y agoAgreed 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 https://news.ycombinator.com/item?id=41142737 House of horrors, especially the URL equality triggering DNA requests.
- throwaway8e83 2y ago> 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.
- jayd16 2y agoWhat a reach to blame Java.