Back To Work and Loving Python
/Back to work today. I'm working on a new version of the Tagomatic for next year. I'm designing the boxes using a program that I'm writing inside the FreeCad designer. This is almost certainly not the best way to do it, but I like programming and I love being able to change any aspect of the design by just tweaking some numbers and re-running the code.
I'm working in Python in the seriously constrained environment of the FreeCad macro editor. This has no breakpoints, single stepping or variable viewing, but I'm quite enjoying the experience. Python is definitely growing on me.
There is a school of thought that things like airbags and crash-absorbent cars have actually made driving more dangerous. Drivers may be more inclined to take risks if they know that their car will save their life if things turn out badly. This leads to an argument that the best safety device for a car would be a sharp metal spike sticking out of the steering wheel. This would make the driver very conscious of the effects of any stupidity on their part....
Writing Python is very like this. I think of it as "building bridges with dynamite". Mistakes can have catastrophic effects. Spelling a variable name incorrectly and gets you all kinds of fireworks. Incorrectly using one of the language constructions opens the door to a world of pain. So you end up being very careful when you code.
You use block copy to copy variable names so you never misspell them (of course, if you use Iron Python you can get Visual Studio onto this one). You compile often. You write tiny behaviours and test them as you go along. And you automate your tests so that you can run them again and again.
If the language and the compiler is not going to save your bacon, you have to do it yourself. The net effect of doing all these good things actually has the side-effect of making you into a much better programmer too, which is nice.
I reckon this makes Python a perfect language to learn if you can already program. It forces you to think very hard about the craft of programming if you want to turn out good code in good time. I think Python is a bit frustrating as a first language because you don't know the rules and some of them are a bit arbitrary, but it is definitely something that every programmer should have a go at.