I started with basic in high school on a dec PDP-11. All together I’ve been in IT in one form or another for around 37 years (dam, that makes me feel old). Learned fortran on punch cards in college, then went to work for the university as a programmer, wandering between assembly, C, fortran and even a little cobol (very little). I spent time writing NLM’s (Network Loadable Modules) for the old Novell servers, wrote warehouse management systems in C, and a heavy amount of Oracle PL/SQL. I’ve learned several of the scripting languages like Moca and Abap. I’ve done my share of web development in ASP and Java. I have a degree in Electrical Engineering and a Masters in Computer Information Systems, but with all of that my passion is programming.
Through all of that the changes we have seen, the ones that I felt were the best advances we have made from a programming language perspective, is structure (both flow, and data), and Objects. In Basic and Cobol, goto’s were a nightmare. Pascal and C gave us the ability to structure our code so that it was easier to follow and maintain. Yes, types were a nightmare so were linked lists. The new structures we have today, have brought us a long way from those.
Python is more like the wild west, variable types are fluid and easily converted (which is a good thing), argument passing is what it is, any problems, and just throw self. in front of it and problem solved. I just think that if we are going to have something that looks up a value, it should either just look up the value and return it or return a dictionary or list with the value(s) in it, or have an additional function that tests to see if the subject of the query exists first so you can avoid the call if it’s going to fail.
The nice thing about returning a dictionary from functions like info_timer is that it makes the return values easy to extend if you want to bring by additional information in the future without having to re-code downstream apps immediately. They only have to re-code if they want to consume that data. It also allows you to return “None” if the timer doesn’t exist. When functions return multiple values, do you have to account for all of them to store return values when they are called? If so, then adding an additional return value to a function like that would require immediate recoding of any apps that use that function.
This is really a conversation better had over a beer and some burgers. It’s conceptual and very dependent on the style of the developer. For me, I’ll just take info_timer, override it and deal with the error in the override function. That way you don’t have to change anything which would impact anyone else using the app, and my code stays clean the way I like it.