3 ms·
By calling unsafe code. :) The semantics and guarantees offered by the interface vary, but that's the short version.
by tedunangst 8y ago
By calling unsafe code. :) The semantics and guarantees offered by the interface vary, but that's the short version.
- Nelson69 8y agoI have over 10 years of professional C++ and helped teach a course on it in college. One of my observations, and I may be off, is that a fair number of C++ users tend to take on a kind of macho attitude about it: it's a hammer for every nail, if you make certain mistakes you shouldn't use it or maybe be programming at all, garbage collection and other safety apparatus are kind of like training wheels while the "big boys" don't need that sort of thing. I'm being a little snarky here, but if you are truly a macho developer, then crapping out that unsafe code in optimized assembly or C or something is a really really easy time to show off and shouldn't be such a big deal for such a seasoned developer. Instead, the question is always raised in this more insecure way: for that tiny percentage of the time you have to do some bit-banging (and it's usually pretty small and encapsulated on most embedded projects) you had might as well do the whole thing in C or C++.
- hermitdev 8y agoI've over 15 years professional experience in C++, around 16 years in C#, and around 14 in Python, all overlapping. For me, it's about using the right tool for the job. It's not being a macho developer, but sometimes you need the hammer that C++ is, and you'll probably hit your thumb a few times using it.
- User23 8y agoOften that unsafe code is assembly language.
- AnimalMuppet 8y agoBeen there, done that. We were using Pascal (standard Pascal, no Turbo extensions) on a machine with memory mapped I/O. This means that we had to drop into assembly to write to the I/O registers. And that meant that we lost all type checking for those functions. We couldn't even check the number of parameters! Unsurprisingly, that led to a crash. That is: The extreme safety of Pascal led to a crash (when we had to do something that Pascal, in its wisdom, said we weren't allowed to do).
- snaky 8y agoPresuming it's not formally verified assembly code https://blogs.ncl.ac.uk/andreymokhov/spacecraft-control/ https://blogs.ncl.ac.uk/andreymokhov/spacecraft-control/