News for hackers. Stuff that matters.
Re:What is “:-!!” in C code? by anexprogrammer on Monday November 21, 2016 @01:48AM (#13003661)
I've never understood the feeling that C is complex. Simple syntax, simple rules, a few hidden gotchas for the unwary.

"down to operator" = unhelpful use of whitespace. postdecrement x, check if >0

I still find C one of the easiest to pick apart. Obfuscated C entries excepted!

Re:What is “:-!!” in C code? by gkya on Monday November 21, 2016 @06:59AM (#13004708)
C is easy, computers are complex. Sometimes these are confused. Like in this case, the syntax is easy to human-parse, but it's harder to reason about the result of the expression on different architectures and with different compilers, yet the complexity is caused by the computer, not the language.
Re:What is “:-!!” in C code? by anexprogrammer on Monday November 21, 2016 @07:49AM (#13004931)
Quite. I started out in a world of C99, endianness and differing bit packing. My early day to day involved many more unions and a lot more time wondering if SunOS cc was going to behave the same as Dynix or MSC on DOS.

It's easy to forget how much of that mindless preprocessor and make conditionality we've left behind. Sadly in exchange for hardware that's much blander now.

Re:What is “:-!!” in C code? by viraptor on Monday November 21, 2016 @03:47PM (#13009052)
> simple rules

The rules are simple for simple projects. Then you get into things like undefined behaviours, implementation-specific behaviours, etc. Which compilers will abuse heavily for optimisations without telling you about it - for example like the case of silently removing NULL checks. Also any undefined behaviour at all in your source code allows the compiler to throw away all code after it. Without telling you about it.