Tuesday 28 July 2009

These little annoying and surprising things...

...concerning Python as language of "very clear syntax which emphasizes code readability" (Wikipedia):

A = Annoying == Anti-Python

1. The naming conventions of...:

a) ...package-files/magic members: __init__.py, def __del__, __name__
b) ...visibility modifiers: _protected and __private

So _ and __ in general. Really, why did Guido do this? Is there an explanation? Perhaps it's inherited from another language?

2. The verbose...:

a) ...object inheritance declaration of each class: class Standard(object)
b) ..."self"-reference of each class-value/-constructor/-function just to indicate that it's non-static: def compute(self, number), self.Radius, def __init__(self)


(3. Multiple inheritance: It's no coincidence that most languages don't support multiple inheritance. Normally, you don't need it and it is a trap which makes debugging almost impossible. It is definitely not a feature for a language which emphasizes code readability and clear syntax.)




S = Surprising


(Powerful ability to handle and process strings in general.)

1. Lambda/Annonymous functions: (lambda x, y : x + y)
2. Managed Attributes: property([fget[, fset[, fdel[, doc]]]])
3. Great modification abilities due to magic members/methods and type-emulation.
4. List comprehension, generator expressions and yield.
5. Function decorations. Java has this one too.
6. Localization module. It's neat and easy to localize your programs.
7. Parallel computing module!
8. Awesome network protocol capabilities.
9. Unit tests.
10. The best documantation I've ever seen.

Sunday 26 July 2009

Blagh

1. Blagh:
  • I read the Post "Crying" again and must say that Java is definitely my favourite programming language.
  • I totally lost every knowledge of Python which's a bad thing since I'll have to use it in a exam in a few months.
  • I got attached to Twitter. It's so convenient and you can watch it on the panel of my blog.
  • I read Russell's Introduction to Mathematical Philosophy. Very interesting.

2. Pathfinder:

I had to write a small Java program that implements Dijkstra's shortest path algorithm in order to find the shortest path between two cities. You can download the source code here. You can add nodes and edges to the data.txt and the user interface is console-based.


3. Imageboardsave:

Currently, I'm writing a program which downloads every image and Rapidshare URL in a thread of an imageboard. The program works for AnonIB at the moment and the user can specify how many pages he want to search. The program scans the page for threads and download the content to:

/threadID/picturefilename.something


and the Rapidshare-URLs to:

/threadID/rapidshare.txt


Subthreads, i.e. more than a one-page thread, are considered as well. It even has a graphical user interface programmed in Java Swing. Actually, it runs pretty good right now, but I don't want to release it yet.