top | item 42882758

(no title)

blumomo | 1 year ago

Moving from Java to Python for the preferred backend language many many years ago was a relief: building prototypes faster, no need to mention obvious types (int, bool, string) anywhere. In some places using (data) classes and I had robust programs. When doing type mistakes, running the program or having unit tests exactly told me where I had it wrong - no need for type annotations to enjoy programming, right?

But now over the last years, I happen to prefer changing programs a lot without running them a lot. I often do code refactorings over multiple commits, being highly concentrated, without running the code once. And then only running the code only 1 hour or 2 later. Such a pleasant activity! Just writing, reading, writing, thinking code. No ugly and long stack traces, no need to input user data into input fields, just reading and changing the program code, with the editor in full screen.

And guess what I highly started to appreciate, after many years of Python! Type annotations! With type annotations a LSP would immediately underline any mistake I would accidentally make, and that made me feel much more comfortable and secure about my changes, over several commits, touching 100s of lines without ever running the program. I suddenly learned to understand, after many years of dynamic type less programming with Python, that I can get more easily and for much longer into a flow state when I add annotations and run a LSP live over my code while I work on it.

discuss

order

No comments yet.