Just your typical internet guy with questionable humor

  • 7 Posts
  • 129 Comments
Joined 1 year ago
cake
Cake day: June 22nd, 2023

help-circle







  • Yes, you got the gist of how it works.

    To give a bit more context, functions are basically snippets of code that are executed when called. One way to look at the input("What's your name?") function is this (not how the actual function looks like, just an abstraction):

    function input(text_to_show):
        print(text_to_show)
        input_from_user = get_keyboard_input()
        return input_from_user
    

    That return is something you will see often in many functions, and when you call a function, that’s the result it sends to the line that called. So, if input was actually coded like this:

    function input(text_to_show):
        print(text_to_show)
        input_from_user = get_keyboard_input()
        return 1
    

    Every time you called it, you would receive 1 as a result. In your example, nam = input('Who are you? ') would always assign 1 to nam, because the return is 1 rather than the variable that receives whatever you typed in.






  • With 65 percent of projects adopting Agile practices failing to be delivered on time

    They’re not “failing to deliver”, they’re being Agile in disappointing everyone involved!

    Projects where engineers felt they had the freedom to discuss and address problems were 87 percent more likely to succeed.

    Which shouldn’t surprise anyone, but I know some managers, directors and users loathe the idea of the people who’ll do the actual job having any say other than “yes, sir”.

    In highlighting the need to understand the requirements before development begins, the research charts a path between Agile purists and Waterfall advocates.

    Good documentation is critical and process-agnostic. If people can read and understand it, it’s good. It’s something that can be used as a shield and weapon against users/higher ups who want too much, it can create a trail of responsibility.





  • Everyone cares way more about the code being legible, the code being fast enough, and the code not using a ton of memory (and even that last one is kind of shrugged off depending on context).

    And then you look at real life and notice that code everywhere is slow, bloated and inefficient. But hey, it’s “legible”! To one or two devs, hopefully.

    The equivalent of your complaint 3mb vs 200mb is like complaining about a person taking a trip to the grocery store

    Terrible analogy. A better equivalent is someone renting a garage to store stuff inside and now, because they have so much space, there’s that urge to fill it, whether it makes sense to or not.

    making things smaller often makes them slower

    It’s usually the other way around. As a rule of thumb, less code = smaller size = faster execution. In theory, 1k lines of code will require less computation, less processing, than 10k.