3 ms·
I happened to believe that a language should have one style. You want a functional language? Use it. You want a procedural language? Use it. You want an OOP
by greenhouse_gas 10y ago
I happened to believe that a language should have one style.
You want a functional language? Use it.
You want a procedural language? Use it.
You want an OOP language? Use it.
They're all good, but not in one language.
For example, you like FP idioms, and program everything with maps.
I like for loops.
You have to fix my code one day I'm on vacation.
You think that it's ugly, and rewrite it as a map.
I get back, bug comes up, I rewrite it back to for loops.
Repeat.
Go showed how to finally end indentation wars, maybe it can show how to end style wars.
- dasil003 10y agoEven though I've written more ruby than anything else over the last decade, I have to agree with this. Ruby is nice OO language, but it's unabashedly multi-paradigm, and that leads to a lot of mess when you get a team with varying backgrounds the result is potentially a byzantine mix of procedural, object-oriented and functional styles.
- maxxxxx 10y agoWhen you are in a big project a multi paradigm language seems to be the only way for introducing new styles. In the stuff I am working on I can't just switch to a new language. I agree that this can create a mess though.
- dasil003 10y agoAbsolutely, but it's such a double-edged sword. All else being equal, I love ruby, and when it comes to shitty legacy codebases, you can do worse than ruby because of the power at your disposal to work around problems. On the other hand, it's not that hard in ruby to make something that is so thoroughly fucked that there's no reasonable option but to nuke it from space. The beauty of Java, Go and Haskell (never thought I'd use those 3 in the same sentence) is that you really have to work to fuck things up that badly.
- oxalorg 10y agoI completely agree, and it's one of the reasons I've liked Python. From the zen of Python: There should be one-- and preferably only one --obvious way to do it.
- greenhouse_gas 10y agoThis is my problem with modern day Java. Java is an OOP language. OOP languages communicate through message passing. So why do modern UI frameworks use callbacks?
- copperx 10y agoBecause, as a Zen master would point out, there is no message.
- pcwalton 10y agoSince you can write for loops in anything other than a pure functional language, this is equivalent to saying that, unless your language is pure functional, it shouldn't have any FP features in it. I think this is obviously false: Ruby is not any worse for having the map method.
- stymaar 10y ago> You have to fix my code one day I'm on vacation. > You think that it's ugly, and rewrite it as a map. Well, if your colleagues do that, their is a social problem in your company, and I'm not sure a langague has anything to do with that. Your colleagues could also rename all your variables at this point…