|
Academic drivel; here in the real world, code is pragmatic.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
I kind of struggle with anyone that tells me that this is more readable than a for loop:
const result = array
.filter(isPrime)
.map((e, i, a) => i > 0 ? e * (e - a[i - 1]) : e)
.filter((e, i, a) => i >= a.length - 10)
.reduce((a, e) => a + e, 0);
98.4% of statistics are made up on the spot.
|
|
|
|
|
But it's computationally provably correct...
#SupportHeForShe
Government can give you nothing but what it takes from somebody else. A government big enough to give you everything you want is big enough to take everything you've got, including your freedom.-Ezra Taft Benson
You must accept 1 of 2 basic premises: Either we are alone in the universe or we are not alone. Either way, the implications are staggering!-Wernher von Braun
|
|
|
|
|
And it's all backed by six for loops.
|
|
|
|
|
Same here, although I felt the same way about a lot of Linq for the first year or so I was using it. Assuming I got to the point where I did get the syntax readily, I could see it going above the nasty looking for loops in the later examples.
Did you ever see history portrayed as an old man with a wise brow and pulseless heart, weighing all things in the balance of reason?
Is not rather the genius of history like an eternal, imploring maiden, full of fire, with a burning heart and flaming soul, humanly warm and humanly beautiful?
--Zachris Topelius
Training a telescope on one’s own belly button will only reveal lint. You like that? You go right on staring at it. I prefer looking at galaxies.
-- Sarah Hoyt
|
|
|
|
|
Yes, I think you make a very good point that part of the reason that we find ye olde for loop a lot easier to read than a LINQ statement is that we've been using them for an awful lot longer and if there is a point where a complex LINQ statement becomes instantly readable, I'm yet to reach it. But all the same, readability just isn't the first word that springs to mind when extolling the many genuine advantages of LINQ.
Looking through my own code, I definitely use significantly fewer loops than I did even a couple of years ago but there are times when I employ a for loop for the simple reason that it's the only way to make the code readable without a very long explanatory comment block.
And therein lies my narkiness with the article - readability is a massively important aspect of code - and he's kind of pushing an imaginary readability bonus somewhere where it really doesn't exist just to advance an argument that really could stand up far better on its genuine merits.
98.4% of statistics are made up on the spot.
|
|
|
|
|
True enough. Really complicated stuff I still generally do with for/foreach loops; but Linq has replaced a lot of my more basic ones. Especially for things like filtering data I find Linqs 1/2 liners to be more natural than the equivalent 3-6 line loop.
I often do take advantage of resharpers foreach-linq conversion tool. At the edge of my comfort range I often find Linq easier to read and make minor updates but harder to initially write; and even for more complex cases where my reaction to the output Linq is 'Oh no' seeing the conversions between the two and using my knowledge of the former to decipher the latter has helped me learn Linq a lot.
Did you ever see history portrayed as an old man with a wise brow and pulseless heart, weighing all things in the balance of reason?
Is not rather the genius of history like an eternal, imploring maiden, full of fire, with a burning heart and flaming soul, humanly warm and humanly beautiful?
--Zachris Topelius
Training a telescope on one’s own belly button will only reveal lint. You like that? You go right on staring at it. I prefer looking at galaxies.
-- Sarah Hoyt
|
|
|
|
|
Yes, Resharper helped me an awful lot in my earlier days with it - still does from time to time.
98.4% of statistics are made up on the spot.
|
|
|
|
|
for loops are the best loops.
|
|
|
|
|
Ditch loops for code that does all the looping for you.
|
|
|
|
|
It seemed like we had defeated electronic junk mail. Then the spammers rose from the dead. Just in case you hadn't noticed
|
|
|
|
|
Except the new spam, at least for me, is from vendors I use. The number of emails I got just from NewEgg last week was nuts.
|
|
|
|
|
The industry should be looking for "passionate people and inspire them", rather than people with CVs ticking the appropriate boxes. "I got a frantic disposition an all consuming mission"
|
|
|
|
|
While Elon Musk and co. are aspiring to send (useful) cargo to Mars two years ahead of the first visitors, Budweiser is planning for the inevitable celebrations. Budweiser is going to start making beer?
|
|
|
|
|
Budweiser (Budvar) has been a good lager in Europe for a very long time. Then a US company came along, ripped off the name for its own diluted p*ss, and tried to trademark the name.
In Europe, they have to sell that awful stuff as plain "Bud".
Where a Budweiser Isn’t Allowed to Be a Budweiser | TIME.com[^]
"If you don't fail at least 90 percent of the time, you're not aiming high enough."
Alan Kay.
|
|
|
|
|
Individual’s output = their own output + their impact on the group’s output Do I gain enlightenment if I get it right?
Or:
When she's trained a the House of Black and White?
|
|
|
|
|
I was once in a team with "the brilliant jerk" and weak management. The management didn't dare sack him, because he produced more than anyone else on the team, but I did wonder about the theory expounded in this article - i.e. how much he was decreasing everyone else's output.
Basically, anyone he didn't like (foreign contractors for example, he was known to hate them), he bullied off the team.
My suspicion was that the overall team output would have been the same or higher without him.
(But now that I don't work at that company any more, I hope he stays there, because I certainly don't want to run into him anywhere else )
|
|
|
|
|
I worked in one company where a brilliant (and, imho, sociopathic) programmer had achieved technical dominance ... he was irreplaceable, his code inscrutable, with very few comments ... and was despised by his peers, and considered a "golden goose" by company management. The company was acquired, the "golden goose" cashed in his stock, and left. Six months later the acquiring company sold off the acquired company for a fraction of what they paid for it.
My take-away, as an observer and participant, was that companies exist to make money, and individuals pursue their own interests. And, that buyers should do due diligence. Ho-hum.
The idea that companies should be "happy families" where individual differences in ability and knowledge never over-shadow a warm sense of "collectivity" ... and, that increases profitability ... is a nice fantasy.
Of course, I am speaking in extreme terms, here, to make a point (hopefully) about the millennial shift in expectations of "workplace experience," and "work-culture."
«While I complain of being able to see only a shadow of the past, I may be insensitive to reality as it is now, since I'm not at a stage of development where I'm capable of seeing it.» Claude Levi-Strauss (Tristes Tropiques, 1955)
|
|
|
|
|
The cost of protecting applications from cyberattacks is climbing fast. So, it's time for business units to help cover the pricetag. But your competitors will do this for half the price
|
|
|
|
|
Computer code. It will become the Ancient Greek of the late 21st century. "By the beard of Zeus!"
|
|
|
|
|
Sorry but... bullshxxx
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
Why is it BS?
Once upon a time, steam was the thing. If you knew how to make a steam-engine, the sky was the limit.
If you know how to make a steam engine these days, you're just a clever guy with an interesting hobby.
Tech is ephemeral - things don't stand still.
My grandfather fixed wirelesses, that skill would be no use to me. I write code, that skill will be no use to my grandchildren.
98.4% of statistics are made up on the spot.
|
|
|
|
|
I can give you that the languages might get obsolete, but the ability "code" is not only about the language you are using. And that is what I say it won't get obsolete
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
It's simply a matter of time before all communication with machines is performed in native languages such as English. Once we can speak to computers in that way, there will be no point whatsoever in communicating via a coded medium.
People may still program computers but they will not do so by code.
98.4% of statistics are made up on the spot.
|
|
|
|
|
Learning to code taught me problem solving and problems will always need to be fixed; AI or not.
|
|
|
|