[Vala] Idea: Change escaped comments to Logger calls





Usually a programmer writes comments about what the next few code lines will do. When something goes wrong, stdout.print() or Glib.debug() lines are also inserted for debug purposes:

// Opening a file
Glib.debug("Opening a file");
...
code block
...

It isnt a good thing document something twice, so I advise the following syntax for this:
//$ Opening a file
...
code block
...

Then in C, the comment line would change to:
g_debug("Opening a file");

Other suggestions:
//$ = //$D = Debug
//$W = warning
... and so on

I used the "$" character there, because it reminds me to the bash prompt (where the messages will be shown), but anything goes.

People would really use it and like it, because it is much more handy than stdout.print an the others. IDEs could show these with different colors (like comments), so logger calls could separate from valuable code.

What do you think, is this a good idea?


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]