After two days if uni related c++ programming, all I can say is one thing:


  • 12
    C++ is lit. You'll come around sometime soon
  • 7
    You won't find another language that's 10 times as fast as c# and has type generics. C++ can be beautiful and efficient, or complicated and barely running. It takes a lot of planning to make it right.
  • 8
    It was invented because Bjarne Stroustrup wanted to program in Simula but was made to program in C. So he made a preprocessor for C to make it look like Simula. Hence C++ was born. Basically someone hated C and wanted something better. Incidentally this is also how Objective-C was born, except we ended with something worse instead of better.
    Little history for ya 😎
  • 1
    Have a gander at C, I hate C++ too and after like 5 minutes of messing with C... I know where my allegiance is
  • 3
    C++ is fun
  • 6
    C++ is four languages in one.

    1. C with extensions (type safety, overloads)
    2. Classes
    3. Templates
    4. Extension frameworks like Boost.

    Start with the first and go to the next level only once you have mastered the previous.

    With C you have great power, but can shoot yourself in the foot.
    With C++ you have even greater power, but can shoot yourself your leg off.
  • 5
    You say that but then you realize there's OOP (Classes with inheritance, functions with overloading), generics, static compilation, a very complete standard library, proprocessors, operator overloading, c-style AND object-style strings, pointers AND references and you realize that c++ is actually just a really powerful tool.

    Don't worry. People tend to cut themselves a lot until they get used to it. The << overloading trend is a little odd though. It's weird to cout << "Something" instead of print with a function but whatever. I forgive it.
  • 0
    @AlgoRythm I kinda miss a built-in method to parse string to int and back tho.
  • 1
    @Lor-inc I don't know specifically about parsing ints from strings but I know there's std::to_string
  • 0
    @AlgoRythm You can use StringStream if you don't want to use atoi etc.
  • 0
    Why? .. just wondering
  • 1
    @Yamakuzure Sounds pretty familiar.

    I have a lot of expirence with PHP and go, from these two c++ is a lot more low level and sometimes feels really bloated.

    @AlgoRythm we're not allowed to use a lot of things from the standard library...

    But I admit it, generics are cool.
  • 1
    Also why do you get a segfault when trying to access a value in an array which is greater or lower than the array, but not when moving an item in the array to a position of (length of array)+1 ??

    Had a lot of fun with this one yesterday.
  • 1
    You have taken your first steps into a larger universe 🌌
  • 0
    Think of it like a forced marriage.

    You might hate it at first, but come to like it over time.

    Just don't get divorced !
  • 0
    @irene With SStream you can convert a lot of formats.
    Example : https://geeksforgeeks.org/convertin...
  • 0
    @irene no, you aren't. There are some cases in which the StringStream class is convenient, but efficiency looks different. If it needs to be fast, that extra layer won't help, and using atoi() and friends directly is the better idea by far.
  • 1
    Just wait for when you.get stuck on a micro or tool chain without dynamic allocation, exceptions, strings or some other fun obsticle. 16 MB is still a vast amount of memory in some places 😁
  • 0
    @TafT you would use plain C there anyway, wouldn't you? 🤔
  • 0
    @Yamakuzure OOD != Dynamic allocation || (STL || std lib)

    Once you are very use to C++ and object oriented design there are lots of problems simpler to solve with it than with C and procedural programming. No virtual classes also helps remove the main memory overhead that C++ should have over C.

    It is a weird old world in odd micros and old specialised tool chains. Now days you are much more likely to have full standards support and bags of memory on an ARM or similar. There are times you still might be counting the IPS let alone the MIPS.
Add Comment