3 ms·
I totally agree that code should be written to be read. It certainly wouldn't hurt if people simply used a more literate programming style no matter what langu
by socmag 10y ago
I totally agree that code should be written to be read.
It certainly wouldn't hurt if people simply used a more literate programming style no matter what language they choose
Far too many people think code as below is acceptable.
This is C obviously, but pretty much equal horrors around in every language.
This isn't 1994 and the compiler really doesn't care how long your variable names are, plus EatWhite() is pretty damn fast.
const int to_pn = base_n ^ label_n;
const int from_p = _array[to_pn].check;
const int base_p = _array[from_p].base ();
const bool flag
= _consult (base_n, base_p, _ninfo[from_n].child, _ninfo[from_p].child);
uchar child[256];
uchar* const first = &child[0];
uchar* const last = flag ? _set_child (first, base_n, _ninfo[from_n].child, label_n)
: _set_child (first, base_p, _ninfo
- wott 10y ago> This is C obviously No, that's C++.
- __david__ 10y agoYou can't say that definitively based on that code. It could very well be C code. There's nothing there syntactically that a straight C compiler would barf on.
- socmag 10y agoAbsolutely correct.
- smitherfield 10y agoIt could be C if `_array` is an array of struct { int check; int (*base)(void); };
- socmag 10y agoIt is!
- socmag 10y agoIt is C.