Thorsten Haude wrote:

I very much prefer to write pointer types with the whole type left of
the blank, like this:
    WindowInfo* window = NULL;

You know, I used to think this was a good idea.

Over the years, I've come to dislike anything that obscures how the language really behaves. This is one example. The * binds really to the right, not to the left, and making a style that obscures what the language really does IMO is a loser long-term.

Then you have things that give the false impression:

  WindowInfo* x, y;

Nope, y is not WindowInfo*. But wait! Aren't multiple definitions on a line Bad Style? Yes, sure. But styles that causes other styles for the sake of style tends to accumulate and accumulate until you have a bizarre set of styles that makes no sense whatsoever because this style rule here is the 32nd downstream rule from "put pointers with their types".

Same reason why I now dislike typedef-to-struct.

I've worked on much larger code bases than NEdit, and the foo* x approach always breaks down at some point. Try doing that style in C++ templates, or C function pointers, and see how much it obscures things.

IMO.
--
NEdit Develop mailing list - [email protected]
http://www.nedit.org/mailman/listinfo/develop

Reply via email to