Hacker News new | ask | show | jobs
by berdon 5126 days ago
function foo(bar : string) : string...

Why, why do we need unnecessary tokens?! Get rid of the stupid :'s.

5 comments

I agree We should also take periods out of sentences They aren't needed as long as you capitalize the first letter of every sentence This makes things much cleaner
Odd, I had no problem reading your comment. It also has an unusual clean-ness.

Maybe period-less sentences are the future Throughout history english has already had many typological changes From a DRY stand-point capitalization and periods contain the same information payload Eliminating one of them would thus be good software engineering Right?

I didn't notice there were no periods till I finished reading and then had a "hey, wait a second" glance back This is an experiment worth trying out: just write everything in this style for a while

The main problem I see here is figuring out whether a new sentence has been started when a Proper Noun or capitalized pronoun like "I" has been introduced I provide the current sentence as an example of that It's not so hard to figure out from context usually, but I'm sure there are easily constructed cases where the meaning changes based on the period Then again, much of the English language is like that

"... been introduced I provide the ..."

I'll admit that I did a triple-take when reading through your example. Let's keep periods. :)

This is a cognitive problem. I also read you as doing a "double-take", even though you clearly wrote "triple-take". Another cognition issue. The unthinking mind reacting automatically without consulting our conscious. The solution is obviously to augment our brains with computers. :)
Interesting. RandallBrown's was easy to read, but you're wasn't. I read "are the future throughout history" and cracked up :)
I think they make the types read better, personally, especially if you leave out the space to the left-hand side of the ':'. It clearly signifies to the reader where the code is entering the type grammar. And if you leave out both the spaces to the left and the right of the ':' (as OCaml code often does), it's exactly as many characters as the version with spaces.
I was hoping it was because they allowed `(x, y, z: int)` as syntax sugar (like OOC does)... but no, they don't. In that case the : is a bit pointless.
I think that most new languages feel obliged to have some sort of fun syntax quirk, usually, it seems, in the form of odd token choices.
They work for Scala...