Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I don't have the creds to give a definitive answer, but I like C structs, JS dicts, Java object access, Haskell lenses, etc -- any kind of dot syntax.

Default Racket: (potato-skin-color apotato)

JS: apotato.skinColor

The extra potato upsets me. Some libraries exist to address this but I believe they all have caveats.

With copying or mutation, it's even worse:

Racket copy: (struct-copy potato apotato [skin-color 'brown])

Racket mutate: (set-potato-skin-color! apotato 'brown)

JS copy: { ...apotato, skinColor: 'brown' }

JS mutate: apotato.skinColor = 'brown'

None of this really ruins the language for me, considering pros vs cons as a whole, but sometimes I'm slowed down in that by the time I finish mentally spelling out and typing the struct accessing I half forget the context I was in, and in general I'm sensitive to "eye bleed". Sometimes Racket looks like:

(define define match-define define define-values define begin cond define define)

when the real meat of the algorithm is more like:

cond

...and where Haskell's "where"s, "|"s, and "="s shine.

I'm sure I've over-answered your question but it's the holidays and I'm bored :)

edit: Since Racket uses dot already, it would probably have to be a different character, or the other way around.



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

Search: