Announcement

Collapse
No announcement yet.

Why your next language better be C++

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Why your next language better be C++

    http://www.i-programmer.info/profess...tter-be-c.html

    It looks as if the war between C++ and C# is over and C++ has won.
    ...
    Whatever eventually happens there is no doubt that at Microsoft C++ is back in fashion and when you look at the alternatives on offer it looks more atractive than ever.
    ...
    Modern C++

    Outside the Microsoft realm C++ has also just received a boost from the finalization of the C++0x standard which finally drags C++ into the modern era. The new C++ has features such as lambdas, initializer lists, a for each style construct, delegating constructors and so on. It is a big improvement. At the same time that standard C++ is getting a makeover it is being extended into a toolkit for parallel programming. There are C++ frameworks like the Parallel Patterns Library (PPL) and language extension like C++ AMP that make it easier to build reliable parallel programs. After all if you are looking into making use of multiple processors then you must be interested in speed. If you are interested in speed you must put C++ high on your list of possible languages.
    ...
    This is the reason why C/C++ make a good choice for mobile systems. Apple has Objective C on iOS and now Google is promoting native C++ code on Android. It's a shame about iOS, so near and yet so far, but this is a closed world with nothing that is non-Apple allowed. It's not as if iOS programmers actually have a choice.
    The same sort of return to C++ is happening in the browser with Chrome adding a native code API. Currently this supports C/C++ but promises other native code languages - of course the problem will be finding any!

    The reason for this return to native code is efficiency.
    ...

    So the future is clear
    there will be JavaScript in the browser
    and C++ will rule the rest.

    "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
    – John F. Kennedy, February 26, 1962.

    #2
    I've worked in C++, and in my humble opinion it's just too hard for your average programmer. It takes at least six months for most people to learn a minimal subset, and in my experience some just don't make it at all:roll:. I've yet to use the new c++11 stuff, some of it might help in that the standard library components can be made more robust.

    Java, OTOH, can be learned by most, I think. C is easy to learn, but pitfalls gape all about for the learner and the inexperienced.
    Regards, John Little

    Comment


      #3
      From my POV, C++ when learned simultaneously with the Qt4 API makes learning both easier than learning Java, then C++ and then Qt4.

      Java has its own learning curve, including the inverse include structure, and it behaves differently from C++. Qt's API gives C++ applications all the features that Java coders brag about: garbage collection, auto pointer destruction, etc...

      And there are a LOT of Qt4 tutorials. Books, documents on the Qt website and vidoes on YouTube Here are 104 recent and sequential training videos teaching how to use Qt4: http://www.youtube.com/watch?v=6KtOz...1942A4688E9D63
      It explains the difference between LGPL Qt4 and the commercial version. There are 224 videos in that channel.

      With Qt4 you start with the classic main.cp (not necessary but practical for beginners), which invokes the Qt4 app class, which calls the other *.cpp and their respective *.h files (after compiling), if necessary.

      In fact, one could use the Qt4-Designer to write an application without writing any lines of C++ code although, admittedly, for complex applications that may not be practical, even if doable.



      I learned Qt & C++ at the same time, and the first application I wrote was "Homestead" (HAPP) using MSVSC++, in 2005. When I completed the app I created a document explaining how I wrote it, and it is published here: http://www.qtcentre.org/wiki/index.p...t4_and_C%2B%2B , on Jan 18, 2006.

      Since installing Qt was a lot more elaborate and difficult then than now, chapter 2 can be ignored. The actual programming starts at chapter 3. Most of the description involves the Windows environment. Because the laws change each year and data had to be kept for 15 years, the program that worked with that data also had to be preserved as it was at the close of the year it applied to. This is because the laws might require changes to the data or presentation, and last years program may not work against this year's data. So, each year I modified it and the oracle database to reflect the new year, ready to collect the new year's data with an application that reflected changes required by laws passed or modified by the state legislature. During the start of the 2006 year, after I posted that document, I switched to Linux because MSVS was taking 25-30 minutes to compile HAPP. I used the g++, Kate and Kdbg. What took over 25 minutes on WinXP using MSVSC++ took less than 5 minutes in Kate's console using g++. Kate's auto-completing didn't work the way it did in MSVC, since it only uses the context of previously typed phrases and doesn't link to the libraries to bring up parameter lists and values. Using Kdbg against the binary compiled in debug mode and the source files I could step through the code and locate logical and other errors easily.

      QtCreate didn't appear till after I retired. I have used it to modify and compile HAPP for the State on a couple of occasions, and it is just about as fast as using Kate and a Konsole, but it has equal or better functionality than MSVSC++. That video I linked to shows the auto-completion functionality. QtCreate is more complicated than Kate. One can use the Cessna Kate until the art of flying is learned, then graduate to the F22 QtCreate to go into battle.

      If one installs every package that begins with qt4- and libqt4- then all the relevant packages will be installed. Or, one can download and install the Qt4 SKD from the Nokia website: http://qt.nokia.com/downloads I prefer the offline installer, it is a 700+MB download, but you'll have the tool for posterity to install on other boxes. Installlation is easy. After download do

      chmod u+x Qt_SDK_Lin64_offline_v1_2_en.runthen do

      ./Qt_SDK_Lin64_offline_v1_2_en.runto install it.

      FYI, Qt4 has connectivity to PostgreSQL if one installs the libqt4-sql-psql package. Oracle connectivity can only be purchased. It is not free. However, IMO, PostgreSQL has 95% of the functionality of Oracle10g, and many features that Oracle does not have, including affordability and several active support forums. I began using PostgreSQL as the back end under Linux. I used compiler defines to switch code in or out based on the platform the code was being compiled on, so I didn't need an Oracle license to develop the app. Also, IMO, anyone who uses Oracle over PostgreSQL is just burning money, and lots of it. Even three dimensional selects (CUBE in Oracle) can be done with PostgreSQL.

      One other MUST. Version control. DON'T EVEN THINK of coding without using version control. I recommend either Baazar or Git. Both are in the repository and both are easy to learn and use, especially when you are coding alone. Each time you reach a plateau or good stopping place in your code, create a version tag with Baazar/Git. If you decide to experiment on a tangent create a branch. If things don't go well you can revert to the version tag before the branch. If things do go well you can merge the branch with the last version tag and create a new version tag.

      Finally, do not forget to BACKUP!. That includes the version control repository as well, and at the same time as you back up the source directories.
      Nothing in coding is more comfortable than this:

      Click image for larger version

Name:	baazar_example.jpg
Views:	1
Size:	22.6 KB
ID:	639962
      Last edited by GreyGeek; May 30, 2012, 06:02 PM.
      "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
      – John F. Kennedy, February 26, 1962.

      Comment


        #4
        Thank you GreyGeek, for your post, personally interesting and useful.
        Just a few comments...
        Originally posted by GreyGeek View Post
        Here are 104 recent and sequential training videos ...
        I started watching the videos...
        There are 224 videos in that channel.
        there goes my week...
        One can use the Cessna Kate until the art of flying is learned, then graduate to the F22 QtCreate to go into battle.
        Sorry, I'm already in the F35, vim. Qt Creator has a fake vim mode, but there's various projects working to better integrate vim, which I'm watching with interest. There's a vim-qt project, too.
        FYI, Qt4 has connectivity to PostgreSQL ...
        Well, I first reach for mysql, and indeed one can. Have you any perspective on PostgreSQL versus mysql?
        DON'T EVEN THINK of coding without using version control.
        I intend on my next project to automatically create a version on every save.
        Regards, John Little

        Comment

        Working...
        X