Compiler safety and typing

Posted by HippieHunter Thu, 11 Jun 2009 18:03:00 GMT

As far as the internet is concerned C++ is a staticly typed language (also some people who think its strongly typed), academically we know this is untrue but this isn’t about what’s actually correct it’s about the perception of safety or lack of, from the C++ compiler. Certainly C++ lets you break all the rules and use void* for all types throwing caution to the wind but that’s not really all that common in non ancient C code. 
 
This particular rant is brought to you by a stack overflow response to a blatant flame war question "C++ slow, python fast? (in terms of development time)" one part of the large response caught my attention "That being said, static typing might be helpful if you're just making the move to larger programs. The compiler will catch some things that will only show up at run time with Python." While this is certainly true to an extent it’s really ignoring a very important reality. Inexperienced C++ programmers (the op clearly is) are wholly incapable of writing safe (read: compiler checked) C++. Remember that bit about all types as void*, rope, hanging and shooting one’s self? Well there are many shades of void* and most of them are used more frequently. at one of the more nitpicky ends is const correctness, it really is a pretty massive pain in the ass to maintain 100% const correctness but it’s got the odd habit of producing categorically better code. So why am I brining up const incorrectness and void* programming? Because that’s how people who are new (or old) to the language go about solving problems, with unsafe hacks to fill in their language feature knowledge gaps. 
 
My point in all of this is that people who believe they are effectively relaying the strengths and weaknesses of languages almost never say anything useful at all. Argument generalization is not the friend of general purpose programming languages. So here comes the mother of all generalizations, in all things if you are bad there is no tool that will make you good, only tools that will make you less bad. There are however tools that can make you worse, so if you're a badie at programming no amount of thinking C++ is faster or more type safe will ever make your code faster or more type safe.

Trackbacks

Use the following link to trackback from your own site:
http://www.archverse.com/typo/trackbacks?article_id=4

  1. Carisoprodol 350 mg able. Carisoprodol phentermine yellow.
  2. Phentermine online. Phentermine prescription online. Phentermine online no prescription. Cheap phentermine online. Online phentermine. Buy phentermine buy cheap phentermine online.
  3. Buy xanax without prescription in usa. Search results buy xanax online.
    Buy 180 xanax 2mg. Buy xanax. Buy xanax online. Buy 180 xanax. Buy generic xanax information. Buy xanax with no prescription. Buy xanax with mastercard overnight delivery.
  4. Cheap ambein. Cheap ambein.
    Cheap ambein.
  5. Buy ephedra. Buy online yellow jackets with ephedra. Buy ephedra in canada. Buy ephedra online.
  6. Cheap valium. Cheap valium.
    Cheap online valium no-presription. Cheap valium no prescription. Cheap valium.
  7. Cheap soma. Cheap soma online pharmacy. Watson soma cheap. Cheap watson soma online.
  8. Cheap soma without prescription. Cheapest sites for buying soma online. Soma cheap without rx. Cheap soma.
  9. Buy phentermine cod. Buy phentermine.
    Buy phentermine. Buy phentermine mg. Buy phentermine order cheap online.
  10. Cheap airline tickets online. Baseball tickets online.
    Buy wicked tickets online. Discount nba tickets online.
  11. Buy cheap phentermine. Cheap phentermine.
    Cheap phentermine. Buy cheap phentermine onli ne. Buy cheap phentermine online.

Comments

Leave a comment