Delphi versus C++

Posted by Ed on March 11, 2009

In Reply to Delphi versus C++Builder posted by William on March 11, 2009

C++ allows you to write too compact and unreadable code. Try to debug something like this:

for (unsigned int i = 3; i >= 0; --i)
{ i += i++
for (Container::const_iterator i = cont.begin(); i != cont.end(); ++i)
{i = Complicated(i) * i--}}
int
ComplicatedF(int i)
{int index = i++ + ++i * i-- - --i; return index * i++;}

 

Reply by webmaster Guido

I advise you to write readable code: don't try to write too compact, use empty lines in your code, insert comments. An example:

unsigned int i;

for (i = 3; i >= 0; --i) {
  x = i - 1;
  y = 2 * x; 
  // and so on
}