|
I think the example he gives is too simple a case. He's talking about side effects. A side effect is something that happens to some other part of the system as a consequence of the operation. Returning the result of an operation is not a side effect, it's the result of the operation. Of course, you need to know if the operation succeeded. He talks later on about asking for an invoice's total but not expecting it to charge a cc just because you asked for a total. It's that sort of side effect that is undesirable. But, sometimes, side effects are desirable, as in the case of JIT lazy loading, which is more about initialization than side effects.
Just my $0.00002 cents worth.
#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
|
|
|
|
|
I agree that the example given is nonsense. The writer appears to actually be arguing that you should write the string and then make a separate call to ask whether that write succeeded, which is the smell of rotting bodies in humid tropics.
(One problem is Meyer was wrong. Requiring that queries have no side effects (be const in C++ parlance) is ideal, though not always possible. Extending that to commands often makes no sense, especially when writing to a file. I suppose the good news is that the last method I wrote which did exactly his example threw an exception on error, thus the method's return value was, indeed, void.)
|
|
|
|
|
One man's C++14 is another man's code smell.
(Seriously; I recently worked with a guy who demanded C++11/14/17 be used and then freaked out when someone actually did, usually me.)
Besides, sometimes code smells like fresh cinnamon rolls.
|
|
|
|
|
Daniel Attinger, a professor of mechanical at engineering at Iowa State University, is working on developing a tiny device that produces a continuous supply of wine. And the winner of this year's Nobel Prize is...
|
|
|
|
|
|
... the Lounge expressing its dissatisfaction about [Insert Subject Here]?
Did you ever see history portrayed as an old man with a wise brow and pulseless heart, waging 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
|
|
|
|
|
The Privacy Shield agreement replaces the previous accord, called Safe Harbour, that was struck down in October 2015. "The slow blade penetrates the shield"
|
|
|
|
|
The system responsible for the first moon landing is now readily available online, after an enterprising former NASA intern uploaded the Apollo Guidance Computer code to Github this week. Do they accept pull requests?
Now you can finish your scale model
|
|
|
|
|
Wendy's said hackers were able to steal customers' credit and debit card information at 1,025 of its U.S. restaurants, far more than it originally thought. Isn't it punishment enough that these people ate at Wendy's?
|
|
|
|
|
Better than McDonald's. Barely. (Though an apple pie from McDonald's with a Frosty from Wendy's is bliss.)
|
|
|
|
|
PFL researchers have produced a tunable, graphene-based device that could significantly increase the speed and efficiency of wireless communication systems. Their system works at very high frequencies, delivering unprecedented results. Oh, graphene. Is there noThing you won't help us with?
|
|
|
|
|
A Cambridge, UK, resident has finished building a computer that’s so big it takes up an entire room. But this isn’t a new contender for the supercomputer list; right now, it’s mostly being used to play Tetris. "A hobby's supposed to pass the time, not fill it."
|
|
|
|
|
Quote: room-sized microprocessor WTF? That's oxymoronic. There's no way to be "micro" and "room-sized" at the same time.
#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
|
|
|
|
|
how about room for ants?
|
|
|
|
|
People can do crazy things !
Ever seen a 2 banger made of pneumatic components ?
Not really hand help, but interesting.
Patrice
“Everything should be made as simple as possible, but no simpler.” Albert Einstein
|
|
|
|
|
Good Lord. I've always wanted to simulate a processor's internals, but I would have done it "virtually". No reason to spend that money and create a behemoth physically. And with VR, you could simulate all the "physical" equipment.
Marc
|
|
|
|
|
Marc Clifton wrote: I've always wanted to simulate a processor's internals, but I would have done it "virtually".
Quite. A couple of times I have begun doing that -- by using events as current . Starting with a relay class, combining them to form gates, and combining those to make higher-level structures. I see that I have code for 8-bit adders and some flip-flops, but my interest quickly waned each time I started the effort. It looks like it's been about five years since my last foray into that morass.
I thought it was one of your articles that pointed me in the direction of GetInvocationList which I used as the basis for my first such effort.
|
|
|
|
|
PIEBALDconsult wrote: by using events as current
Hah! That's a neat idea!
PIEBALDconsult wrote: I thought it was one of your articles that pointed me in the direction of GetInvocationList which I used as the basis for my first such effort.
Might have been my event pool and event chaining articles. Those are ancient!
Marc
|
|
|
|
|
You could simulate such things to some extend even in Minecraft. Youtube holds lots of videos of processors, even with graphical displays attached and calculators built solely on red stone in MC.
|
|
|
|
|
Did that once. Doing division was ... interesting.
|
|
|
|
|
Transisters! Bushwah! It needs to use relays, dagnabit!
|
|
|
|
|
I once demonstrated the working of a NAND using domino tiles (inspired by Numberphile from Youtube)...That was fun...
Skipper: We'll fix it.
Alex: Fix it? How you gonna fix this?
Skipper: Grit, spit and a whole lotta duct tape.
|
|
|
|
|
A new strategy for training bug-finding tools could help catch more vulnerabilities. Looks like I may have found my next job!
Not that I've created any doozies lately or anything
|
|
|
|
|
Researchers are adding bugs to experimental software code in order to ultimately wind up with programs that have fewer vulnerabilities.
Wouldn't it be more useful to create an algorithm that tells you which programmer will create fewer bugs?
Marc
|
|
|
|
|
The merger will give Avast control of 400 million network 'endpoints' running the companies' software We'll always have Norton - uhm, McAfee - uhm, Windows Defender to protect us?
|
|
|
|