Pet peeves

Started by
82 comments, last by Beer Hunter 19 years, 7 months ago
I hate the whole ++ thing... in Clarion (the language i've written the most 'stuff' in, it's += ;)

Advertisement
I have a commenting peeve:

People who, in C++, prefix every line of a multiline comment with a star, thus:

/*
* A line of the comment
* Another line of the comment
* More commenting.
*/

People who, in C++, use /**/ commenting for single line comments, thus:

/* A single line comment */

And the absolute winner: people who, in C++, use /**/ commenting for single line comments, but make the comment take up 3 lines, thus:

/*
* A single line comment spread over three lines.
*/

Now, I can understand the origins of the "* on every line" being business, being rooted in programming in C using simple text editors, but there are three issues here:

1) C++ has // for that sort of thing
2) C IS A DIFFERENT LANGUAGE.
3) In a commercial environment, where we all use the same IDE, we all have syntax highlighting, We can see that it is a comment, because it is green (or your colour of choice).
Alright - I'll join the flamewar [smile]

My coding style:

/* Multiline *   comment =) */void foo (){  if (cond) {    something ();  } else {    nothing ();  }}


I'm using the { on the same line, EXCEPT the function declarations.

And what I totally hate? When someone is using while (1) instead of while (true) for infinite loop

Oxyd
When people don't indent the opening and closing braces. Argh! I spend about three days going through the HL SDK fixing that... and the spacing.
the future is just like the past, just later. - TANSTAAFL
And I also hate when someone writes return type on separate line from the rest of function definition:

intsum (int a, int b){  return a + b;}


I feel like killing some innocent animal, when I see this [smile]

Oxyd
Quote:Original post by Oxyd
And what I totally hate? When someone is using while (1) instead of while (true) for infinite loop


Not as bad as:

#define EVER ;;for(EVER) // lolz{}
Quote:Original post by Sandman
Quote:Original post by Oxyd
And what I totally hate? When someone is using while (1) instead of while (true) for infinite loop


Not as bad as:

*** Source Snippet Removed ***


or even
#define ever (;;)for ever{}


:P
<script type="text/&#106avascript">  // browser-detection code  if (browser_is_ie)  {    // IE-specific code  }  else  {    // standard-conforming code that works on all browsers, including IE  }</script>
So let us mix the worst ones together :D

int main( int argc, char **argv, char** env ) {    for (int i=0;i < argc;i += 1)    {        char *a = (char *)  malloc ( 65536 ); /*                                               * To be sure, some way to huge size                                               * */        strcpy ( a, argv );         printf ( "%s", a ); /*                             * Printing a out via %s, a bit pointless and problematic if a contains a white space ;)                             */        /*         * free? let the operating system take care of that? lol         */    }}/*  * Note that there is no useful comment! :D */


This is how I code everyday :D
#define BEGIN {#define END }   /*                 * Hey, I'm used to Pascal, and feel this to be clearer than all those {'s and }'s =)                 */void main( int argc, char **argv, char** env ) BEGIN    register int counter ;    counter = 0 ;    while ( ( counter < argc) == 1 )    BEGIN        char *a = (char *)  malloc ( 65536 ) ; /*                                                * To be sure, some way to huge size                                                * */        strcpy ( a, argv[counter] ) ;         printf ( "%s", a ) ; /*                              * Printing a out via %s, a bit pointless and problematic if a contains a white space ;)                              */        counter = counter + 1 ;        /*         * free? let the operating system take care of that? lol Who uses 98, anyway?         */    ENDEND/*  * Note that there is no useful comment! :D */


You see - things can be even worse [smile]

Oxyd

This topic is closed to new replies.

Advertisement