Re: Eclipse

[prev] [thread] [next] [lurker] [Date index for 2006/11/07]

From: Yossi Kreinin
Subject: Re: Eclipse
Date: 19:42 on 07 Nov 2006
A. Pagaltzis wrote:
> 
> Yeah, because it's obviously better when
> 
>     a + b
> 
> can do two different things depending on the types of the values,
> resulting in things like
> 
>     1 + 2 + " bottles"
> 
> producing a semantically different result from
> 
>     "Bottles: " + 1 + 2
> 
> as in Javascript. Clearly, having to write
> 
>     "" + a + b
> 
> is better than having to write
> 
>     a . b
> 

The problem with brain-crippled features built into a programming language is 
that there's a finite amount of these, and eventually you run out of them. To 
solve this problem, C++ comes with powerful facilities enabling an arbitrary 
amount of user-defined brain-crippled features.

For instance, boost.org (an organization dedicated to boosting C++'s 
brain-crippled features) came up with the following piece of work:

  //this prints all elements of v, as expected by people who can actually expect 
anything from this kind of shit:
  for_each(v.begin(), v.end(), cout << _1 << endl);

  //but this prints "elem: " only before the FIRST listed element, since the 
operator overloading from hell done in the global object `_1' can't affect the 
evaluation of `cout << elem: "'
  for_each(v.begin(), v.end(), cout << "elem: " << _1 << endl));

Of course, none of the advanced overloading, conversion and context-sensitive 
code fuck-up techniques was used for the prosaic task of making the following 
code using the "standard" C++ string and file types compile:

  void print(string name)
  {
    ofstream file(name);
    file << "If c_str means 'C string', why should I say c_str() to pass a C++ 
string to a C++ file constructor" << endl;
    file << "Don't get me started about namespace std" << endl;
  }

-- Yossi

-- 
The fastest way to be done with dinner is to NOT clean the kitchen.

If you don't, a mess builds up. To make dinner you have to work through
the dirty pans, cutting off the dried on spaghetti, and melting the
hardened peanut butter. But eventually you will eat dinner.

And STILL the fastest way to be done with dinner is to NOT clean the kitchen.

There's stuff above here

Generated at 20:01 on 07 Nov 2006 by mariachi 0.52