4 ms·
What is in your list of acceptable languages, and what is your list of unnecessary languages? Is date of creation a factor? Because D was created last century
by kitd 3y ago
What is in your list of acceptable languages, and what is your list of unnecessary languages?
Is date of creation a factor?
Because D was created last century.
- sfn42 3y agoSo it's over 20 years old yet nobody knows it exists. Doesn't sound very promising. The first time I heard of it was someone who uses it frequently complaining about too many breaking changes in minor updates. So it's unknown and unreliable. Who gives a crap if it has elegant syntax, it's just another way to write the same stuff. The examples from the article can be done in JS, python, java, c# almost exactly the same way. Slightly different syntax.
- pipeline_peak 3y agoI don’t think it’s fair to knock a language on rate of popularity, unless your point is community adoption. That being said, I agree with everything else you said lol. All the “elegance” in the article just reminded me of what you can achieve using Linq, or pythons list comprehension (which I personally don’t care for). I used to get excited about one-liners, but if that’s what elegance is, elegance is not important to me. Are you gaining efficiency or playing code golf? If there’s anything dev jobs have taught me it’s that readability is whats most important. You can keep your fancy lambdas etc. Those things have their place but it’s not a crime to write a for loop with local variables. Unless what you’re doing is as simple as a single statement, a mapping or printing something, One liner loops are not as productive or efficient. when you have multiple statements, you’re often just calling multiple loops. And don’t forget the extra time you have to spend to get the damn thing to work, as opposed to a classic for loop.
- sfn42 3y agoI think popularity implies usefulness to a degree, but I don't disagree that it might be unfair. As for the functional approach to collection operations, I personally like it a lot. When I used Java, I used streams a lot, now that I primarily use C# I use LINQ a lot. I think in a lot of cases the syntax is more expressive and hence more readable than loops, but both have their place and both can be used badly. Often times you can write a simple statement that does a lot of work and is very clear to the reader, assuming they are familiar with the API/paradigm. Equivalent loop implementations can be significantly more verbose which generally reduces readability. Other times a simple task can require a very convoluted functional approach whereas a loop implementation would be fairly straight forward. As with everything there are pros and cons, they both have their niche but personally I think I use the functional approach more than I use loops these days.