Friday, 22 July 2011

Pyglet on Windows 2000. Yes, you can!

So, you're a "pythonist", right? And you get tired of pygame, right? And you want to play with pyglet but it doesn't work beacuse there's an error with GDI+?
Relax, man! I'll explain you how to resolve ;)
  1. go to MSDN site and download the GDI+ packages
  2. Decompress it on a directory. It's not important wich one: we have to get the gdiplus.dll file
  3. Copy gdiplus.dll from /asms\10\msft\windows\gdiplus
  4. Paste it on your python directory. I have it on C:\python26.

It's all! Happy coding!

Wednesday, 13 July 2011

«From Python to Ruby» aka «Yet Another Infamous Comparison»!

In these days I'm interesting about Ruby and Ruby On Rails. I already know PHP and Python, but Ruby seems more active, widespread and interesting. For "interesting" I mean PHP still appears to me as a easier Java without compilation and classpath. Some friends of mine use Symphony, but I am not so enthusiastic about it. I like Python's abstraction level, but I admit it has too many web frameworks and none of them seem "cool" enough.
Rails, instead, uses an high level language (Ruby) and creates a homogeneous, well designed and complete environment for web application development.
These are my first impressions: maybe I am wrong.

This post is written for another religion war: Python vs Ruby. I belive it's a war without sense and I think it's usefull learning both.

Always learn at least one scripting language

It's fundamental to learn at least one scripting language. It could be lisp, javascript, python, ruby, perl, ecc. But it must read/write files, opens sockets and do everything a real language must do. It will help you to write some usefull scripts (e.g. create and populate a database from text files, download and save XML from network to local disk, ecc.)
Will learn more than a language will help me? yes! Because...

...you must use the more confortable tool...

...for a specific task. C and C++ are usefull for real-time applications and for videogames. They're not very good to write CGI or web applications. Java is good on servers, but I think isn't good for heavyweight audio manipulations.
I found myself comfortable with Python in many cases, but it is very likely I will use Ruby more often. Remember: the silver bullet is an anti-pattern. Learning more languages will give you more instruments to work better and faster. In programming there's not a Holy Grail, just the right tool in the right place.

Tuesday, 5 July 2011

iPhone SDK Troubles: a missing feature in XCode 4

XCode4.0.2 hasn't got a "Search and Replace in Selection" tool. It's one of most important tools for some very boring tasks, such as adding a @synthesize to hundred of lines or using the same lines to initialize them with a [[NSString alloc] init];
I hope Apple soon adds it: I wouldn't to continue switching between XCode and VIM to replace some text!

Tuesday, 28 June 2011

Eclipse vs Netbeans

Oh yes... another (in)famous deathmatch between two developers tools. Eclipse is supported by IBM and uses a custom library to give an GUI, the famous Standard Widget Toolkit (SWT). Netbeans is based on Swing and is sponsored by Oracle.
Two years ago I switched from Eclipse to Netbeans, just for Netbeans' GUI editor (Metisse), a program I waited for long.
Soon, I discovered some things I liked of Netbeas:

  1. An easy way to install plugins
  2. A powerful refractor tool

Despite it's written using Swing, Netbeans works well. I still have doubts on developing applications using Swing, but Netbeans demonstrates it's possible. It's well integrated with desktop (Mac OS X, Windows 2000 and Ubuntu).

BUT (and it's a recent news), Eclipse Foundation releases a new version of its IDE, Indigo. Indigo has very interesting features, and seems it's going to be very near to Netbeans.
I'll examine it better next days. I'm very curious about it.
Meanwhile, I continue using Netbeans, because I'm used to work with it and because (as I learned some weeks ago), it's better to wait a bit before start using a new major version.