Hacker News new | past | comments | ask | show | jobs | submit login

I think the programmers among us are infected by the use of punctuation marks as part of the syntax. Many programming languages just hijack punctuations marks: C's field.selector is plain silly when you think about it and about the fact that the colon was available; and now something less natural than the period must be used to separate statements. As for Haskell, I find that the ML family is IMO quite remarkable for its tradition of terrible syntax choices (again, why x:xs when x,xs was an option? And that convention of putting commas at the beginning of a line!?).

It seems to me that arguing about what a comma means when put in this or that place is symptomatic of this programmer mindset. Natural languages are ambiguous, redundant and sometimes inconsistent by non-design. And so is their punctuation. Nobody understand punctuation, especially programmers.




Just to clarify, in Haskell:

- [x,xs] is the list defined by exactly the element x followed by the element xs;

- x:xs is the list defined by the element x followed by the list xs.


And to add to this, the unspoken Hungarian notation rules have xs typed as a list.

So the 1st instance: [x,xs] looks unprofessional and n00b-ish.

It's the 2nd instance that's idiomatic.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: