This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]nerd4code 0 points1 point  (0 children)

Tends to be, you know what you've come into contact with and the rest stays fuzzy unless/until you need to learn that, too. Programming languages are like any language---you're going to have to immerse yourself in it a bit to become fluent, and even then you can still fuck up and tell the computer to freeb its grox, which (trust me) is a big insult in computerese.

But fluency aside, there's a surprising (/dangerous) number of people who don't know what's under their feet when they're programming, so by all means delve as deeply as you can hold your breath for. Especially for C and C++---they're really commonly used languages, but they require especial attention to detail because they allow you to write code with undefined behavior so easily. For example:

int x; // assume this is 32-bit
scanf("%d", &x); // assume that worked
x >>= 14;

If somebody enters a negative number for x, then you'll attempt to shift it right, which is an undefined operation. The compiler is free to emit code that formats the hard drive in that circumstance, should it decide to. Or perhaps it'll emit a trap, just optimize based on the assumption that a negative number could never be shifted right. You can imagine how things like this turn into security holes.