Reflections on software development

Very python oriented, keeping an eye on the rest of the world though :-)

Anti-pattern overdose and bad smells

Posted by goofy4u on March 9, 2006

Today I was doing some occasional code reading.  In fact it was a colleague that let me read some source code he stumbled upon.  We never saw so many anti-patterns in one code read session : magic numbers, middle man, spaghetti code, very long functions with huge switch statements, code duplication, it was all there.  I was wondering what to do with this discovery : go to the author of this marvelous piece of code and explain our objections or refactor the code ourselves?  The former options seemed attractive but after reflecting a while I chose not to bother because, after all, the code worked and management does not care about clean, maintainable and optimized code.  So my colleague decided to refactor it himself…  I decided to do some research and write a tutorial, both for beginners and advanced programmers on how to properly design and write clean code using design patterns and be aware of bad smells in code…  The only problem remaining then will be on how to motivate people to put the theory into practice.  To be continued…

Posted in Anti-pattern, C++, Design Patterns, Source code | Leave a Comment »

Pragmatic C++ writing

Posted by goofy4u on February 25, 2006

Sometimes I see C++ code that does what it should do, but in a way that needs a big looking glass, a lot of patience and many hours of descrambling 😉  Why do some programmers tend to make things more difficult than they in fact are?  Imho it all comes down to one thing : showing off.  Programmers, software developers, whatever you call us, we are famous for a certain disease called ego tripping.  I try not to myself, but many times I find myself writing some code that is too complicated, very over the top.

We all should strive for a more pragmatic way of writing code.   I will post some pragmatic programming related reflections on my C++ page from time to time…

Posted in C++ | 4 Comments »

Looking for a python IDE with user interface creation support

Posted by goofy4u on February 25, 2006

Currently my quest for python RAD tools halted on a couple of tools. I’m trying them out for the moment. The following tools seem to be promising and quite user friendly. Stani’s Python Editor is currently my favorite tool on my windows XP laptop. When used in combination with the wxGlade GUI designer you can build something very fast.

There is one small detail that every IDE I stumbled upon so far lacks. It is not possible to change the editor. For people like me who are used to work (on a daily base) with the ubiquitous editor Vim, this is a real p**n in the *ss. The ubiquitous Vim seems not to be so omnipresent when it comes to python editing. Of course Vim has builtin support for python syntax colouring, but then again… No class view, function lists (besides the ctags), nothing python specific, no python shell integrated into Vim.

Lightning struck when I found Pida. Finally a python ide that uses Vim as it editor and has a builtin shell, file browser and a lot more, even builtin gtk support. The latter is also the problem – gtk is not cross platform (not like wxWindows). Also Pida itself does not exist in a windows version. So on my linux distro I use Pida combined with wxGlade for RAD.

An alternative is the famous Boa constructor IDE, which both works on windows and linux. However, this boa does not come with Vim integrated either…

To be continued…

Posted in Python IDE | Leave a Comment »