The same person as [email protected] and [email protected]

  • 1 Post
  • 35 Comments
Joined 10 months ago
cake
Cake day: June 26th, 2025

help-circle





  • Like a lot of people mentioned, there’s a few good things you could start with, but C is probably not one of them. At my old job I ran a course for software engineer 2s to go over C, and even they had some struggles with it. If professional engineers struggle with C, it’s maybe not the best starting point. Even C++ might be better, but still adds a lot of complexity that isn’t necessary to know as immediately as the beginning.

    Whenever people ask me where to start, I say python. It gives you a relatively tame taste of environment setup, and can run code very easily and flexibly. Its type system is flexible enough to make a user aware of it, without it being as rigid as C or as vague as javascript. Because there’s enough libraries that are easy to pull in, even a beginner can start building useful programs without having to know how to build something equivalent to those libraries themselves.

    Obviously if you want them to make websites, javascript will be necessary eventually, and isn’t a bad place to start. If you’re going purely for CS knowledge, I do think python is a little better; going from python to JS is probably easier than JS to python.











  • Daedskin@lemmy.ziptoProgrammingMy first successfull program in C
    link
    fedilink
    arrow-up
    3
    arrow-down
    1
    ·
    5 months ago

    One thing you can do that I find comes up pretty often in C is start using switch statements to avoid code duplication. Because your operators all take 2 numbers, you’ve separated out the input handling into its own block; that alone is a really good insight.
    You can take it another step further by making your print statement also, mostly, one block of code, with the only difference being the operation being preformed. By printing “The” followed by using an if-else block — or, again, preferably a switch statement — to both print the operation text, and compute memory, you can print the remainder of the line the same way for every operation.
    It may seem nitpicky for such a simple program; but the use case of C is for programs which require tight execution and often contain complex, low-level logic. Reducing complexity whenever possible helps make C more readable, as well as signal when the complexity is necessary.



  • Daedskin@lemmy.ziptoLemmy Shitpost@lemmy.worldmonumentale
    link
    fedilink
    arrow-up
    14
    arrow-down
    1
    ·
    6 months ago

    I once worked on a project doing firmware that a lot of people have likely used (printer firmware for a big-name company). One of the more trafficked functions was something like 1500 lines of “if-elseif-elseif…” with something like 13 or 14 different cases.
    It did end up getting refactored to something polymorphic and based on a configuration file to cut out any unnecessary steps, but it was like that for a while before I got there, and was like that for most of the year that I was part of the project.



  • Daedskin@lemmy.zipto196@lemmy.worlddeporting immigrants rule
    link
    fedilink
    arrow-up
    29
    arrow-down
    1
    ·
    7 months ago

    Met a really racist person who was like: “All non-real british people should be deported”. I said: “What makes someone real?”; and he was like: “If both their families have been here since the 1700s”. I said: “You know what, I can get behind deporting the king.” and he didnt like that response.