2 ms·
Bad analogy - in programming languages there's no wild animals waiting to attack, no pathogens in the waters. Your only enemy is the enemies you create in your
by phendrenad2 8y ago
Bad analogy - in programming languages there's no wild animals waiting to attack, no pathogens in the waters. Your only enemy is the enemies you create in your codebase. And if you know what you're doing, C is as safe as C++. It's just that everyone learns the C++ way of thinking about problems, so they can't figure out how to do the same things in C.
- adrianratnapala 8y agoTricky. I prefer C and use it at home for fun. C++ is strictly for work. But I also like to program in ways that are safe by construction, and C++ gives me tools like unique_ptr and std::vector for doing that. But I agree those tools are limited. The class of bugs which C++ protects you from are the shallow ones. Coding with discipline will prevent more bugs than switching to C++. Languages with real memory safety however are a genunie step up. Rust for example makes it painful to not code with discipline. Unfortunately I find it makes programing painful in general -- so I am still waiting for a safe language that is as much fun as C.
- setr 8y ago>Your only enemy is the enemies you create in your codebase I'd say your primary enemy are those using your codebase, who can and may exploit any hole. And ofc, its not just your codebase, as it sits on top of libraries, maybe a runtime, an OS, and hardware; you're not safe just because your onw program is fine, within the context of its internal machinations