News for hackers. Stuff that matters.
Re:Tor in a safer language: Network team update from Amsterdam by socmag on Saturday April 01, 2017 @06:11PM (#14014463)
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
Re:Tor in a safer language: Network team update from Amsterdam by wott on Saturday April 01, 2017 @09:22PM (#14015175)
> This is C obviously

No, that's C++.

Re:Tor in a safer language: Network team update from Amsterdam by __david__ on Saturday April 01, 2017 @11:02PM (#14015527)
You 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.
Re:Tor in a safer language: Network team update from Amsterdam by socmag on Monday April 03, 2017 @05:29AM (#14021569)
Absolutely correct.
Re:Tor in a safer language: Network team update from Amsterdam by smitherfield on Sunday April 02, 2017 @02:35AM (#14016149)
It could be C if `_array` is an array of

  struct {
          int check;
          int (*base)(void);
  };
Re:Tor in a safer language: Network team update from Amsterdam by socmag on Monday April 03, 2017 @05:27AM (#14021559)
It is!
Re:Tor in a safer language: Network team update from Amsterdam by socmag on Monday April 03, 2017 @05:28AM (#14021566)
It is C.