1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Why one should choose C++

Discussion in 'C++' started by Sanskruti, Mar 14, 2007.

  1. Sanskruti

    Sanskruti New Member

    Joined:
    Jan 7, 2007
    Messages:
    108
    Likes Received:
    17
    Trophy Points:
    0
    Occupation:
    Software Consultant
    Location:
    Mumbai, India
    It's a truly neutral question: given that there are many languages to choose from, why do you choose to program in C++?

    1. Compared to many of the other OO languages (i.e. Java, C# etc.), C++ has better support for the functional programming style.

    2. Good support for generic programming.

    3. C++ is faster. No matter what you have heard, the overall speed of C++ applications (either real or perceived) is greater than that of other languages.

    4. Templates and generic programming without too much brain twisting. Templates and type safety is very important. If C++ hasn’t had templates, it would not be used.

    5. Direct interfacing with C and O/S routines.

    6. Plethora of good libraries.

    7. C++ is always the right choice for serious applications that can be re-compiled on multiple platforms.

    8. C++ is preferred choice of programmers all over the world when it comes to programming for creating games.

    Why programmers don't program in other languages other than C++?



    1. Java and C# can't do many intelligent things that C++ can.

    2. Having everything in classes does not always make sense.

    3. Python and perl have weird syntax. ML and Haskell have even more weird syntax.

    4. The most important reason: it is not directly visible, from the available online resources, that what can be done with C++, can not be done with LISP/ML/Haskell/O'caml/etc.

    In other words, gist of the matter is it's not the elegance of a language that counts, but rather the most cliche of arguments: what one can do with a language, in the shortest space and time.
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,287
    Likes Received:
    364
    Trophy Points:
    83
    I choosed it because I love it.
     
  3. dav

    dav New Member

    Joined:
    Mar 15, 2007
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    0
    hi dudes
    this is my first commet in this site actually I have spend 6 years in working with Delphi which I conseder a great language but now and sadly we have to divorce cuz in the 9th month of this year I'll start a new studing in the university where only C++ and JAVA are allowed, so I do not know what 2 do and which is the better some people say C++ others say Java can u help me????????????????????????????????????????????????????????????

    best regards
     
  4. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,287
    Likes Received:
    364
    Trophy Points:
    83
    My answer will be biased but it all depends on the job you do you will love the one in which you work the most as was the case with Delphi.
     
  5. asadullah.ansari

    asadullah.ansari TechCake

    Joined:
    Jan 9, 2008
    Messages:
    356
    Likes Received:
    14
    Trophy Points:
    0
    Occupation:
    Developer
    Location:
    NOIDA
    No need Of C++ If you have excellent skill in C. Except Industrial needs c++ to make design in less time.

    Means you can do all things in C. C++ only making less man power in Industries.
     
  6. oleber

    oleber New Member

    Joined:
    Apr 23, 2007
    Messages:
    37
    Likes Received:
    2
    Trophy Points:
    0
    Occupation:
    Software Developer (Perl, C/C++ and Java)
    Location:
    Hamburg, Germany
    Home Page:
    This is ridiculous :mean:

    C++ isn't faster or better then Java 5 or 6 in many cases:
    -> If you need to use virtual methods, the base of any OO programming.
    -> C++ way of allocating memory is slower then the one used by the Java VM.
    -> Java is able of doing runtime optimizations, and all the ones that a C++ compiler can do.
    -> Java has less errors by loc in average.
    -> Java is easer to port on multiple platforms. No recompilation is needed.


    Now comparing to Python, Perl, Ruby, ...
    -> you get less code, don't get surprised if you do the some code 10x less code. So fast Development.
    -> you have many more library's and all the ones of C++.
    -> perfect languages to the 80% of the code that you are running 20% of the time.
    -> all this languages can call C code in a ease way.


    Now comparing to ML, Haskell, Prolog, ...
    -> They have different concepts Functional Programming or Logic Programming. They have there areas where any of the previous are suitable. For example the VC++ uses Prolog.


    And telling the truth,
    If I need running fast, I will do it in C.
    If I need realtime, I will do it in ADA.
    If I need beauty I'll do it in Java.
    If I need fast development, I will do it in Perl.


    C++ is good for games since for long time it was the best, and many libraries are done on it, just that.

    THE KING IS DEAD, long life to the new kings
     
  7. bloom_star7

    bloom_star7 New Member

    Joined:
    Sep 15, 2007
    Messages:
    4
    Likes Received:
    1
    Trophy Points:
    0
    Hi,

    All of What You discussed is correct up to maximum extent. But the missing thing is

    The Main power of C++ is
    1. Its ability to Use the oops concepts which is missing in C. ( this feature will help us in creating the Good design apporach)
    2. We can use the pointers in C++, which is missing in Java. :surprised
     
  8. asadullah.ansari

    asadullah.ansari TechCake

    Joined:
    Jan 9, 2008
    Messages:
    356
    Likes Received:
    14
    Trophy Points:
    0
    Occupation:
    Developer
    Location:
    NOIDA
    i am apposing your first point. Who is saying C miss oops concepts. Okay according to definition given by some C++ guys C miss OOPs. But You can do all design as C++.
    You might be know that all very big complex designing is in C only like Operating System. Can you say that operating sytem is not well designed. or it is less complex
     
    Last edited: Jan 28, 2008
  9. oleber

    oleber New Member

    Joined:
    Apr 23, 2007
    Messages:
    37
    Likes Received:
    2
    Trophy Points:
    0
    Occupation:
    Software Developer (Perl, C/C++ and Java)
    Location:
    Hamburg, Germany
    Home Page:
    In Java you just have references/pointer :disappoin


    The the question of the C versus C++
    First of all remerber the history of the first compilers of C++, they where just translatting the code to C and after the C compiler where doing the work. Basicaly the object was passed has the first argument of the method, similar to some scripting languages today like Perl.

    So a good desing can be done in any language, since good design should not depend of the programming language.
     
  10. asadullah.ansari

    asadullah.ansari TechCake

    Joined:
    Jan 9, 2008
    Messages:
    356
    Likes Received:
    14
    Trophy Points:
    0
    Occupation:
    Developer
    Location:
    NOIDA
    I did'nt mean that... I mean complex problem can be solved by C with more efficient than C++.

    >>> Reason is that in C a lot of skills and time is required. Industries can'nt afford it . So they are easily using C++.
     
  11. bloom_star7

    bloom_star7 New Member

    Joined:
    Sep 15, 2007
    Messages:
    4
    Likes Received:
    1
    Trophy Points:
    0
    Yes. I fully agree with you that every thing is possible in C.(In fact i also moslty like C than C++ :mean: .) But the fact is that, for one thing which can be very very easily designed in C++ will take a lot lot efffort as well as will become more complex if we design in C. Take the example of disigning the interfaces with the UI applications. In case of C++ we can do it simply by making use of the virtual and pure virtual functions. But if we want to do the same thing in C then we may need to make use of the function pointers & e.t.c. e.t.c. which becomes very complex.
     
  12. bloom_star7

    bloom_star7 New Member

    Joined:
    Sep 15, 2007
    Messages:
    4
    Likes Received:
    1
    Trophy Points:
    0
    Yes. I agree that in java we can use the refereces as the alternative to the pointers. But it will be usefull while passing the arguments to the functions. Think of using the virtual and pure virtual functions. In that case if we don't have the pointers then we may not take the full advantage of it.

    If there is any conflicting or misleading statement please ignore it because i don't know Java well. :thinking:
     
    shabbir likes this.
  13. asadullah.ansari

    asadullah.ansari TechCake

    Joined:
    Jan 9, 2008
    Messages:
    356
    Likes Received:
    14
    Trophy Points:
    0
    Occupation:
    Developer
    Location:
    NOIDA

    In C++ we are writing a keyword Virtual or virtual assigning with zero, But generated code by this is very big and complex too. It's totally hidden to User. But you know If we will use function pointers( in place of virual ) then you know first time may be it will take time to understand and write but after that our skill will be improved .

    Benefit of using C++ is only for Industries to minimize ManPower and they could make money more.
     
  14. rekha11

    rekha11 New Member

    Joined:
    Jan 31, 2008
    Messages:
    13
    Likes Received:
    3
    Trophy Points:
    0
    We should choose c++ because of FOllowing reasons:
    1. Compared to many of the other OO languages (i.e. Java, C# etc.), C++ has better support for the functional programming style.
    2. C++ is faster
    3. C++ is always the right choice for serious applications that can be re-compiled on multiple platforms.
    Actully its depends on your skills.if user have the interest in c++ or other language then user will be prefer that which he has interest
    dont confuse ,go on ur interest!
    ____________--
    rekha
     
    Last edited: Apr 22, 2008
  15. asadullah.ansari

    asadullah.ansari TechCake

    Joined:
    Jan 9, 2008
    Messages:
    356
    Likes Received:
    14
    Trophy Points:
    0
    Occupation:
    Developer
    Location:
    NOIDA
    Offcourse with respect to Java &C# , C++ is fast. no doubt at all.
     
  16. oleber

    oleber New Member

    Joined:
    Apr 23, 2007
    Messages:
    37
    Likes Received:
    2
    Trophy Points:
    0
    Occupation:
    Software Developer (Perl, C/C++ and Java)
    Location:
    Hamburg, Germany
    Home Page:
    Off course?

    Depends on the problem that you are using.
    Try to use allot of:
    - multiple derivation with virtual methods
    - allocation and free memory
    you can get a surprise with the newest version of Java.

    Java was slow in the first version, really slow. but now is really comparable. It has the advantage and the disadvantage of having a VM.
    What does the VM for you:
    - moves your most frequently used object to the some blokes in memory, such a way that you will get them frequently in cache. Of course you can do it in C++, but who does that?
    - Optimizes the code in run time, this optimization can't be done without statistics. This reduces the jumps. Your C++ compiler doesn't do it.
    - From the version 1.6 your object can be allocated in the stack and you just need to do your normal code. Before this was a cancer in Java since you where always going to the heap.

    So the point is: It's not clear if C++ is always faster then Java, most of the time C++ loses if you are really programming in OO way. Of course that C is faster then Java, but C is also faster then C++.

    Now Java have it's problems. In average is fast, but can slow down times to times with the Garbage Collector, code optimizing, ... It isn't good for realtime systems, for that you have the serious realtime language like ADA. Clearly better suit ball than C++ for this systems, the problem is the small community and the very expansive compilers.


    Please do some tests with the new version of Java, maybe you can get a surprise.
     
    shabbir likes this.
  17. imrantechi

    imrantechi New Member

    Joined:
    Feb 12, 2008
    Messages:
    116
    Likes Received:
    4
    Trophy Points:
    0

    even i feel he is right
     
  18. johnysmith66

    johnysmith66 New Member

    Joined:
    Feb 18, 2008
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Hi guys,

    i like C++ because it was the first programming language i learnt... which i understood a lot....
     
  19. lead.smart34

    lead.smart34 New Member

    Joined:
    Feb 14, 2008
    Messages:
    77
    Likes Received:
    0
    Trophy Points:
    0
  20. crazytolearn57

    crazytolearn57 New Member

    Joined:
    Feb 14, 2008
    Messages:
    48
    Likes Received:
    0
    Trophy Points:
    0

Share This Page