Blog

Author Archive

Python: It’s Programming Weaknesses

Posted on: February 1st, 2012 by stephenbroeker No Comments

In my last post, I presented Python and it’s strengths. To be fair, I’d like to continue and share my thoughts about some its weaknesses.

Python’s Weaknesses

1. Documentation Revisited

Python programs are poorly documented. On of the goals of Python is that the code should be self-documenting; programs are thus written in such a way that you don’t need comments.  This is a wonderful little theory that doesn’t work so well in the  real world. For anyone who has had to scroll through code, good luck trying to understand it. A little judicious documentation goes a long way in explaining algorithms and finding bugs.

2. Where’s The White Space?

Another Python standard that is white space is discouraged. This results in code that is extremely difficult to read. I understand the goal is to limit the size of each function to one page but extremes are dangerous and I would like to see a compromise of limiting the size and function and including proper comments. In fact the whole point of Sphinx is to convert code comments to code documentation. Sphinx can’t work unless there’s code comments.

3. Debugging

I have noticed that a lot of Python code is defensive. By that I mean the code assumes correctness and that any bugs will be easy to find at run time. Again this is another wonderful little theory that doesn’t work out so well in the real world. A lot of bugs are a result of data structure corruption; the quicker code can detect this corruption the easier it is to find and fix bugs. Exceptions are standard Python feature and are great. Asserts are another feature that is unfortunately not commonly used. Asserts should be used for assumptions that should “never” happen. They are in essence self documenting and help greatly in error detection and debugging.

4. Performance

Because it is an interpreter Python will obviously be slower than compiled code. But Python is implemented in C and it creates “compiled” .pyc files. The performance will not match programming languages like C.

For those Python experts out there, what weaknesses have you experienced? I invite you to share your thoughts about my analysis.

 

Python: It’s Programming Strengths

Posted on: January 21st, 2012 by stephenbroeker 1 Comment

Python is a relatively new programming language. It can be thought of an extension of Perl. Essentially Python is an interpreter. In my current position as a Cloud Architect at Internap, I have been exclusively using it on the OpenStack project.

Though I am not an expert in Python (been using it for less than a year), I am an accomplished programmer in other languages like C. With this experience I bring a different viewpoint to the Python discussion. As a Python newbie, I understand that it has a different perspective than C. I am not opposed to change. I am not stuck in the past. I embrace the rapid progress in the computer engineering community.

Python seems to be the new hot kid on the block, and here’s my opinion about it’s strengths:

Python’s Strengths

1. Interpreter

It’s an interpreter; you don’t have to pre-compile your program. It is thus interactive.   So in theory, a Python program that works on a given system should work on any other system.

2. Open Source & Python

A lot of newer Open Source code is written in Python. By that I mean it is in wide use. Thus the engineering community is focused on its use. This should result in Python becoming refined over time.

3. Do You Have Standards?

There is a serious effort put into standardization. Excellent examples are Pep8 and Pylint.

4. Documentation

There’s a wonderful document generator called Sphinx that is similar to Doxygen. I am a big fan of using Doxygen in my C programs. The basic idea of Sphinx is that the program comments should be good enough to generate proper design documents.  This means Python functions need to have comments (surrounded by “””).  Such comments are in fact required by pylint.

5. Data Types

It supports high level data types like lists, dictionaries, and tuples. This makes it much easier to design data structures.

For those Python experts out there, what strengths have you experienced? I invite you to share your thoughts about my analysis.

Thanks for checking out my blog

Posted on: November 30th, 2011 by stephenbroeker No Comments

If you are interested in Cloud Computing, or OLAP for streaming data, then drop me a line. Especially if you are seeking research assistance in these – or related areas.

If you are interested in bees, making honey, specialty beers, extraordinary cuisine, or roses, then drop me a line on any of these topics.

I also like football and archery, but not as a combination. You might be able to provoke a discussion with me on these topics if your strong opinions are supported by extensive knowledge, critical thinking skills, and civility brought about by self-directed maturity.