4 ms·
This reminds me of Paul Graham's Five Questions About Language Design (https://paulgraham.com/langdes.html https://paulgraham.com/langdes.html): "When language
by patrickmay 3y ago
This reminds me of Paul Graham's Five Questions About Language Design (https://paulgraham.com/langdes.html https://paulgraham.com/langdes.html):
"When languages are designed for other people, it's always a specific group of other people: people not as smart as the language designer. So you get a language that talks down to you."
The same applies to these style standards. I agree with his third point in that article:
"3. Give the Programmer as Much Control as Possible."
- strongpigeon 3y agoIt seems like you're conflating "options" with "control". The two Scala example shown in the articles are two ways (or options) of writing the same code, but having two ways of writing this doesn't really give you more control over what's happening.
- eapressoandcats 3y agoI think that points 3 and 4 of that article are somewhat refuted by the popularity of Go. You could argue that Go ultimately does give you a much control as possible but it certainly doesn’t do it like Lisp in the way that Paul Graham admires, and Go definitely doesn’t focus on brevity, beyond avoiding Java style magic incantations and boilerplate. Interestingly Go is designed for “yourself and your friends” and they ended up in a very different place from the hackers that Paul Graham admires. It’s a language spawned from the pain points of large corporate software projects that wins a lot of sympathy from smart engineers that are working on large corporate software projects. The fact that it translates well to small projects as well is definitely an engineering feat.
- The_Colonel 3y agoThe single biggest factor in Go's popularity is that google is pushing it. Then I'd say concurrency, native compilation, static linking... The simplicity of its language constructs is IMHO one reason why Go is not more popular. The point seems moot anyway. Go is mostly used by experienced programmers, usually havong experience in other, richer languages.
- zachmu 3y agoGo is a language made for people doing systems programming who like static typing. Compared to popular alternatives like C# and Java, Go is a breath of fresh air.
- The_Colonel 3y agoGo was intended for systems programming, but is rarely used for that. (Java and C# don't compete in that area at all)
- marcosdumay 3y agoGo is marketed as being designed for system programming. But all of its features seem to be designed for web services.
- kaba0 3y agoGo has a stupid definition of “system programming”. It uses it to mean “low-level network stuff”, and absolutely not as something where low-level languages would fit.
- neonsunset 3y agoDon't bundle C# with Java in this area. It is way more low-level. Give it a try and it will surprise you :)
- kaba0 3y agoIn what way is an objectively more verbose language than C# and Java a “breath of fresh air”? Especially one so badly designed with gotchas everywhere (defer being function scoped, they even got loop captures bad at first, when that was a well known problem 50(!) years ago, etc)
- bruce343434 3y agoWhat exactly is "systems programming"? I thought that had to do with manipulating hardware? Usually Java and C# are more associated with application programming...
- goatlover 3y agoGo is popular, but so are Javascript and C++. I don't really know that you can draw any sort of conclusion from one language being popular.
- patrickmay 3y agoI was thinking of Go when I re-read that article. Unlike many here on HN, I am not a fan of Go because I find it far too opinionated and untrusting of its users. While technically it might have been written for Pike's and Thompson's friends, it does feel to me like a language designed to prevent poor programmers from making mistakes.
- ReleaseCandidat 3y ago> it does feel to me like a language designed to prevent poor programmers from making mistakes. That's Rust. I would not call _any_ language containing some kind of nil pointers to be " designed to prevent poor programmers from making mistakes". Go is mainly designed to be "easy to read" (and excels at that if you are used to C-style syntax).
- rightbyte 3y agoEasy to read? That would be Python. I would say Go is designed to be fast to learn for experienced programmers. Null pointers are a free runtime check for invalid assumptions. I don't understand the fuzz about them being bad at all.
- kettro 3y agoI find python quite hard to read, honestly. The lack of typing in most python means that it isn’t immediately clear what a given piece of code does without diving into its implementation. You have to rely on docstrings (good luck) or descriptive naming. The issue with null pointers is that they are, as you said, a stand-in for an invalid state. However, most null pointers don’t prevent you from trying to use the underlying data, which can, among other things, cause crashes (think not checking the return value of malloc). Additionally, it doesn’t make formal the litany of possible forms that a value can take — if you codify possible states, then you don’t always need to check everything. I’m currently working to port security firmware from C to Rust, and I’ve found I make fewer state checks, because the data I’m working with has bounded state — the data given cannot be in an invalid state.
- paulddraper 3y ago> Go definitely doesn’t focus on brevity It does, arguably to a fault. * Single-letter variables * Capitalization instead of private/public
- harkinian 3y agoRequiring explicit error handling instead of exceptions makes it not brief. Lots of things will fail, and every single time: f, err := Sqrt(-1) if err != nil { // handle error } Probably async/await would make things briefer too, idk, haven't used Golang enough to tell.
- tootie 3y agoI don't know why this goes against programmer culture so much, but for me rule number 1 should be Optimize for IDE Integration. And probably number 2 should be, readable stack traces.
- harkinian 3y agoIn general, I care the most about it being easy to debug by a random person who's never seen it before and barely knows the language either. So #2 stack trace as you said. Add in simple syntax. Lots of languages, libs, frameworks, etc show off how nice they are when everything is happy and ok; that's easy.
- harkinian 3y agoGolang talked down to its users about generics for a long time, then they finally gave in. Give it some more years and they'll finally have exceptions and async/await.