Is program speed less important than safety? Sometimes it is – and sometimes speed is safety. A slow autopilot is a dangerous autopilot. That's why so much safety-critical software is written in the least safe programming languages.
A lot of programs aren't like autopilots – a slower, safer transaction processor is usually better. Google's early credit card charging disaster is my favorite example (it would never happen with a bounds-checked, garbage-collected language runtime).
However, there's the "counter-anecdote" of a cell phone company switching to a fancy new billing system which took more time to charge customers for calls than it took customers to make calls. It fell behind to the point where they had to avoid charging customers for a month worth of calls because they couldn't compute the right amounts. So sometimes trusting one's money to a slow program is rather unsafe.
And then there are high-frequency trading algorithms. Speaking of which: is speed less important than program correctness? Sometimes it is – and sometimes speed is correctness. A slower chess program playing under time control will settle for a worse move – a less correct move. Slower project scheduling software will come up with a worse schedule.
Life in general is a game played under time control. Often, "slower" means "being able to process less information in less ways" – in other words, dumber, further away from "correct".
What about time to market – isn't program speed less important than time to market? Sometimes it is – and sometimes higher speed is shorter time to market. A breathtaking game or special effect on today's hardware that others can only pull off on tomorrow's hardware means that the game or the special effect made it first to the market.
("Performance tricks" sound more relevant to the real-time world of games than to the offline rendering of movies; a great counter-example is procedural generation of outdoor landscape in Brave by Inigo Quilez.)
But time to market is also affected by development time; is program speed less important than development time? Sometimes it is – and sometimes higher speed is less development time. A developer waiting for slow programs develops more slowly – and developers often wait for their own programs (tools searching for stuff or summarizing stuff, build systems, tests, machine learning algorithms, …).
Another point is that a developer whose code tends to be too slow will waste time looking for a faster, fancier, buggier algorithm, sometimes sifting through many options, each of which could be fast enough if coded by someone else. A developer whose code tends to be fast the first time will move on to the next thing more quickly.
Is program speed less important than X? Sometimes it is – but sometimes speed is inseparable from X.
119 comments ↓
With bounds checked, garbage collected language you can't crash because a poor pointer has gone missing; you still can crash due to null reference or OutOfMemoryException ; the later gets sometimes really hard to fix/handle ; so instead one is at the mercy of a virtual machine. Is that safe?
OOM or NPE is safer than memory corruption where you charge the customer -$2.5681M because the amount you should charge was a local variable on the stack of a thread that has since returned from the function – safer by a very large margin.
Okay I'm going to bite.
Programmers can control the correctness, speed and also the delivery date of the product. Though the one thing that programmers miss ineptness is the culture code regarding the meaning behind correctness, robustness, and also what is a bug.
Just simply taking an American about quality vs a Japan you will get vastly different cultural code (meanings,feelings) behind the word. So one can not just simply take quality to mean one rooted thing because quality, same with correctness is a relative term.
Understandable, you can hold up different test case project and point at them saying "this is what they did wrong", and "this is how they should of done it". The truth is, there are many many decisions that need to be made during the software development life cycle. These have to be considered and weighed up by a team of technical lead for the over-all project goal and conventions. This includes (correctness, robustness), though saying that these are relative terms if you're speaking to developers at large.
Instead of focusing what went wrong, there should be more of a focus on "what decisions they did right?". Development is about wining many many small insignificant battles though the accumulation of those small battles as a whole make up the complete software package. Some problems get through, but I would say the guy from Google that made the wrong billing calculation was a awesome developer (who btw when he did find the mistake handed in his resignation that was rejected).
Some technologies do help in making you fall into the pit of success. Though they normally tend to leverage experience from people who made the small mistakes, and have collectively been put into a framework for developers. Checked and Unchecked exceptions in (.net,Java) spring to mind. Though if you find out what you're goal is from the start of the project (correctness, speed, quality) and the meaning behind those words (customers interpretation of it) then you're much more inline in delivering a product that is going to be successful.
One example is the case regarding early web browsers. There was a war on between correctness (containing all the web content before conducting a search on it) and just good unuf (ranked based algorithms). Today we know the answer to this question, though back in yahoo, alvista, or any library search query we just didn't. So the interpretation of correctness from the user and the programmers where vastly different. One wanted reliant search based query based on rank based links, vs perfect search result based on the current known state of the internet.
Sorry for my ramblings must go and feed the baby.
I'm surprised you didn't mention compression or video encoding, which drive the point home: a slow encoder is a *bad* encoder (since you could do a better job with a faster one, not just the same job in less time).
As for null pointers, good type systems solve that problem rather nicely by clearly separating values for which null is expected to be a possibility. Of course, few people program in the various non-mainstream languages that get that right…
Actually I'm not particularly worried about null pointers because you crash in an immediate and clear way with these. In fact I'm instinctively more worried about non-nullable types, under the assumption that someone could start passing dummy objects around and then instead of crashing programs you get programs doing dumb things and proceeding. (A sufficiently smart programmer/team wouldn't run into that of course but then they wouldn't run into NPEs, either; the question is whether nullability everywhere vs having to explicitly ask for nullability and not having it somewhere is better given the real programmers out there; I dunno.)
Yeah, it's true that sometimes preventing superficial junk precipitates the formation of more insidious junk.
A nice example of this is uninitialised variables. Supposedly they are the most terrible evil thing ever, and yet you can use Valgrind to detect bugs involving their use quite handily. In contrast the more "principled" initialisation-before-use (or worse, declaration-is-default-initialisation) rules force a meaningless, error-masking assignment.
I'm not sure I buy it as an argument against programming with principled constructs though. There are too many cases where there is no good way to detect the brain damage.
What is this google credit card disaster?
It's described here: http://www.flownet.com/ron/xooglers.pdf (look for "The billing disaster"). The upshot is that they had a money counter allocated at a thread's stack and they accessed the counter after the thread returned from the function.
"With bounds checked, garbage collected language you can't crash because a poor pointer has gone missing; you still can crash due to null reference or OutOfMemoryException ; the later gets sometimes really hard to fix/handle ; so instead one is at the mercy of a virtual machine. Is that safe?"
This is a fine example of how stupid people think. In this case, a stupid person thought of *a* way that unmanaged code can crash but managed code can't (due to dangling pointers), noticed that managed code can fail in other ways … and then promptly forgot his starting point.
It's extra stupid here because the article he's responding to is all about examples of this sort of faulty reasoning resulting from only considering those cases that support a claim while overlooking cases that don't.
"(or worse, declaration-is-default-initialisation) rules force a meaningless, error-masking assignment"
What a nutty and erroneous notion … that automatic initialization of all variables to the default value for their type is "error-masking" and is worse than leaving them uninitialized so that they *might* contain the default value (and often will at program startup) or any other value at all, depending on such things as the phase of the moon and the compiler version and flags. Depending on valgrind for detecting uninitialized values is a good way to lose spacecraft or kill radiation patients.
How many C++ constructors initialize everything they should? I just saw a case today where a cow orker added a pointer member to a class but didn't initialize it in the constructor. C++ (pre-11)'s moronic enforced separation of the point of declaration and the point of initialization magnifies the effects of careless incompetence severalfold.
"A sufficiently smart programmer/team wouldn't run into that of course but then they wouldn't run into NPEs, either"
No, that's quite false … or rather it ignores the probabilities. Virtually all programmers/teams will occasionally have NPE bugs … avoiding them takes *extraordinary* care. But it's quite easy to program in a sensible way with non-nullables, even though incompetent programmers will always find ways to screw up.
Suppose you are correcting errors in real time – a PID program say. Close enough results on time is much better than perfect results late. Errors left over can be corrected in the next cycle.
The idea of the OODA loop in the battle space is the same. The perfect pilot gets beaten by the good enough one.
Or as we like to say in controls – if the process changes faster than the machine can respond you WILL get oscillations.
Yeah bookmaking this wasn’t a risky decision outstanding post! .
Appreciate the site– very user-friendly and tons of stuff to think about!
stays on topic and states valid points. Thank you.
I like this site because so much useful stuff on here : D.
Great, bing took me stright here. thanks btw for info. Cheers!
This does interest me
Ni hao, here from yahoo, me enjoyng this, will come back soon.
I really enjoy examining on this page , it has got cool article .
Just wanna input on few general things, The website layout is perfect, the articles is very superb : D.
I was looking at some of your articles on this site and I believe this internet site is really instructive! Keep on posting .
Intresting, will come back here once in a while.
I consider something really special in this site.
I conceive you have mentioned some very interesting details , appreciate it for the post.
This does interest me
I am glad to be one of the visitors on this great website (:, appreciate it for posting .
Very interesting points you have remarked, appreciate it for putting up.
I conceive you have mentioned some very interesting details , appreciate it for the post.
Hey, yahoo lead me here, keep up nice work.
I am glad to be one of the visitors on this great website (:, appreciate it for posting .
very cool post, i actually like this web site, carry on it
I'm gratified with the way that yosefk.com deals with this type of topic. Usually to the point, often contentious, always thoughtful and also thought-provoking.
I really enjoy examining on this blog , it has got cool goodies .
I must say, as a lot as I enjoyed reading what you had to say, I couldnt help but lose interest after a while.
Great, yahoo took me stright here. thanks btw for info. Cheers!
Deference to op , some superb selective information .
Great, yahoo took me stright here. thanks btw for post. Cheers!
This is very interesting, You're a very skilled blogger.
I've joined your feed and look forward to seeking more of your magnificent post.
Also, I have shared your website in my social networks!
Intresting, will come back here later too.
Woah! I'm really digging the template/theme of this website.
It's simple, yet effective. A lot of times it's hard to get that "perfect balance" between user friendliness and visual appeal.
I must say that you've done a great job with this. Additionally, the blog loads super quick for me on Internet explorer.
Outstanding Blog!
Yeah bookmaking this wasn’t a risky decision outstanding post! .
I love reading through and I believe this website got some genuinely utilitarian stuff on it! .
Why people still make use of to read news papers when in this technological globe
all is existing on web?
I am not rattling great with English but I get hold this really easygoing to read .
Good post however , I was wondering if you could write a litte more on this topic?
I'd be very thankful if you could elaborate a little bit more.
Cheers!
This is interesting!
It's hard to come by well-informed people on this
topic, however, you sound like you know what you're talking about!
Thanks
Hmm is anyone else encountering problems with the pictures on this
blog loading? I'm trying to determine if its a problem on my end or if it's the blog.
Any feedback would be greatly appreciated.
Good Morning, google lead me here, keep up good work.
Very rapidly this site will be famous amid all blog people, due to it's pleasant articles or reviews
I dugg some of you post as I thought they were very beneficial invaluable
You should be a part of a contest for one of the most useful blogs on the
internet. I will highly recommend this blog!
This paragraph provides clear idea designed for the new
people of blogging, that genuinely how to do blogging and site-building.
I was suggested this blog via my cousin. I'm not sure whether this put up is written via him
as nobody else realize such distinct about my difficulty.
You're incredible! Thank you!
Thank you for the good writeup. It in fact was a amusement account it.
Look advanced to more added agreeable from you! By the way, how could
we communicate?
6/7/2019 In my view, yosefk.com does a great job of covering subject matter of this kind! While sometimes deliberately controversial, the posts are generally well-written and thought-provoking.
I have read so many articles or reviews regarding the blogger lovers but this paragraph is really a fastidious piece of writing, keep it up.
In my view, yosefk.com does a good job of handling topics of this type. Even if often intentionally controversial, the posts are generally thoughtful and challenging.
Hi there! I just wanted to ask if you ever have any problems with hackers?
My last blog (wordpress) was hacked and I ended up losing a few months of hard work due to no back up.
Do you have any solutions to prevent hackers?
In my opinion, yosefk.com does a good job of handling topics of this kind. Even if frequently intentionally controversial, the material posted is generally well-written and challenging.
Way cool! Some extremely valid points! I appreciate you penning this post and also the rest of the site is
also very good.
My coder is trying to persuade me to move to .net from PHP.
I have always disliked the idea because of the expenses.
But he's tryiong none the less. I've been using WordPress
on a number of websites for about a year and am worried about switching to another
platform. I have heard very good things about blogengine.net.
Is there a way I can transfer all my wordpress content into it?
Any help would be really appreciated!
I was able to find good information from your content.
Post writing is also a excitement, if you be acquainted with after that you can write if
not it is difficult to write.
Hi everyone, it's my first pay a visit at this site,
and paragraph is really fruitful in support of me, keep
up posting such posts.
Respect to website author , some wonderful entropy.
This piece of writing is truly a good one it assists new net users, who are wishing for blogging.
Yeah bookmaking this wasn’t a risky decision outstanding post! .
You got yourself a new rader.
I like this site, because so much useful stuff on here : D.
I quite like reading an article that will make men and
women think. Also, thanks for allowing me
to comment!
I like this page, useful stuff on here : D.
Appreciate it for this howling post, I am glad I observed this internet site on yahoo.
I like this site because so much useful stuff on here : D.
I must say, as a lot as I enjoyed reading what you had to say, I couldnt help but lose interest after a while.
Appreciate it for this howling post, I am glad I observed this internet site on yahoo.
I consider something really special in this site.
I dugg some of you post as I thought they were very beneficial invaluable
Thank You for this.
My coder is trying to convince me to move to .net from PHP.
I have always disliked the idea because of the expenses.
But he's tryiong none the less. I've been using WordPress on a number of
websites for about a year and am anxious about switching to another platform.
I have heard great things about blogengine.net. Is there a
way I can transfer all my wordpress posts into it? Any kind of help would be really appreciated!
Enjoyed reading through this, very good stuff, thankyou .
I conceive this web site holds some real superb information for everyone : D.
Some truly good article on this web site , appreciate it for contribution.
I conceive this web site holds some real superb information for everyone : D.
I simply must tell you that you have an excellent and unique web that I must say enjoyed reading.
Hey, yahoo lead me here, keep up great work.
I really got into this article. I found it to be interesting and loaded with unique points of view.
This is amazing!
Enjoyed reading through this, very good stuff, thankyou .
Parasite backlink SEO works well :)
bing took me here. Cheers!
I love reading through and I believe this website got some genuinely utilitarian stuff on it! .
stays on topic and states valid points. Thank you.
Enjoyed reading through this, very good stuff, thankyou .
stays on topic and states valid points. Thank you.
very cool post, i actually enjoyed this web site, carry on it
Yeah bookmaking this wasn’t a risky decision outstanding post! .
This is interesting!
This is a good tip particularly to those fresh to the
blogosphere. Simple but very precise info… Thank you for
sharing this one. A must read post!
Hi, bing lead me here, keep up great work.
Paragraph writing is also a excitement, if you be familiar with after
that you can write otherwise it is complicated to write.
Thank you for the great read!
some great ideas this gave me!
great advice you give
Yes! Finally someone writes about how to get help in windows
10.
I do trust all of the ideas you have offered in your post.
They are very convincing and can definitely work. Nonetheless, the posts are too
short for starters. May you please extend them a little from next time?
Thanks for the post.
Skyking, this code is your next piece of data. Do message the agency at your convenience. No further information until next transmission. This is broadcast #4947. Do not delete.
Cheers, great stuff, Me like.
Heya i am for the first time here. I found this board and I find It
really helpful & it helped me out a lot. I hope to provide one
thing again and aid others such as you helped me.
Have you ever considered writing an ebook or guest authoring on other
websites? I have a blog based on the same topics you discuss and
would love to have you share some stories/information. I know my
audience would enjoy your work. If you are even remotely interested, feel free to shoot
me an email.
This does interest me
I am 43 years old and a mother this helped me!
I am 43 years old and a mother this helped me!
Thanks designed for sharing such a fastidious thinking,
piece of writing is pleasant, thats why i have read it completely plenty of fish natalielise
Cheers, great stuff, I like.
Write more, thats all I have to say. Literally, it seems as though you relied on the video to make
your point. You definitely know what youre talking about, why
throw away your intelligence on just posting videos to your site when you could be giving us something informative to read?
I truly enjoy looking through on this web site , it holds superb content .
Enjoyed examining this, very good stuff, thanks .