4 ms·
What do you think needs cleaning up?
by supersillyus 16y ago
What do you think needs cleaning up?
- Detrus 16y agoAesthetics for starters. CoffeeScript http://jashkenas.github.com/coffee-script/ http://jashkenas.github.com/coffee-script/ is what modern syntax should look like. White space instead of the bracket mess. Go's public/private difference is capitalization of method names. That's hard to scan. Then you get chains that look.Like().A().Mess(). What the Go team seemed to do was take syntax from other languages they were familiar with, ugly syntax non-dynamic languages. They didn't focus on it, Pike said it wasn't important, semantics are important. So when you don't design syntax first, you get a syntax that's on the opposite end from Ruby. Arguments func([] byte T* blah), who knows what goes where. That needs work. The c-> and <-c is unintuitive, the syntax is so itsy bitsy it's easy to miss the difference. They should have keywords for that. And in general the syntax is itsy bitsy, they feel that shorter words means quicker to read, but it's an overreaction to never ending lines commonly found in Java and C++.
- Jabbles 16y agoIMO: I love capitalised public method names. It means I can immediately tell whether a method is public or private, in any context, e.g. on code pasted on HN. look.Like().A().Mess() looks awful. Don't do it. Or do, it's up to you/ your company's style guide. You could easily avoid chained methods entirely. Go is at the opposite end from Ruby. It's a systems language... The fact that they look different is no surprise. func([] byte T* blah) - that's not Go. send and receive are perfectly intuitive to me. Watch! You put it in the channel<-. You get it out of the <-channel. There is no "->". "in general the syntax is itsy bitsy" - I can only suggest you try it for a bit longer until you get used to it.
- Detrus 16y agoYea I don't use Go, tried it many moons ago, those were my impressions of the syntax, was going to edit with real code. Rob Pike made an interesting argument about dynamic vs compiled languages. Said that the division between easy of use and performance, dynamic interpreted vs static compiled was not caused by technical problems, just dumb luck. People that made up dynamic languages weren't interested in performance, didn't design around it. Maybe now they're perpetuating the same division in syntax. System language syntax is weird, machine looking, dynamic language syntax reads more like English. Doesn't have to be that way, but it would be the system guy's preference. So I was thinking if the dynamic language camp used to Python's syntax took up Go, maybe it would be changed for their taste. The channel <- syntax is crazy. In and out depends on which side of the operator channel is in. I'm sure they thought it was cute, but "into" "out" keywords are easier to keep track of than which side the channel var name is on.
- Jabbles 16y ago"System language syntax is weird, machine looking" - But if it's your job to program in C/C++/Go, you begin to read the code just like English. Go's syntax, you will admit, is much cleaner than C++'s. Personally I like blocks of code being separated by curly braces, I think it helps keep them separate. Combined with Gofmt, which automatically indents code (like Python), I find Go very readable indeed. I don't understand your objections to the channel syntax; the order of the letters you type matters, obviously. Again, it's a personal preference, and I'm quite used to C's pre/postfix operators.
- Detrus 16y agoMy objection is aesthetics. It's subjective, a matter of taste. I prefer languages that you don't have to get used to. They're obvious, like a good user interface is obvious. Anyone can read their code, even if they don't work in the language. Go could be a language like that, there are no technical roadblocks for doing that, just a matter of the audience's taste.
- verysimple 16y ago"I prefer languages that you don't have to get used to." Is there such a thing?
- ido 16y agoOf course - every language that is similar to one you already know well :)
- omaranto 16y agoMost people would consider Lisps, Perl and JavaScript to be dynamic languages. The first two are commonly thought to have "weird" syntax and the last has a C-like syntax --and C is the main example of system programming language. (Maybe JavaScript is a bad example since the part of C syntax people most often complain about is the declarations, which JavaScript of course doesn't have; I think the bits of C syntax JavaScript keeps are not so controversial...)