4 ms·
agree, I think there is a massive distinction between a buffer overflow, which can end up rewriting memory of the stack vs an integer overflow, which might caus
by spydum 8y ago
agree, I think there is a massive distinction between a buffer overflow, which can end up rewriting memory of the stack vs an integer overflow, which might cause the value in the specific segment of allocated memory to represent a different value.
Yes, java has some behaviors which are not ironclad safe, but you have to recall it was designed in the world dominated by C/C++ at the time. Certainly modern attempts such as Rust and Go should have learned a thing or two since.
At the end of the day, most of the unexpected/nasty behaviors of java dont fall to the issues listed in the article anyways, except maybe data races (even there, I was pretty sure there were solutions, just maybe not native to the runtime).
- favorited 8y agoEven more than the divide between older & more modern languages, I think specific context is key. I talk to lots of app devs who think that array indexing isn't "safe" in languages where OOB will trap – because for lots of UI operations (say, the user selected item #5 and our local datastore thinks there's only 4 items), the answer can really be to tell the user something went wrong, reload the UI, and try again. That's what "safety" to them. I hear related perspectives with services – where devs understand that if they're doing OOB array access, it's a bug and needs to be fixed. But if that bug traps the process, now there's a potential DOS attack vector. They want some way of throwing away an invalid execution environment, but return to a known-good state without respawning. Is Java a safe language? I think you have to start by asking, "in what context?"
- rurban 8y ago> but you have to recall it was designed in the world dominated by C/C++ at the time No it was designed from the Common Lisp perspective, a safe but too big language, with weird syntax and too expensive OO. Dylan was the best approach that times, like today's Julia. A Common Lisp with normal syntax, but proper dynamic type promotion, memory and type safeties. (no concurrency safeties then) Java turned out to be a minor clusterfuck then. Overly simplified class-based OO, traditional arithmetic type unsafeties for performance worries, no null safety, just a GC for memory safety, and OOB checks. So just little bit better than Pascal. They did the same then as Rust now. Announcing partial safeties as full safeties. It worked then and still works now. It's called marketing.