Live data from Hacker News

Replacing Clever Code with Unremarkable Code in Go

vividcortex.com

11–20 of 140 posts

Re: Replacing Clever Code with Unremarkable Code in Go

#12

I think this is one of the really great things about Go. Some detractors ask "There is so much to be gained by having generics! What would be lost if Go had generics? Nothing! Ergo, Go is wrong to not have generics". This line of argument is flawed. Go curbs the ability of people to write crazy (and ultimately mentally expensive) abstractions. The lack of generics in Go is very a good thing. Especially when it comes…

Really? I thought the reason Go didn't have generics is because they couldn't decide on an implementation that met their goals? That is, was quick and didn't emit a ton of code.

Re: Replacing Clever Code with Unremarkable Code in Go

#13

I think this is one of the really great things about Go. Some detractors ask "There is so much to be gained by having generics! What would be lost if Go had generics? Nothing! Ergo, Go is wrong to not have generics". This line of argument is flawed. Go curbs the ability of people to write crazy (and ultimately mentally expensive) abstractions. The lack of generics in Go is very a good thing. Especially when it comes…

Limiting power was the argument for making Java crippled too.

On the topic of generics specifically, parametric polymorphism actually makes code simpler, see e.g. Haskell.

Re: Replacing Clever Code with Unremarkable Code in Go

#14

I think this is one of the really great things about Go. Some detractors ask "There is so much to be gained by having generics! What would be lost if Go had generics? Nothing! Ergo, Go is wrong to not have generics". This line of argument is flawed. Go curbs the ability of people to write crazy (and ultimately mentally expensive) abstractions. The lack of generics in Go is very a good thing. Especially when it comes…

Really? I thought the reason Go didn't have generics is because they couldn't decide on an implementation that met their goals? That is, was quick and didn't emit a ton of code.

I don't claim that was their goal. I think it's just a nice side-effect.

Re: Replacing Clever Code with Unremarkable Code in Go

#15
post #13

I think this is one of the really great things about Go. Some detractors ask "There is so much to be gained by having generics! What would be lost if Go had generics? Nothing! Ergo, Go is wrong to not have generics". This line of argument is flawed. Go curbs the ability of people to write crazy (and ultimately mentally expensive) abstractions. The lack of generics in Go is very a good thing. Especially when it comes…

Limiting power was the argument for making Java crippled too. On the topic of generics specifically, parametric polymorphism actually makes code simpler, see e.g. Haskell.

I have to say, I love some of the principles of Haskell. I am a novice though and I currently don't stand a chance of picking up and hacking on a project without serious amount studying.

However, with a cursory glance at Go, I was able to be productive in it and hack on the go compiler and runtime itself.

Maybe this is more a statement about how little I know about functional languages or some of the theoretical techniques used in Haskell.

Whilst my mortal brain comes to grips with Haskell I am being quite productive in Go. I have learned a lot on the way, too.

Re: Replacing Clever Code with Unremarkable Code in Go

#16
http://www.paulgraham.com/avg.html

Programmers get very attached to their favorite languages, and I don't want to hurt anyone's feelings, so to explain this point I'm going to use a hypothetical language called Blub. Blub falls right in the middle of the abstractness continuum. It is not the most powerful language, but it is more powerful than Cobol or machine language.

And in fact, our hypothetical Blub programmer wouldn't use either of them. Of course he wouldn't program in machine language. That's what compilers are for. And as for Cobol, he doesn't know how anyone can get anything done with it. It doesn't even have x (Blub feature of your choice).

As long as our hypothetical Blub programmer is looking down the power continuum, he knows he's looking down. Languages less powerful than Blub are obviously less powerful, because they're missing some feature he's used to. But when our hypothetical Blub programmer looks in the other direction, up the power continuum, he doesn't realize he's looking up. What he sees are merely weird languages. He probably considers them about equivalent in power to Blub, but with all this other hairy stuff thrown in as well. Blub is good enough for him, because he thinks in Blub.

When we switch to the point of view of a programmer using any of the languages higher up the power continuum, however, we find that he in turn looks down upon Blub. How can you get anything done in Blub? It doesn't even have y.

By induction, the only programmers in a position to see all the differences in power between the various languages are those who understand the most powerful one. (This is probably what Eric Raymond meant about Lisp making you a better programmer.) You can't trust the opinions of the others, because of the Blub paradox: they're satisfied with whatever language they happen to use, because it dictates the way they think about programs.

Re: Replacing Clever Code with Unremarkable Code in Go

#18
post #2

I didn't put much code into the article, but ask me if you'd like more details on exactly what I'm talking about -- in terms of real code.

A little off-topic, but could you give some (Perl) code examples of this:

> You feel initiated into an inner circle. You feel like you’ve discovered LISP in an alternate dimension (but you haven’t).

Re: Replacing Clever Code with Unremarkable Code in Go

#19

http://www.paulgraham.com/avg.html Programmers get very attached to their favorite languages, and I don't want to hurt anyone's feelings, so to explain this point I'm going to use a hypothetical language called Blub. Blub falls right in the middle of the abstractness continuum. It is not the most powerful language, but it is more powerful than Cobol or machine language. And in fact, our hypothetical Blub programmer w…

I'm not sure what your point is, whether you think go is simple and powerful like lisp, or the new java, but simply quoting "The Blub Paradox" makes you sound pretentious (on a site where the largest percentage of readers are probably already familiar with said essay nonetheless).

I don't think this is really applicable to the article anyway, since it's an article commenting on two very different languages and programming styles, not about being satisfied with a Blub.

Re: Replacing Clever Code with Unremarkable Code in Go

#20

I just kept staring at that GIF ...

I've seen it many times before, and it's always been amusing, but looking at it within the context of "clever code" is brilliant. That's exactly what it looks like some people have done (figuratively) to produce the code that they did.
Post reply on HN