4 ms·
Reading the description of the stdlib type, I can't help but be reminded of the statement that the go way of solving a problem is to ignore real-world problems
by ATsch 6y ago
Reading the description of the stdlib type, I can't help but be reminded of the statement that the go way of solving a problem is to ignore real-world problems and half-ass things for the sake of a simplicity that merely pushes the complexity elsewhere. It certainly does seem to apply here too. Glad this library exists now though.
- staunch 6y agoThat's a pretty lazy criticism given how much of the most modern and popular networking and system software is written in Go (Kubernetes, Docker, all the related infrastructure, etc). The "net" standard library is still very nice and works extremely well. The proof of the pudding is in the eating, and the Go pudding has been eaten successfully many times.
- deleted 6y ago[deleted]
- zelon88 6y agoAnd Facebook was written in PHP. That hardly means that PHP doesn't have flaws or quirks or drawbacks. And to your other point, I've never used docker or kubernetes and I am alive and fully functional without them. As far as I'm concerned containers are a gimmick just like VPNs and just like go. It's a very hands off and ineffective approach to security that just makes you more comfortable being more lazy.
- blablabla123 6y agoI remember a time when Facebook would make a quite buggy appearance for a year or two. Must have been around 2015. Docker and k8s are tools to make Linux cgroups more accessible for the user. In total they add more structure to files and processes. I cannot really say that about VPNs since OpenVPN for instance just overwrites all my network settings. But I guess it's possible to write bad code in every language.
- kortilla 6y ago> networking and system software is written in Go (Kubernetes, Docker, all the related infrastructure, etc). Kubernetes and Docker are not networking. They orchestrate some networking components that do the actual network processing in the kernel (iptables, ebpf) or other high performance user space c/c++ (dpdk, etc).
- zeeboo 6y agoThe standard library IP type has worked for numerous programs for a literal decade. Just because a specialized application can do a better job by leveraging, again, decades of real world experience with the language doesn't invalidate that or mean it's half-assed. I think your statement reflects more on your own biases than reality.
- ATsch 6y agoI am not saying that the type is unusable. Plenty of high profile software has been written with C strings too yet we almost universally recognize them today as a mistake. What I'm saying is that the design flaws of net.IP, the absence of which would have benefited the whole ecosystem, fall into a familiar pattern that can be learned from. It is good to see that addressed, even if by third parties.
- zeeboo 6y agoIf you can look at any widely used API that has existed for an extended period of time and not find a single tradeoff or hindsight flaw, you aren't looking hard enough.
- ATsch 6y agoI think being able to compare or hash IP addresses is a pretty baseline feature for an IP address type. I don't think that's some kind of unpredictable hindsight or tradeoff.
- tptacek 6y agoObviously, people routinely compare and hash IP addresses in Go programs.
- ATsch 6y agoI can't tell if your're being sarcastic but it's hard to find a program that uses UDP and doesn't at some point store IP addresses in a hashmap. Many more will do the same for per-IP rate limiting. I think those are reasonable use cases for go.
- dmd 6y agoThompson and Pike are both Bell Labs, the origin of https://en.wikipedia.org/wiki/Worse_is_better#New_Jersey_style https://en.wikipedia.org/wiki/Worse_is_better#New_Jersey_sty... - so that's by design.