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

In Smalltalk, we had return values from ifTrue:ifFalse: statements. This served the function of the ternary ( ? : ) while enabling if-then style brackets. Also, deeply nested logic and methods longer than 10 lines were regarded as "code smells" in the community, so a lot of that logic was implemented through polymorphism.

Anyone who has the experience of reading lots of highly trivial functions like those, and gotten the feeling "I've read a lot of code, and I understand what each little bit does, but what is the whole thing trying to do?" That's a symptom of excessive verbosity.

Smalltalkers sometimes solved this through executable comments. There would be some code, with a message to "debug this," and we could just highlight the code and quickly and easily walk through it in the debugger. This demonstrates one of the advantages and disadvantages of Smalltalk: Everything could be embodied in the interaction of relatively small objects, so everything tended to be modular, more easily. The disadvantage comes from the fact that the interaction has to be understood to understand the system as a whole.




Consider applying for YC's Summer 2025 batch! Applications are open till May 13

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

Search: