Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C syntax or binary optimized syntax?

Tags:

c

syntax

binary

Let's take a simple example of two lines supposedly doing the same thing:

if (value >= 128 || value < 0) ...

or

if (value & ~ 127) ...

Say 'If's are costly in a loop of thousands of iterations, is it better to keep with the traditional C syntax or better to find a binary optimized one if possible?

like image 594
Dpp Avatar asked Feb 27 '23 00:02

Dpp


1 Answers

I would use first statement with traditional syntax as it is more readable. It's possible to break the eyes with the second statement.

Care about programmers who will use the code after you.

like image 154
MiKo Avatar answered Mar 02 '23 00:03

MiKo