Specifying the buffer size is a cleaner API boundary. Functions that take a buffer and a size are fairly common in C, even when the buffer size could be computed.
Calculating the buffer size wrong is always an error. You just have to pick if you prefer an API that detects this or one that silently buffer overflows.
Java has a pretty good approach of promoting the more popular library for a thing to standard library status, with relatively minor changes. It's an easy way to get a really good standard library over time, as it's already proven in practice
It's really great fun to build stuff in Crystal, I don't have anything prod-grade yet to say how it scores there but the community seems to be happy about that too.
I agree, the compiler is slow but I don't mind much, or better, the fact that I find building maintainable programs much easier outweights that downside massively in my case.
Thing is, you can run ipv4 only, dual stack or ipv6 only. Ipv6 only won't work. Dual stack has a larger attack surface and is complex. Ipv4 works but costs a relatively tiny bit of money so far.
Replicating even a simple ipv4 lan with mostly stable local addresses and some isp uplink is pretty complex, even assuming all the devices involved support ipv6, which they wont
It's much easier to run a dual stack with v4 for ease of use on the lan and v6 as an additional address that can change whenever and is only used to reach the wan
But the main reason you'd care would be if you can't get a public ipv4 address to NAT to. And if you can't get that, some of the internet breaks anyway.
Then imagine the security implications of trusting windows to serve just some selected files over FTP and never have any security hole that exposed other files or allowed RCE
Calculating the buffer size wrong is always an error. You just have to pick if you prefer an API that detects this or one that silently buffer overflows.
reply