< December 2005 >
SuMoTuWeThFrSa
     1 2 3
4 5 6 7 8 910
11121314151617
18192021222324
25262728293031
Sat, 24 Dec 2005:

Disclaimer: I work at Yahoo! and opinions expressed here are truly my own except for the mails quoted, in which I had no part at all.

This is quoted from a thread about Guido Van Rossum joining Google and proves that some people have a sense of humour. This is starting from the fourth thread to spawn off. The subject line stays the same through out the thread.

> No, I take that back. The Most Serious Crime is not putting in "{"s,
> leaving out horizontal space, and adding gratuitous parens and spaces:
> 
> int foo( int bar )
> {
>      if(bar)
>          return(bar+1);
>      return (bar);
> }
> 

I sort of like:

int foo( int bar ) {
    if (bar) return(bar+1);
    return (bar);
}

That's my "gziped" indentation...

Reply #1: introducing the ternary operator

> I sort of like:
>
> int foo( int bar ) {
>     if (bar) return(bar+1);
>     return (bar);
> }
>

eww...

int foo (int bar) {
  return bar ? bar + 1 : bar;
}
> 
> int foo (int bar) {
>    return bar ? bar + 1 : bar;
> }

eww...

int
foo( ....

Then I can reliably locate the implementation with the find function
of my IDE:

$ grep -n '^foo(' *.c

reply: tools make a hacker

>
> $ grep -n '^foo(' *.c

man ctags

>
> man ctags
> 

ctags on steroids: man cscope

Of course by then the language wars started :-

All languages must be ultimately compared with The One True Language 
of course...

(defun foo (bar) (return (if bar bar bar+1)))
> (defun foo (bar) (return (if bar bar bar+1)))

(+ bar 1)

But again the C programmers prove that they rule ...

// golf ?

int foo(int bar) {
	return bar + !(! bar);
}

C++ programmers try to top the effort at simplification - I am too embarrassed to push that code here right now. It is a bunch of code with templates and operator overloading. And finally the killer discussion ...

> formatting. Try arguing with people about size of TAB (You can get 2, 4,
> 8 and even 3!!) or whether there should be space after an 'if'

A tab should be exactly one tab in length.  No more, no less.

Friday nights, eh ? It was as if the entire crowd said - who cares whom Google hired, let's discuss important things like where to put braces.

--
The reason why worry kills more people than work is that more people worry than work.

posted at: 17:29 | path: /fun | permalink | Tags: ,