4 ms·
Yep...there are dynamic languages (Ex: APL and Common Lisp) where you can use OO primitives, but it usually isn't as encouraged if at all. I don't recall hearin
by 6thaccount2 7y ago
Yep...there are dynamic languages (Ex: APL and Common Lisp) where you can use OO primitives, but it usually isn't as encouraged if at all. I don't recall hearing much about proper design patterns in those languages. I'm not saying they don't exist, but it isn't a big deal. Smalltalk on the other hand forces you to do OO and I just read most of a book on the proper design patterns to use in it. It certainly isn't as bad as when I started to learn Java (it's almost a minor miracle to me that as much stuff gets built in Java as it does with all the straight-jacket boilerplate it has) but it is definitely there. Especially in the scripting arena (shorter programs of maybe a page or two) I find that nearly all OO scripts I see would generally be shorter and clearer as a few global data structures and some functions to operate on it.
- kazinator 7y agoOn the contrary, Common Lisp codebases nowadays are almost annoyingly replete with OOP.
- 6thaccount2 7y agoPaul Graham save us all ;)
- mr_crankypants 7y agoFunny you should mention global data structures. Last winter, when doing Advent of Code, it took me an embarrassingly long time to realize that I didn't really need to be writing super well-factored Clean Code™ with no globals or anything like that to solve these problems. And, when I stopped worrying about that stuff, my code ended up getting cleaner and easier to understand and debug. New hypothesis: Some practices make all the sense in the world in huge enterprise projects, and no sense at all in small utility projects.
- 6thaccount2 7y agoAgreed. The way I code would need to flip-flop if I was more involved with the writing of large software projects. Funny enough though. Those that I work with still write a lot of what I would call scripts, but they're super over architected and a lot of time is wasted and it is hard to read them. Sometimes simplicity is best as you observed.