OOP is different in each programming language. Some languages like Python and C# don’t offer all the OOP features that you can get from C++.
Python doesn’t really support traditional access modifiers, and C# doesn’t offer true multiple inheritance (you can inherit from one class and multiple interfaces).
While C++ offers the most OOP features of the three languages, it has some disadvantages. If you compare C++ to modern languages like Python, Ruby or C#, C++ starts to show it’s age. Further more, given a small application, it’s usually much faster to write it in Python than in any C language.
The question ultimately becomes, are all the OOP features in C++ really needed in every day development? For small projects, most likely, no. For large projects with a team of developers, maybe.
I’ve updated the backupdir script. It’s much more robust, and I converted all the strings to use the same quoting style. You can download a copy from here.
Python methods (functions that are part of a class) have a special explicit parameter called self. Through self, methods can access class members (without a self parameter, the method is static (no access to instance variables)).
In most C languages, the “self” parameter is hidden (an implicit parameter), and is usually accessible through a reserved word (e.g this is C++ and C#).
Which is better? Python’s upfront approach is nice for beginners, but for experienced programmers, it creates some extra work.
I just installed the WordPress app for my iPod Touch. It looks great so far. It seems to automatically detects if you have SSL available, and, if you do, it will send all requests over SSL.
All of the OS software that I’ve built to date has had one developer working on it, me. I’m writing the software so that I can use it, therefore, I know what I need to develop. I usually rough out a design in XMind, which is a open source “mind mapping” tool. XMind’s default mapping style is like a bullet list after a few years in major league baseball (read on steroids).
As I rough out a design, I usually discover things along the way, like I forgot a DB table, the way I was planning to implement something isn’t practical, what APIs I might be using, which language would be the best suited to the task, etc. If I notice task that might be really technically difficult, I might write a proof of concept, to prove that it’s reasonable (meaning that it won’t take a lot longer than planned) to complete the task.
Here’s the basic design for pygcp:
Read more…
If you come across a Python module that doesn’t have a Windows installer package available for it, and it’s packaged with distutils (almost every module is), you can make one by running:
setup.py bdist_wininst
If you look in the dist folder, you’ll find a nice Windows installer for the module. More information on distutils can be found here.
I compiled some of the modules that I use, that don’t offer a binary package for Win32 Py2.6. You can download them from here.
Compiling mysql-python shouldn’t have been too complicated, since distutils automates the compilation process, but there were two minor issues.
This particular module needed the /MANIFEST linker option, and the windows setup script didn’t work properly.
After fixing both of those problems, I present the compiled binaries (MySQL-python-1.2.3c1.win32-py2.6.exe (191)), and the fixed setup_windows.py (mysql-python-setup_windows.py (198)), if you want to compile mysql-python yourself.
Loops are another “flow control” tool, like an if statement. Loops allow you to repeat the same piece of code multiple times, which can be very useful when you are processing data.
There are two types of loops in Python, the for loop, and the while loop. The for loop is one of the easiest ways to process data. Let’s take a look:
Read more…
The documentation for setting up a web server for RoR (Ruby on Rails) on Windows is really lacking. Figuring out what server software you’re supposed to use is probably the hardest part. Should you use Apache or IIS as the web server? How are you going to connect it to Ruby? CGI, FastCGI, fcgid, Mongrel, mod_ruby, passenger (aka mod_rails / mod_rack) or WEBrick (not recommended for production use)?
If you pick a combination that doesn’t work properly on Windows, you can spend hours (as I did with mod_fcgid) trying to figure it out.
The solution that worked for me was setting up Mongrel (which is a Ruby web server) as a service, and using Apache to proxy Ruby requests to Mongrel.
Here’s a step by step tutorial:
Read more…
I spent a really long time (8+ hours) setting up an open source project tracker called InDefero. I was also trying to setup Git at the same time, but that’s something for another post.
InDefero has no install wizard (one is in the works though), so all the configuration is manual. Installing the DB tables requires you to run a PHP CLI script. Everything was going smoothly until I tried to install the tables. The script exited with no output every time I ran it.
I tried to debug the script with echo statements, and traced to issue to a require statement that was causing execution to stop. After tinkering with several of the scripts, including the script in the require statement (the config file), and still having the install script fail, the thought occurred to me, why am I not getting any debug info from PHP?
Since the php.ini I was using was setup for production, display_errors was off. After turning it on with a CLI switch, I got a debug message. My config file was messed up. After going to the indicated line, I realized what happened.
Read more…