8
omii6128
286d

What is the messiest C++ program ever?

Comments
  • 12
    All of them
  • 1
    I have great interest in learning programming. I would like to learn C++. Where should I start?
  • 2
  • 2
    @MargaretGilliam
    Start with Assembly language.
    Then comes C - and then C++.

    If you code in memory unsafe languages, you really need to know what you do.
    Also never code while tired or distracted as some of the RCE-enabling bugs will definitely make it into production.

    If you can do it in a memory-safe language - do it in a memory-safe language. But if you have to use a memory-unsafe language, triple-check your code extra carefully _on_different_days_ before actually pushing it.
  • 2
    My programs for my Robotics team.
  • 1
    @Oktokolo C++ gives you smart pointers and even lets you define your own so that you never have to use new or delete in code not exclusively responsible for memory management.
  • 1
    I know most C++ isn't like that, but it is a viable option.
  • 1
    c++ is messy by itself
  • 2
    @Oktokolo As i always say. Its not that C is unsafe language. Its people making it unsafe.

    If you know WTF you are doing with memory and understand it you are fine. You dont. Well good luck :P (Valgrind is your friend cause we all make small mistakes from time to time :) )
  • 0
    @Haxk20
    C is a memory-unsafe language.
    And choosing a memory-unsafe language makes it a lot more likely, that there are RCE bugs in the code.
    So if the coder isn't a higher being not creating bugs, it is in general a pretty bad idea to do something in C when it could be done in a memory-safe language.
  • 1
    @Oktokolo And yet here im coding in C for Years upon years. Valgrind people. Fucking use it. Im not perfect. I make mistakes. Valgrind doesnt tho.

    And i will continue to choose C over any other language. Be it memory safe or not. Its nearly always faster. And well i like it. However weird that may sound.

    And then there is the part that i cant avoid it. Im linux kernel dev in free time. (Projects are in C usually tho as well)
  • 1
    Ok that sounded little toxic. Wasnt meant to be. Sorry :)
  • 0
    @Haxk20
    No problem.

    You obviously can't build the whole Linux kernel in a memory-safe language.
    Some try to make it possible to use Rust there to get memory-safety by default for the majority of code which doesn't actually need memory-unsafety. But it seems to not be there yet...
    Legacy code also is a thing - and someone has to maintain it.
Add Comment