home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.c++.moderated      Moderated discussion of C++ superhackery      33,346 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 31,811 of 33,346   
   Zeljko Vrba to Mathias Gaunard   
   Re: What will keep C++ going, given that   
   17 Jan 12 12:10:32   
   
   71fe9eee   
   From: mordor.nospam@fly.srk.fer.hr   
      
   On 2012-01-16, Mathias Gaunard  wrote:   
   >   
   > considered. But then I'm not a fan of coding assistants.   
   >   
   Descriptive names (e.g., foodToPrice) are long, slow to type (think also   
   RSI!),   
   easy to mistype [I'm thinking of typos], hard to remember exactly but easy   
   to   
   remember "fuzzily" (is it one of: foodsToPrice, foodToPriceMap, etc. -- you   
   get   
   the idea).  I know what concept I need in my algorithm (map this food item   
   to   
   its price), but I don't know in detail how I've named it.  Now think about   
   implementing something that needs to use 2 or 3 such objects simultaneously.   
   IntelliSense helps me immensely to focus on the algorithm and relieves me of   
   wasting time on petty details.   
      
   Yes, I could try to impose naming discipline on myself (e.g., all   
   substantives   
   are singular), and I did try, but it simply doesn't work: there are too many   
   cases to cover, and it still doesn't help with typos.   
      
   >   
   > SFINAE and static assertions are two different mechanisms that can be   
   > used to constrain templates.   
   >   
   Indeed, as you've mentioned, C++ templates are more powerful than C#   
   generics.   
   In this line of thinking:   
      
   c++ templates : c# generics = assembly language : high-level language   
      
   There are so many inventive ways of coding one and the same thing in ASM,   
   that   
   there is no hope of making intelligent code analysis tools for ASM (e.g.,   
   "find   
   all calls to subroutine X" requires that you have a convention for naming   
   subroutines, identifying their entry and exit points, passing parameters and   
   returning results, as well as identifying calls.  All of these can be   
   implemented in a multitude of ways.)   
      
   The same holds for templates.  "Power of templates" seems like a very   
   compelling argument, but we need to consider two things:   
      
   1. do we NEED all that power?   
   2. what price do we pay for it?   
      
   The answer to 1 is not clear-cut (I tend to lean towards "no"), and the   
   answer   
   to 2 is partly given in the subject of this post: people / universities are   
   leaving C++ for "less powerful" [whatever that might mean] languages because   
   they are more productive in them, also thanks to good tool support, which is   
   easier to make for a coherently designed language and libraries/frameworks   
   that come with them.  If I had the luxury of choosing the language I'm   
   working   
   with, I'd also choose C# or Java over C++.  C++ simply isn't human-friendly   
   (it's bearable when TMP isn't involved).   
      
   [An anecdote: I was making a toy project in Java using Eclipse, just to get   
   a   
   taste of the technology.  At first I was amazed at superb editing support   
   (completion, etc.), but my jaw dropped when I changed some code and the IDE   
   recompiled it and transparently hot-swapped it in a RUNNING PROGRAM that I   
   forgot to kill in between edits!  I realized what was happenning when I got   
   the   
   error message saying that a class couldn't be hot-swapped because its   
   signature   
   (methods added/removed) changed.  In short, technology behind Java and C# is   
   light-years ahead of that for C++.  The only thing that C++ has going for it   
   today are optimizing compilers and existence on many platforms. Java and C#   
   JITs are closing the performance gap, though.]   
      
   IMO, the only reason today to use C++ is performance which comes at the cost   
   of   
   decreased programmer productivity and UB lurking around every corner: e.g.,   
   the   
   standard library still doesn't have facilities for safe integer arithmetic.   
   (To be fair, Java doesn't detect integer overflow either, but it at least   
   *defines* it to wrap-around in 2nd complement arithmetic.  In C#, you can   
   choose.)   
      
   >   
   > Visual C++, Eclipse and XCode, arguably the 3 major C++ IDEs, while   
   > quite slower than a regular text editor, are still pretty usable.   
   > And they have pretty advanced IDE features: you can jump to   
   > definition, jump to a file, expand a macro, auto-complete member or   
   > function calls...   
   >   
   I haven't used Eclipse and XCode for C++, but I curse at VS(2008) rather   
   often.   
   All that (mostly) works when templates aren't involved.  In cases like   
      
   template   
   void SomeClass::SomeMethod(...)   
   { ..  }   
      
   (yes, it's a method template in non-template class.) I'm lucky if it's   
   willing   
   to complete *local* variables.  Once in a blue moon it will also list class   
   members.  Most often it just gives me names from the global scope.   
      
      
   --   
         [ See http://www.gotw.ca/resources/clcm.htm for info about ]   
         [ comp.lang.c++.moderated.    First time posters: Do this! ]   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca