|
LOL, i'm guilty of using it in for loops sometimes.
Real programmers use butterflies
|
|
|
|
|
You'll be burned anyway, so what's the point?
And yes of course, I do not know / use the syntax and therefore most probably my negative attitude for it ...
It does not solve my Problem, but it answers my question
modified 19-Jan-21 21:04pm.
|
|
|
|
|
It lets you declare multiple variables of the same type in a single statement.
int i=0,ic=10;
It's useful primarily for for() loops when you need multiple variable inits
Real programmers use butterflies
|
|
|
|
|
Member 7989122 wrote: The syntax is commonly used in for loops where you want to, say, increment two variables typically two indexes, or stepping two linked lists) before the next iteration.
Yeah, can also remember using it to save that extra effort of typing "curlies" after say an if () or while () or ...
- do everything in a single statement
- save wear and tear on the <shift> keys
- readability phhht, that's only for other people anyway. (Me: I can read my own mind!)
... Anyway I write code correct & bug-free first time, why does it need to be [re]readable?
pestilence [ pes-tl-uh ns ] noun
1. a deadly or virulent epidemic disease. especially bubonic plague.
2. something that is considered harmful, destructive, or evil.
Synonyms: pest, plague, CCP
|
|
|
|
|
Ah, write-only code. That makes me think of Forth.
"They have a consciousness, they have a life, they have a soul! Damn you! Let the rabbits wear glasses! Save our brothers! Can I get an amen?"
|
|
|
|
|
It brings APL to mind. AFAIK, the first write-only language by design.
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.
|
|
|
|
|
Yes, that's a good example. Thankfully I have never had the misfortune of using it.
"They have a consciousness, they have a life, they have a soul! Damn you! Let the rabbits wear glasses! Save our brothers! Can I get an amen?"
|
|
|
|
|
One of my friends from high school taught himself to read it. He could also read brainf***. Useless talents, but talents nonetheless. It was quite impressive.
What do you get when you cross a joke with a rhetorical question?
The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism.
Do questions with multiple question marks annoy you???
|
|
|
|
|
Daniel Pfeffer wrote: It brings APL to mind. AFAIK, the first write-only language by design. Actually, it was developed for blackboard use. Kenneth Iverson was teaching matrix math at Harvard, as an extension of the classical math operators, as a notation for math expressions involving matrices.
He was using it as a lecturing tool for several years, until someone at IBM suggested that just like a computer program could process plus and minus, it could handle matrix inversion and stuff like that - all those special symbols Iverson had been using on the letcuring hall blackboards.
APL is like user friendly Unix: Unix is user friendly - it is just somewhat picky in who its friends are.
|
|
|
|
|
For me all this goes (in a similar way) in the direction of dialects existing for natural languages. But for programming I prefer there is only one _defined_ language and no dialects ... more or less... of course now and then I also see the incentive of syntactic sugar. But it should stop at least after the first'?', what I remember in c# it is meanwhile '??'
[Edit]
Now and then I feel like we're moving back to assembler 'a?. (x => acc_A{...})'
It does not solve my Problem, but it answers my question
modified 19-Jan-21 21:04pm.
|
|
|
|
|
Actually it makes a lot of sense. I use the comma operator in quite a few places.
|
|
|
|
|
Possibly why C# has altered the behavior of comma . (Sadly.)
|
|
|
|
|
The good ol' comma operator. Designed specifically to trap young players.
I grew up, many moons ago, in the era of 80 x 25 character screens for programming and so squeezing as much code as you could into as few lines as possible saved the ESCCtrl + F / B keys from wearing out. The ++/-- operators, dense conditionals in loops and single character variable names were what kept you productive (sorta).
Those days are long, long gone now. The comma operator now just gives me 'Nam flashbacks
cheers
Chris Maunder
|
|
|
|
|
The lowest price in my lifetime for oil was about $3/bbl - until today - when it dropped to $2/bbl, then below $1/bbl and finally went ing negative!
Normally, I'd delighted when oil prices drop - it save a lot of money for virtually everyone, both directly and in manufacturing costs. Apparently the "too much of a good thing" can really be bad.
Ultimately, a lot of the smaller producers will go under - and when all this straightens out, we may unfortunately see the $100-$150/bbl again as the OPEC-ish countries have their day.
Well, I didn't wish for this, but it certainly is a good example of "Be careful what you wish for".
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
It complements negative interest rates nicely.
|
|
|
|
|
I cannot help but wonder where it all will end?
Get me coffee and no one gets hurt!
|
|
|
|
|
"Oh Brave New World!"
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
Momma!
Get me coffee and no one gets hurt!
|
|
|
|
|
We have seen similar situations with electric power generated from windmills in Denmark and Germany. When the working day is over, the need for electricity falls drastically i Middle Europe, but the windmills spin at the same speed. Nor can other kinds of power plants, like oil and more than any other: coal, easily be cranked up and down to adjust production to needs.
It turns out to be cheaper to pay Norway for accepting the excess electricity than alternative ways to regulate it. Besides, the Norwegian peak consumption is highest in early morning, before business life wakes up, and from late afternoon until midnight. This is because we are much more dependent on electric light and electric home heating that most other countries. Norway's hydroelectric turbines can be turned from zero maximum production (or vice versa) in not that many minutes. (It takes more time to switch the direction of those huge trans-ocean cables than it takes to adjust the production!)
So, during a few periods the last few years, Norway has been paid for covering peak demands mid-day, and been paid for handling the surplus power at night time. That's a fairly good deal. All it takes to copy that for the oil is to have storage space for a few billion barrels of oil. Or an immediate need for a few billion barrels, but that is less likely.
|
|
|
|
|
Being fortunate enough to have won the topography lottery and have lots of hydro to buffer renewables peaks refusing to align with human activity (wind peaks overnight, solar at noon). Elsewhere until batteries become a lot cheaper the only reasonable option is to build lots of gas turbine plants that can spin up/down in the course of a few minutes.
In the US cheaply produced domestic gas also has the benefit of costing less to produce power than burning coal (vs places where it's an expensive import and coal is cheaper) meaning that winning marketshare in a shrinking (non-renewable) market means that over the last ~15 years we've largely built up the gas generation we'll need to handle first production/demand mismatches and later weather refusing to cooperate while gutting the most polluting legacy power plants in the process.
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
|
|
|
|
|
Further south in Germany, where it is getting more mountainous, as well as in several other countries (USA included), they have built huge artificial dams in the hills. At nighttime these are being filled from a lower reservoir by electric pumps utilizing the surplus electricity from wind power, nuclear power, coal and oil power plants. At daytime, when all the power is needed, the dams are emptied through water turbines to the the lower reservoir. This is a local/regional alternative to ship electrons back and forth across the North Sea.
If you do the math, you'll see that it takes huge amounts of water to produce a thousand kWh. Or, the water must be lifted to a great height: If you collect it as rain at 1500 meters above sea level, it represent 15 times as much energy per cubic meter as you get by pumping it up to an artificial dam 100 meters up. So those pumped hydro power stations do not have sufficient capacity to save energy from one season to another, only from nighttime to daytime.
(We certainly have huge artificial dams in Norway as well - take a look at Vatnedalsdammen[^], and notice the fellow standing at the foot of the dam. The water surface is roughly 800 m above sea level and dam capacity is 1.15 billion cubic meters.)
|
|
|
|
|
I'd slightly disagree with your fear of future higher prices. I can't speak for the rest of the world, but the US fixed this problem by deregulating oil and natural gas production. When prices fall below a certain point, most of the older oil wells are just turned off. When the price starts going up, they're turned back on. It keeps us from having the stupidity that we had back in 1973 "the oil crisis".
Now your concern is valid for many other businesses. I'm glad I don't own stock in cruise ships, hotels and airlines, but that reminds me, might be a good time to buy now.
Charlie Gilley
<italic>Stuck in a dysfunctional matrix from which I must escape...
"Where liberty dwells, there is my country." B. Franklin, 1783
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
|
|
|
|
|
Oil wells, sure. But a lot of shale oil producers are toast unless something changes very quickly. Forget their shareholders; even their bondholders will learn a lesson that they'll not soon forget. Unless, of course, shale oil gets bailed out, which wouldn't surprise me. It would just be another variation on the insane easy money policies that have seen artificially low interest rates encourage the financing of all manner of asinine endeavors, including stock buybacks by zombie companies that would go bankrupt if they couldn't keep rolling over their debt.
|
|
|
|
|
Greg Utas wrote: It would just be another variation on the insane easy money policies that have seen artificially low interest rates encourage the financing of all manner of asinine endeavors, Like moronic real-estate investments, probably the main reason wanting to have 0% interest and risking someone else's money.
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
0% interest rates are now a tiger by the tail. If they were set on the market, they would destroy government budgets and all the real estate bubbles. This is not going to end well.
|
|
|
|