Shawn Driscoll's Tech Blog


Stuff That Happened in the Past

Saturday, April 28, 2012

How to Write Bug-Free Code in Python

It's just a few days that I've been learning Python programming. And already, I've learned how to write bug-free code.

I'm joking.

And yes, I'm reading about Python's error trapping at this moment.

For those of you old enough to have programmed in the early '70s, programming in Python after having programmed in C++ is like programming in BASIC after having programmed in FORTRAN. At least it is for me.

Python is so much easier to read than C++. And it's quicker to write programs with. Everything KISSable that I learned from in the '70s, Python's creator learned from also. And it shows in Python. Python is a minimalist's dream. Everything in it has a purpose. A function. And there is a form to it all. Python has a style that no other programming language comes close to in elegant power. It's very easy on the eyes. And stimulating to the mind. Typing Python code is a luxury. It's like enjoying a scenic drive on the best designed roads.

Languages like C++ remind me of programmers that like using a spoon to dig a hole, so they can keep track of every grain of sand. But Python doesn't care about digging holes, or about the sand.

Complex C++ applications can be ported easily to Python, yet porting complex Python applications to C++ can be a real nightmare.

No comments:

Post a Comment