• 0 Posts
  • 6 Comments
Joined 1 year ago
cake
Cake day: June 6th, 2023

help-circle
  • If the method does a long thing, the keep it long. I do a lot of data analysis and simulation, and so often people who came before had this urge to shorten methods, so we get:

    def do_calculation(N, X, y, z, a, b, c):
        # Setup stuff
        for i in range(N):
            calclation(X[i], y, z, a, b, c)`
    

    Sometimes there’s a place for that, like if calculation could be swapped for a different function, or if calculation is used all over the program. It’s a pretty good clue that something is up though when the signatures are almost identical. Of course, that has just led to people writing:

    def do_calculation(big_struct):
        read_data(big_struct)
        calculate(big_struct)
        write_data(big_struct)
    


  • Every (US) job description I’ve had save one had a line to the effect of “… and other duties as required by management.” Not to follow would be considered insubordination and could lead to termination with cause. Job description in this case is just a broad-stroke outline of what the job is supposed to entail.

    The “save one” was a job with a strong union presence. In that case, going outside my job description could lead to me and my manager being in trouble.