Stories
Slash Boxes
Comments

SoylentNews is people

posted by janrinok on Thursday May 01 2014, @01:52PM   Printer-friendly
from the relax-its-a-holiday dept.

An outrageous, insightful, and sadly accurate commentary on programming. I found this an extremely entertaining read and agree with most of it. It doesn't offer solutions, but certainly highlights a lot of the problems.

"Double you tee eff?" you say, and start hunting for the problem. You discover that one day, some idiot decided that since another idiot decided that 1/0 should equal infinity, they could just use that as a shorthand for "Infinity" when simplifying their code. Then a non-idiot rightly decided that this was idiotic, which is what the original idiot should have decided, but since he didn't, the non-idiot decided to be a dick and make this a failing error in his new compiler. Then he decided he wasn't going to tell anyone that this was an error, because he's a dick, and now all your snowflakes are urine and you can't even find the cat.

Personally, I think things will only get better (including salaries) when software development is treated like other engineering disciplines.

 
This discussion has been archived. No new comments can be posted.
Display Options Threshold/Breakthrough Mark All as Read Mark All as Unread
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
  • (Score: 1) by SplawnDarts on Thursday May 01 2014, @10:54PM

    by SplawnDarts (3962) on Thursday May 01 2014, @10:54PM (#38672)

    Because it generates code like (taken from an example - maybe not optimally readable): // Dump the list to check the result
        for (list::const_iterator citer = mylist.begin();
              citer != mylist.end(); ++citer)
        {
            cout (*citer).m_iData endl;
        }

    Instead of (python):

    for item in list:
          print(item)

  • (Score: 1) by SplawnDarts on Thursday May 01 2014, @11:01PM

    by SplawnDarts (3962) on Thursday May 01 2014, @11:01PM (#38677)

    OK, HTML formatting mangled that (my bad for not checking)

    // Dump the list to check the result
      for (list<MyData>::const_iterator citer = mylist.begin();
         citer != mylist.end(); ++citer)
      {
        cout << (*citer).m_iData << endl;
      }

    vs (python)

    for item in list:
       print(item)

    • (Score: 2) by maxwell demon on Friday May 02 2014, @06:17PM

      by maxwell demon (1608) on Friday May 02 2014, @06:17PM (#39009) Journal

      In C++11, you can write

      for (auto& item: mylist)
        std::cout << item << '\n';

      Not that much more complicated than your Python variant, is it? But note that (both in C++11 and in Python) this sort of loop needs specific language support, while the STL was written are pure library for C++ (and only afterward integrated into the C++ standard library). You cannot add new for loop syntax using a library.

      Anyway, your examples are not equivalent: The equivalent code in C++89 to your Python code would be cout . I wonder if you intentionally made the C++ code do something more complex to increase the perceived complexity of C++ (also your use of (*citer).m_iData instead of the equivalent but simpler citer->m_iData hints in that direction).

      --
      The Tao of math: The numbers you can count are not the real numbers.
      • (Score: 2) by maxwell demon on Friday May 02 2014, @06:19PM

        by maxwell demon (1608) on Friday May 02 2014, @06:19PM (#39011) Journal

        Damn, should have been preview instead of submit ...

        Of course the corresponding C++89 line would be

          std::cout << *citer << '\n';

        --
        The Tao of math: The numbers you can count are not the real numbers.