The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.
Is that any more concise? Dont know how many lines of assembler are in each version. The former is more explicit, it reads easier IMO (I like really readable code. The architecture is often so complex the code has to be very obvious in the kernel)
Define 'readable'. The problem is that 'readable' is a very subjective term. More concise it is, because an unneeded mapping bool -> bool is removed. Also, what if I just reverse true and false in at that point? It would take a while until someone spots this little treachery.
I have lived with several Zen masters - all of them were cats.
I prefer the 'if x, then y = a, if not y=c' readability to 'y = if x'.
It just isnt explicit when I read the code. A programer might think the second is better, because its terser, but thats the thing I have seen so often, programmers glorying in how terse, and arcane, they can make their code at the expense of good simple readability.
I prefer explicit readability. Probably because I have more than enough complexity to deal with in the architecture when working in the kernel! It is viciously complex at times.
I don't see why "x = condition" is not explicit enough.
is it negative value? = is the value smaller than zero? is pretty explicit and self explanatory.
there is no need to add this redundant statement : "if yes then it's truly negative, or else it's false"; because the first expression "is the value smaller than zero?" has given us a true or false answer already.