Thread: why c++ and which other languages

  1. #1
    Registered User
    Join Date
    May 2006
    Posts
    630

    why c++ and which other languages

    Hello

    I've been wondering why you guys decided to start learning c++?
    What do you consider as c++ biggest advantages and disadvantages?
    What are the other languages that you think are good to know nowadays (for simpler solutions)?

    Thanks for answers!

  2. #2
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    The first is simple: a very powerful modern programming language, that is not restricted (like C#, VB) or slow (any dotNet language).
    The advantages, in my mind, is mostly power and flexibility as well as working close to the hardware. The disadvantage is GUI.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  3. #3
    Registered User
    Join Date
    May 2008
    Posts
    141
    Quote Originally Posted by Elysia View Post
    The first is simple: a very powerful modern programming language, that is not restricted (like C#, VB) or slow (any dotNet language).
    The advantages, in my mind, is mostly power and flexibility as well as working close to the hardware. The disadvantage is GUI.
    I have to agree with Elysia, though I took it up, simply because I wanted to create every piece of software you could make. With the Power of C/C++, you have the a near unlimited boundary.

    You could even make your own programming language ( PHP ), which makes C/C++ the best, besides assembly.

  4. #4
    The Richness... Richie T's Avatar
    Join Date
    Jan 2006
    Location
    Ireland
    Posts
    469
    Probably should have been posted in GD, but oh well.

    I started C and C++ because of coursework, got hooked on them right away. As for advantages and disadvantages, well that's often application specific. I would say that C++ has advantages over C such as a stronger type system, and the ability to do object oriented design can be very useful, which can be more difficult (but not impossible) in C. However, strong typing isn't always what the doctor ordered, and many scripting languages offer dynamic typing which is also a blessing and a curse depending on the application.

    I think that one disadvantage that C++ has is that it is quite a large language, which can make it hard for people to learn as they can encounter advanced topics without much understanding of more basic topics. Furthermore, it tries to maintain a lot of compatibility with C which tends to result in more than one way to do things, causing people to rely on the C approach rather than the C++ approach (dynamic memory allocation is a prime example in my opinion of a topic which people tend to use the C method as opposed to the C++ method). Again, this compatibility has obvious advantages, such as the ability to port code from C to C++ quite easily.

    Lastly, good languages to learn very much depend on your requirements. I would thoroughly recommend C since it has had such a massive influence and its more limited feature set can serve to help a programmer develop their skills. In addition to that, Python and Perl are very popular, both of which I'm looking at learning at the moment. Java and C# have a very big role in modern industry and are definitely worth a look if you want a job as a software developer.
    No No's:
    fflush (stdin); gets (); void main ();


    Goodies:
    Example of fgets (); The FAQ, C/C++ Reference


    My Gear:
    OS - Windows XP
    IDE - MS Visual C++ 2008 Express Edition


    ASCII stupid question, get a stupid ANSI

  5. #5

    Join Date
    Apr 2008
    Location
    USA
    Posts
    76
    Each language is good for different reasons. Java is the most popular, C is the fastest (typically), Ruby is probably the easiest and most expressive. It all depends on what you're looking for.

    C++ is good for general-purpose programming. This means you can program just about anything, and you can do it in a style that best fits the task you're working on (whether that be a generic approach, an object-oriented design, a procedural design, etc). C++ provides some of the most extensive support for generic programming, and it comes with an efficient generic library. It also has all of the low-level features from C, which makes it faster than most languages.

    The disadvantage of C++ is that it has some obscure syntax which results from strict compatibility concerns, and requires an understanding of some pretty demanding concepts. Basically, it's not easy to learn.
    Last edited by rudyman; 08-02-2008 at 08:30 AM. Reason: typo

  6. #6
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Quote Originally Posted by Richie T View Post
    I would thoroughly recommend C since it has had such a massive influence and its more limited feature set can serve to help a programmer develop their skills.
    I would not recommend C because it's not type safe, thus very, very easy to do errors that you shouldn't and that it's old, difficult and does not do very well in today's demanding world.
    Other looslely typed languages such as Javascript or VB provides automatic conversion between types and such, so its nature fits well with loose typed system. However, C does not do this and therefore, a loose type system is usually a bad thing.
    C++ is preferably the tool of choice for modern programming for PCs using C-like approach.

    But then again, it's up to each and everyone to pick the tool they feel best suited for the job.
    Last edited by Elysia; 08-02-2008 at 08:39 AM.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  7. #7
    The Richness... Richie T's Avatar
    Join Date
    Jan 2006
    Location
    Ireland
    Posts
    469
    Quote Originally Posted by Elysia View Post
    I would not recommend C because it's not type safe, thus very, very easy to do errors that you shouldn't
    Sure weak typing isn't great in practice, but I would say that it would be advantageous to learn a weakly typed language to really understand the importance of type safety. It's all good and well to write C style code in C++ and have strong typing on your side, but what happens when a programmer is required to work with a C compiler? It's a lot easier to move from C to C++ than the other way around as far as typing is concerned.

    Quote Originally Posted by Elysia View Post
    it's old, difficult and does not do very well in today's demanding world.
    Not necessarily true - think of all the embedded systems running behind the scenes in today's world. C might not be the leading language in terms of PC application development but don't forget the very demanding embedded world, C is a major player there.

    Quote Originally Posted by Elysia View Post
    But then again, it's up to each and everyone to pick the tool they feel best suited for the job.
    Exactly.
    No No's:
    fflush (stdin); gets (); void main ();


    Goodies:
    Example of fgets (); The FAQ, C/C++ Reference


    My Gear:
    OS - Windows XP
    IDE - MS Visual C++ 2008 Express Edition


    ASCII stupid question, get a stupid ANSI

  8. #8
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Quote Originally Posted by Richie T View Post
    Not necessarily true - think of all the embedded systems running behind the scenes in today's world. C might not be the leading language in terms of PC application development but don't forget the very demanding embedded world, C is a major player there.
    Yes, sorry, I meant PC.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  9. #9
    Registered User
    Join Date
    Dec 2006
    Location
    Canada
    Posts
    3,229
    C++ assumes that the programmer knows what he/she is doing. In comparison to, say, Java.

    For example, in Java, useful features of C++, like goto (if you know what you are doing. For breaking out of nested loops for example), pointers and operator overloading are left out because the language designers felt that Java programmers don't know what they are doing, and will use those two features unsafely. While those features are often used incorrectly, they are very useful when used correctly. On the other hand, C++ makes all those features available to the programmer, assuming the programmer knows how to select the best tool for the job at hand.

  10. #10
    Deathray Engineer MacGyver's Avatar
    Join Date
    Mar 2007
    Posts
    3,210
    Quote Originally Posted by cyberfish View Post
    For example, in Java, useful features of C++, like goto (if you know what you are doing. For breaking out of nested loops for example),
    Java's method appears to have been to simplify, as well as attempt to Object Orient, many of the complicated aspects of C++.

    Case in point, goto is a reserved keyword in Java, but it has no direct usage as of, yet. Because breaking out of nested loops is something potentially useful, Java has an advanced way to do suck by applying labels to the loops and specifying which loop you want to break from. This is not just applied to loops, but can be applied to almost any type of block of code, I believe. Thus, you have the advantage of forward jumping in code, with some ease of readability and maintainability compared to unrestricted goto or other advanced but almost unrestricted jump methods.

    As in the situation with goto, caution should be demonstrated using such a technique, although perhaps not to the same extent.

    Quote Originally Posted by cyberfish View Post
    pointers and operator overloading are left out because the language designers felt that Java programmers don't know what they are doing, and will use those two features unsafely. While those features are often used incorrectly, they are very useful when used correctly. On the other hand, C++ makes all those features available to the programmer, assuming the programmer knows how to select the best tool for the job at hand.
    This has been one of my complaints of Java. I believe restricting operator overloading is a very poor choice. The language itself does support the feature, as is evidenced in the String class having its operator= overloaded to allocate a new String object and assign the string in question. Programmers may abuse such features all the time. Java programmers may write their entire program in a main() method and never properly get into the OO feel for the language, but you can't stop them from doing it. I think the choice should be left to the programmer in such a situation, since there are times that operator overloading has extreme benefits. To restrict all of the good cases on account of the bad might not be the best approach.

    C++ has done so well, imo, because it gives programmers almost full power to do whatever they want. One can write code in a very low-level manner in C-style, or slightly more advanced with an OO approach, or a potentially even higher route with the advantages of templates. It is a great language, even if difficult to master, but it is probably not going anywhere anytime soon, just like C is probably still going to be around for awhile.

Popular pages Recent additions subscribe to a feed