Ir al contenido principal

Ralsina.Me — El sitio web de Roberto Alsina

Publicaciones sobre python (publicaciones antiguas, página 38)

Lessons learned in a month of hobby programming

A lit­tle over a month ago, on Ju­ly 15th, I opened a Google Code project called uRSSus. Here's the com­mit. My goal was to try build­ing a desk­top ap­pli­ca­tion like if I were build­ing a web ap­pli­ca­tion, us­ing a OR­M, tem­plat­ing, gener­ic views, and oth­er things.

The first thing I learned is that it was more fun to just write the ap­pli­ca­tion and see it grow than spend­ing time writ­ing the frame­work need­ed to do what I want­ed, so I just kept the OR­M, and the rest is pret­ty tra­di­tion­al code.

The sec­ond thing I learned is that for a hob­by­ist pro­gram­mer, this is a gold­en age. I am not ex­act­ly an awe­some pro­gram­mer my­self, and with to­day´s tool­s, I could al­most wish my app in­to ex­is­tence. When I start­ed pro­gram­ming on a PC, I had to swap flop­pies to change from the IDE to the com­pil­er [1]. And if I made a mis­take, the com­put­er crashed. No, not the pro­gram. The com­put­er crashed.

Now? I get a pret­ty di­alog, a link to the po­si­tion, a stack dump, etc, etc, etc. Not miss­ing the old days at al­l.

An­oth­er way this is a gold­en age is that there is a lot of code out there. I lit­er­al­ly had to learn my code from book­s. I first "got" C by read­ing the help for a pi­rat­ed copy of Au­todesk An­i­ma­tor's POCO ex­ten­sion lan­guage. There were no col­lec­tions of code I could look at and learn. There were not even any large li­braries of code I could legal­ly use!

And that´s an­oth­er rea­son why this is a gold­en age: Open Source and Free Soft­ware. You re­al­ly can be a pro­gram­mer just by will­ing it and ef­fort. You will not lack tool­s, you will find users (if you are good), you will find helpers (if you are luck­y), you will find free in­fra­struc­ture (svn re­pos, free wik­is, free file host­ing, free ev­ery­thing), you will find li­braries you can use!.

The third thing I learned is that Python does come with bat­ter­ies in­clud­ed. Many things that would be an­noy­ing ef­fort in oth­er lan­guages are just there, ready to be used. Add the in­ter­net, and it´s a Mr. Fu­sion in­stead of a bat­tery.

The ap­pli­ca­tion I de­vel­oped is a News ag­gre­ga­tor and thanks to Mark Pil­grim I had Feed Pars­er and thanks to Troll Tech (Now Noki­a) I had Qt for the UI, and many many oth­er things. I could fo­cus on ap­pli­ca­tion log­ic, not on pars­ing and draw­ing.

The fourth thing I learned is that a month is a long time when you have pro­duc­tive tool­s. Urssus (that's my ap­pli­ca­tion) was func­tion­al (but aw­ful) in a day or two. It was not aw­ful in 2 week­s. It was pret­ty good in 3.In a mon­th? Down­load it and see for your­self, I like it, the SVN ver­sion is much bet­ter most of the time, try re­vi­sion 619 ;-)

The fifth thing I learned is that Python per­for­mance is good enough. I don´t see much per­for­mance dif­fer­ence be­tween uRSSus and, say, Akre­ga­tor, which is C++, ex­cept on places which are ob­vi­ous­ly bro­ken. Sure, the data­base is C, the UI tool­kit is C++... they are all black box­es to me here. I code Python. My pieces do well.

The last thing I learned is that I can still code free soft­ware. I had not writ­ten a use­ful/us­able large free soft­ware ap­pli­ca­tion in per­haps 8 years. I am 36.9 years old... ex­cuse me if I feel mid­dle-aged, sur­round­ed by young­sters which are faster, more ded­i­cat­ed and ac­tu­al­ly have free time.

Be­cause of the pro­duc­tiv­i­ty of the tool­s, I man­aged to code just a cou­ple of hours a day for the first week­s, and progress was still good, so I did­n´t get dis­cour­aged, which is the worst en­e­my of free soft­ware.

It has been a fun ex­per­i­men­t, hope­ful­ly it will be a fun on­go­ing hob­by.

uRSSus: is that an icon in your pocket?

Yes, some­times I think a fea­ture is much hard­er than it re­al­ly is.

urssus21

So, since re­vi­sion 571, ev­ery once in a while a new fav­i­con will ap­pear in your feed tree when you use uRSSus. No, they won't all ap­pear at once. They will ap­pear when­ev­er:

  1. You ac­­tu­al­­ly fetched new posts from a feed

  2. You restart the app

Once they ap­pear they will nev­er change, ei­ther.

urssus at 27 days old

Af­ter 27 days of de­vel­op­men­t, uRSSus is fi­nal­ly a re­al­ly us­able ap­p. I miss noth­ing from Akre­ga­tor, al­though there are a few unim­ple­ment­ed things. It was bro­ken the alst cou­ple of days, be­cause I was rewrit­ing large chunks of its gut­s, but the new guts work much bet­ter ;-)

The miss­ing pieces (I know about):

  • Fav­i­­cons

  • Save col­umn width in post list

  • Show to­­tal posts in feed list

  • Drag&­­Drop is not re­li­able (weird things hap­pen ev­ery few tries)

  • Metafeeds (ex. your un­read post­s/ your starred post­s) are not up­­­dat­ed au­­to­­mat­i­­cal­­ly

  • Del.i­­cio.us sync is not work­ing at all

  • No help

  • No de­­cent con­­fig di­a­log (but a func­­tion­al re­­place­­men­t!)

  • Very oc­­ca­­sion­al DB lock­­ing.

  • Log­ging is bro­ken

  • Need to im­­ple­­ment back­­up of the DB

That's not re­al­ly more than a day or two of work.

Right now (re­vi­sion 570) it's work­ing pret­ty good, so it's a good re­vi­sion to try, if you feel up to it.

Urssus goes meta!

I have been de­lay­ing this func­tion­al­i­ty be­cause I ex­pect­ed it to be hard to do, then... it was very easy! Now you can cre­ate "metafeed­s" based on queries. Here's the first ex­am­ple: "Post.im­por­tan­t==True".

urssus20

Of course, be­yond a set of stan­dard metafeed­s, a UI to al­low the us­er to cre­ate them will be hard but at least the ba­sic func­tion­al­i­ty is there (BTW, it's 15 (fif­teen!) lines of code)


Contents © 2000-2023 Roberto Alsina