3 ms·
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:
by astrobe_ 12y ago
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.
- tiziano88 12y agoJust 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.
- ky3 12y agoAnd 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.