*shudder* Are avionics really written in C++?
Yes, but only a subset of it. Things like exceptions aren't allowed.
Is memory deterministically pre-allocated in such systems? That would certainly make it safer, but less flexible.
Yes, that's the whole idea. They aren't meant to be flexible, they're meant to do exactly what they're designed to do and no more, in a completely deterministic fashion. These systems aren't all things with UIs, they include all kinds of systems on an aircraft, which frequently don't have any UI at all except maybe some switches. On a car, an ABS computer would be a good example of one of these systems. There's no display or UI or anything of the sort; you just plug it into the car, and it sits there monitoring wheelspeed and brake pressure and when it sees a wheel locking up it releases brake fluid pressure to that wheel (it's a bit more complex than that, esp. on cars with dynamic stability control and traction control where these are all tied into the ABS, but this is the general idea). A system like that doesn't need to free memory, it just needs to allocate what it needs when it powers up, and then run its program continuously, monitoring inputs and controlling outputs (implementing transfer functions etc). All the tasks it'll ever have to do are well-defined, and all start up when the system powers up, and all get a timeslice.
And you never run out or memory since you've got an infinite amount of it?
If you did things right, you never run out of memory because you've planned every allocation and you have enough for them all.
Minimizing memory allocation/deallocation is a must, sicne these are functions with unknown and unbounded latency
Right, that's why they allocate all the memory up front and never deallocate it.
These embedded systems use C++, but according to an FAA standard that is very similar to the MISRA standard. Anything which is non-deterministic is forbidden. These even includes CPU caches, which are turned off on these systems.
Perhaps the presidency changed him, or perhaps his campaign was a lie to co-opt the enthusiasm of the masses. I don't think we'll ever really know.
What a rube. Anyone who has more than one digit in their IQ knows the answer is the latter.
Well, there is that theory about newly-elected Obama being sat down and shown a video of the JFK assassination, from a completely different angle.
I'm looking, right now, at a mountain of code, some 20+ classes, many with file-scope instantiations, every single fucking object a Qt object. The original developer noticed that the code for Qt-derived classes won't compile without a copy constructor so he very cleverly made empty copy constructors for all the classes so that even a shallow copy won't be performed. As expected, he also stores instances in containers - which means every now and then the program would give incorrect results with seemingly no predictable occurrences. It doesn't crash, mind, just gives incorrect answers.
Qt is an excellent library. I'm using it now on a personal project, and a lot of embedded systems use it. It sounds like the code you're looking at was written by someone completely incompetent. Qt does not need a copy constructor to compile a Qt-derived class. However, when you're doing a Qt project, usually most of your objects will be Qt objects. That's the whole idea: Qt is basically an extension to the language, and it's easier when you jump in and do everything the Qt way, including using Qt's containers and other base classes.
C++ is not C. C++ written like C tends to be crap code
You might want to avoid flying on commercial airliners then, because they have lots of avionics systems running C++ code exactly like that, with exceptions explicitly banned. Countless other embedded systems are the same way.
never, ever, worrying about cleaning up at the bottom of a function what you allocate at the top.
In these embedded systems, the "delete" keyword is also banned. You're never allowed to free memory once it's allocated.
I agree completely. Another useless bachelor's degree is Philosophy. It's a useless Master's degree too. I had a roommate in college who got a Master's in Philosophy. I'm not sure what he ended up doing, but I'm pretty sure it had to do with moving back home with his parents in their little town, and had nothing to do with philosophy.
As for a bit of socialization and practice and managing one's life, you can do all that at a local community for far less money than a 4-year university. The big thing you seem to get, socially, from a 4-year college is the whole dorm experience in your freshman and maybe sophomore years. I do think this is a good breaking-away-from-your-parents experience (it was for me), but does it need to cost that much money?
It does seem that our entire society needs a re-think on all this stuff.
Here's where I have to be a bit cynical and pragmatic. Googling around, it seems it cost $13.25 billion to find the Higgs. I remember a lot of people in the US were very ticked off when the budget for a US-based collider was eliminated, but let's get real here: does it really matter which country found the damned thing, other than the pride of the physicists involved in finding it?
And now that it's found, and given it's somewhat unlikely -- although admittedly not impossible -- the LHC will find something new and exciting at 13TeV, what are they gonna do with a $13.25 billion collider that can't find anything new?
"If only comrade Stalin knew about this!"
Can you imagine if it had been on Small Pox?
Hmmm...we actually cured that in the mean time, so... how would they handle that? Brushing up on the new research could be fairly quick.
I can't help but wonder what happened.
What happened is he fucking lied.
Anyone who still supported Obama after he signed that first extension to the PATRIOT act is either a hypocrite or a fucking idiot.
nyone who says that Americans can't get over their not being number one in passenger rail has never talked to an American about the topic.
I completely disagree. There's tons of jingoist retards out there who think America is #1 in everything. You're probably not going to find many on Slashdot, because people here tend to have a decent level of education, but go talk to drooling Fox News watchers who dropped out of high school and you'll find them. These people are completely clueless how things are in the rest of the world. And they make up a very large voting bloc, so you can't disregard them as irrelevant.