• 0 Posts
  • 31 Comments
Joined 4 months ago
cake
Cake day: June 4th, 2025

help-circle


  • The things you mentioned are very good, but what I’m missing is feedback and a good foundation.

    Feedback should come from other developers - ideally experienced, but a good dialogue between beginners can also teach both sides a lot. For me this came only after I started working, through code reviews. But you could also try contributing to open source, or putting your own code online. Although I fear you won’t get much feedback.

    A good foundation is about software and hardware designs. Without this you will inevitably come to a point where you made a fundamental mistake in design.

    For hardware design I recommend YouTube. Many channels talk about low level hardware. You don’t need to become an expert, just get a high level understanding.

    For software design, check out the gang of four’s Design Patterns. It is a seminal work. You don’t need to read it all but be aware of the patterns, and study a few like factories and facade in detail.









  • Don’t blame this on gcc or the library/function author - it is 100% user (i.e. programmer) error. Uninitialised memory of any type is undefined behaviour in the C and C++ abstract machine. That means optimising compilers can assume it does not exist.

    For example, the compiler could see that your ‘b’ is never initialised. Therefore, using it would be undefined behaviour. So, the optimiser can assume it is never used, and it is as if that code simply does not exist: the behaviour you saw.

    I’m not saying that is what happened, nor that it will always happen, but it is a possibility.









  • zerofk@lemmy.ziptoProgrammer Humor@programming.devVintage
    link
    fedilink
    arrow-up
    16
    ·
    edit-2
    2 months ago

    You know how some languages write left-to-right, and some rught-to-left? Endianness is that, for numbers.

    Or another analogy is dates: 2025/12/31 is big endian, 31/12/2025 is little endian. And 12/31/2025 is middle endian. Which makes no sense at all because the middle is, by definition, not an end.