Entries by year
Entries by month
Sun Mon Tue Wed Thu Fri Sat
Powered by Blosxom
Creative Commons License

The learning process

In this post I present some thoughts about the way people around me and myself learn new things. Specifically, how to go about learning new programming languages from the perspective of an experienced programmer.

The boring introduction

When I was learning to program computers for my own entertainment I did it because there where things I wanted to accomplish with the computer. It was fun to do it and I was eager to learn how to do it and experiment with it, but in order to learn I always tried to do something “real”. Later on in school I took a subject on computer programming and there I learned a new language (Pascal was the language of choice at the time) and, of course, I had assignments to do. Now both my own goals and the assignments where very helpful because they made me focus on experimenting with the language rather than scatter my thought about what to do with it.

Especially at school, the method I was taught with was one which fit me very well: the teacher would dictate a section of the text-book to us (we didn’t actually own the text-books, the only material we had was the dictations he gave us). Then he would go over that section again, maybe on the next class, and explain things in detail, give examples, and so on. I had a notebook which I kept thoroughly organized, with the theory the teacher dictated and then examples, tips and tricks, notations on the side of it, next to the relevant bits, the works.

Then there where the class assignments, which where very helpful because, not only where they aimed towards being best accomplished with the parts we had just learned about, but they provided laser-sharp focus for thought. The fact of the matter is that I was lucky. While most kids where getting to grips with the notion of algorithmic solutions and language constructs I already had some notions of all that and I could take each assignment as a personal challenge: I had to find the best way to do it for whatever measure of “goodness” I chose. The “Best Way” could be the fastest, or it could be the one with less lines of code, or even the more “elegant” way. This last concept of “code elegance” actually caused not a few frowns from my colleagues who considered themselves lucky to have hammered together an answer in as little time as possible and then got on with playing ball or talking about clothes and hair… :-)

But anyway, I got to experiment with the language, a bit at a time, adding more bits as I learned them and experimenting with multiple solutions for a given problem, learning the best way to solve each issue and combine solutions in the process. I had all the time in the world to learn it and it counted as homework, not “fun and games” time. What a bonus!

Real life

Fast forward to this day, many years later, after having gone through a computer science course in university and a number of years on the field, not actually as a full-blown programmer, but mainly as a systems architect which also does quite a bit of programming.

Things are a bit different today. There are, of course, new languages springing up every so often and some of them are actually quite appealing. Now after a respectable number of years on the field I am much more able to grok a language by skimming through some discussions and explanations of it and talking with people who use it. Algorithms are the same in every language, data structures are more or less equivalent across them (yes, I know I’m generalizing like crazy, but if you take a high-enough view of things it tends to look like this) and in the end, taking into account the big “classes” of languages and their fundamental differences (which I won’t go into here) you are left with the choice of the best language for each specific task you want to tackle. Some make it easier to work with a given data structure you wish to use by providing better modeling for it, others provide the control structures you need to use and so on, but in the end, if you put enough effort into it you can solve most problems with almost any language you care to use.

How do you make a choice then? Well, it isn’t enough to just read the blurb, talk to some programmers and see a few “hello world” examples, you really have to know the language you are contemplating in order to ascertain if it is indeed better than the other ones. (Almost) all of them can do it, but one may be better. The problem is that being better is probably in the details so you really have to know your languages.

And then, of course, some people like to learn new languages just for the fun and challenge of it. Nothing wrong there, I find it very entertaining actually.

The problem then becomes how you can go about learning new languages, with the limited time you have at your disposal, and with the tools you already have installed in your brain.

I found that myself, and people I know, usually take one of the following approaches:

By the book

People like Melo take the “read the book on it” approach (link to the post about reading the Ruby book).

This method assumes you can actually read through a book on a new language and probably without writing a line of code (remember the time constrain), be able to get all the relevant information into your brain. I couldn’t do this when I was younger and I certainly cannot do it now, if I don’t experiment with it somewhat it just doesn’t stick.

On the other hand, assuming you get a good book, this way you get the most important facts and techniques on the new language and you can map your mental tools, best known algorithms, tricks and so on onto the new language and also get a structured and correct insight into the right way to do things with it.

You’ll end up using the language more efficiently and making things work with the least effort.

Just do it

Other people, like Rui Carmo take the “tackle a real project with it and enlightenment will come your way” approach.

The typical hands-on approach, where you sit down with a task or assignment, some tutorials, examples and/or cookbooks for the specific language and just start trying to write the code you want in it.

Things you learn this way tend to stick better in your brain (in my case at least) and the difficulties you encounter trying to map your mental tools into the language and the way you solve those problems will give you a good insight into the language’s capabilities. Of course I’m talking about a non-trivial and especially interesting assignment. For all the tradition they carry around, “Hello Worlds!” are rather useless as a learning experience in any language you care to think of.

On the other hand, this way you may (and usually do) and up trying to coax your way of doing things into a language which may have other, more efficient ways of doing them. It is not that rarely that I find a piece of code on a language I know very well, which is behaving or performing badly. Upon examination of the code, I can immediately tell which language the programmer that wrote it used to work on. After that it is usually a matter of minutes the re-writing of the offending piece of code to make it work better/faster/whatever. Clearly the programmer might have been a good programmer on the other language and even a good programmer “per-se”, but not knowing the language in enough depth made his code sub-optimal, even if it did work.

The rhyme and the reason

So properly learning a new language is rather important if you’re ever going to use it, but learning it properly takes time and effort and not everyone can afford to spend that time. What is the best way to do it then?

Personally I like the book approach a lot, because someone who already knows the programming concepts can get the right idea about their implementation on the specific language and can then be more effective when writing code in it. You just do things right the first time instead of battling with the language to make it do what you want in what can turn out to be the wrong way to go about it in that specific language.

But then, given the shortage of time people (and me in particular) have to devote to these things, spending the time reading about rather than doing it is rather painful and, of course, geeks love to play with things hands-on don’t they? I mean, learning what was inside the radio was interesting, but not half as interesting as actually opening it up and seeing for yourself. Even if there where some pieces left over after re-assembling it… :-)

Gone are the days when I was a good boy for working so hard on my homework assignments and was spoon-fed with the language facts at school, while left with enough time to play around with it afterwards, so I guess the mixed approach is the way to go now: find a good introductory book on the new language, find out the interesting chapters in it and read them with care (typically a good introductory book will explain how you work with general structures and how you implement some basic algorithms you already know, while giving some light insight into the inner workings of the language and why this way of doing things works best). Then choose a project (your assignment) and go for it using the new language. If you can get a “cook book” for the language it is really helpful because you will then learn about different ways of solving each problem you have to solve and why one way is better than the other for a given situation (assuming, once again a good “cook-book”).

This way you get the benefit of the “lecture” from the text-book and follow it with some useful hands-on experience. And the key here is useful, because if you just try and follow the introductory book’s assignments you end up ditching them because of lack of time and never actually get around to using the language properly and getting to know it better.

Anyone has some thoughts or tips on this topic?

Note: This has been sitting in my laptop waiting to be finished for quite some time now. Fortunately I was able to find the time during my vacation to write some more, but I still think the overall post is a bit confusing. But then, I don’t want it to just sit here and rot so I’ll just post it and get it over with. Hey, I’m on vacation, just relax! ;-)

Technorati Tags:

About this entry

Originally written on Jun 30, 2005 @ 23:09
Read article on it's own page (permalink)

The whole desktop video editing scene

Phew! What a ride I’ve been on since late last week!

After struggling to get something done on Flickr-Tools late last week I’ve then had a rather full weekend. First, on saturday, there was the wedding of one of my brothers-in-law, then there was the show we put on for the end of the dance-school year (32 years old and I’m doing this kind of stuff… And I’m in the lowest half of participants, age-wise). After the show I went back to the wedding so the day was a rush. Then on sunday there was a second running of the show… Busy, busy, busy!

But I digress, the main point of this post is to talk about my experiences with desktop video editing. So anyway, I’ve been flirting with this particular media format for a while now, but never got around to doing anything tangible on the actual video front and kept myself pretty much to slide-show type stuff (for a very loose definition of slideshow that is). So following the advice of people who know their stuff (even if the advice was given for a slightly different field but hey, good practices are universal anyway) I’ve decided that this weekend’s shows were the perfect opportunity to get myself some hands-on experience in the area by means of an assignment. So I just took my parents’ miniDV camera with me to the backstage and told everyone I’d make a DVD of the whole event for them (committing to yourself is just fine, but it helps to commit to others also) ;-). Now I’ve had my father record the show itself on saturday, another person recorded the whole event (our show and all the others) on sunday and then I shot my own footage backstage.

So now I had footage of the show itself (two instances of our own show and one of the whole event), some 20 minutes of footage of our group, a few pictures taken saturday on the backstage and some other pictures taken a while ago on our last exam. Sounded good so I decided to go with that.

People who know me and/or follow this weblog know I’m a Mac user for some time so, naturally, I decided to use iLife tools for this particular job. I didn’t want to go with fancy stuff and it’s steeper learning curve so I opted for the basics —iPhoto, iMovie, iTunes and iDVD. Oh, and I also had to use Garage Band for a little sound editing. It was way overkill for what I wanted, but it was just sitting there and I had never used it, so it sounded like a good opportunity to just fire it up and see if I would be able to use it for the first time and get it over with in under 5 minutes. It’s Apple software. So I was.

The experience was a pretty good one. Even using nothing but what comes pre-installed on a new Mac I achieved some pretty amazing results (given the time, effort and talent available, of course). So following are some thoughts, notes and just general ideas about using the iLife suite to create a truly home-video style DVD. This information will eventually be ported to the wiki, but since I want to revamp it in a major way it just sits here in the weblog until I come for it.

And now, without further ado and in no particular order, some notes and thoughts on iLife ‘04-based desktop video editing:

  • iMovie is quite limited in it’s raw video editing capabilities. This is a good thing for people like me who have lots of crazy ideas and absolutely no experience whatsoever with this kind of media. It keeps me in check and lets me get things done in a “good way” instead of letting me get bogged down in menus and buttons trying to make it the “perfect way”. The “good way” turns out to be pretty good almost all of the time, actually.
  • iDVD is very limited in what it lets you do to the structure and menus of a DVD. This is not so hot. I know the DVD itself has a lot of stupid limitations, but there are tools out there which allow for a lot more flexibility than iDVD. Still, it gets the job done, for the most part, even if you have to nudge, push and kick it in the right direction over and over again sometimes…
  • In iMovie, when you cut out a piece of a clip whose speed has been altered, take the remaining piece back to it’s normal speed and then back again to the faster/slower speed or else iMovie won’t take the piece out of the sequence and weird things happen.
  • Why oh why can’t I make a theme (and I mean a full theme, not an adaptation that I then save as a favorite) in iDVD? Huh? Why can’t I see or edit the grid position for items on menus? And why can’t I assign the browsing order to the items on the grid? Whyyyyyyyy?
  • iMovie will crash on you when you’ve been at it for a number of hours. Even with a good CPU, plenty of RAM and so on, if you’ve messed with your clips until they cannot be recognized, you edited the hell out of them, you’ve cut, pasted, undid it, did it all over again, synced audio, un-synced it, messed with it’s volume, added pictures, changed clip speeds and all that jazz then you should really just save your work, close iMovie and open it up again. It’s only happened to me once, but I lost maybe one and a half hours of work and it took me another 45 minutes or so to get it back (it was easier, of course, because the decisions where already made, I just hat to do it again).
  • Re-doing your work for whatever reason (yeah, even because of software crashes) does have it’s advantages. Things really turn out better the second time around. The morale tends to slip a bit, but in the end your work is a little bit better. Of course after you’ve done this a million times and you are already really hard-core with the software this will probably just get annoying to death, but then you won’t be using these apps anymore, now will you?
  • In iDVD’s menus just KISS. iDVD has it’s own structure of menus and menu grids (which are very helpfully hidden by the way) and it will make a royal mess of things if you just give up on it’s (often idiotic) automatic placements of items and try to go the “manual placement” way. Just either use it’s default themes and find one which has a good placement matrix or, if you really must go with a “customized” theme (as I had to because I am one of those persons) make the menus as simple, nay, spartan as you possibly can and then keep insisting on the proper location of the items each time you visit that particular page. You will not get the items exactly where you want them, oh no, but eventually they do settle in a place which is “good enough” and it’s 5 in the morning and you have to get up for work early and suddenly it just looks OK. Seriously, this is major, major hassle and the one case where the apps’ “good enough” is far from good actually.
  • Do try out the DVD in a living room DVD-player before committing to more copies of the DVD or to declare the project “done”. The DVD player in Mac OS X is very forgiving as regards to actual viewable screen-size. Living-room DVD players are not. Also, the “show TV safe area”, while helpful as a general guideline, errs on the side of caution. If limits where like it shows you you’d have no room in the TV to view your movie. I aim for the middle ground and it seems to work out pretty well.
  • Given enough media with good (DV or somesuch) quality, encoding the assets will take time. Plenty of it. Get ready for it.
  • iMovie uses a kind of “movie” file which is miniscule but seems to be (and as you may be able to tell, I am definitely not an expert here) essentially a collection of indexes and pointers to other media files. Quicktime and all of it’s derivatives can play this file as if it where a single movie, which is rather cool. Now for the not so cool part: when you “export to iDVD” from within iMovie, what it will do is create a folder called “Shared Movies” on the project’s folder and, inside it, another one called iDVD. Therein it will create one of those tiny “movie” files pointing to the movie you are currently editing. This is cool because every change you make to your movie is immediately reflected on the movie you see in iDVD. Now even if you don’t export to anything, iMovie will also create a similar file on the project’s root folder. Same name, same content. What sometimes happens is that the root folder’s version of the “index” movie will get updated but the one on the “Shared Movies” folder will not. Not fun. Not at all! Of course, just copying the file over solves the issue, but most certainly defeats the purpose of the whole system…
  • When you throw media inside your DVD just throw it with the highest possible quality. Worry about available space later because iDVD seems to be perfectly able to manage the DVD’s space and compress accordingly if you use the right setting (encode for top quality instead of encoding for speed). This is, obviously bound to some common sense, the medium does has a fixed size limit.
  • It is possible to have a movie with chapters et al in a folder (not on the main page). Just create the movie in iMovie (or whatever) and then import it (in the case o iMovie import the tiny “movie” file) into the menu you want it to be on. iDVD will create two links for you: one with the movie itlsef and another to a folder with the links to the chapters.
  • It appears that you cannot create new pages for the chapters links in iDVD. So if you import a movie with, say, 10 chapters and iDVD makes them fit on two pages, should you want to have more pages with fewer chapter links in them you’re basically out of luck. I just cannot beleive that this could be possible, but the truth is that I did not find a way to add an extra page (and make it be linked with the “next” “previous” arrows) anywhere. If you can do away with the arrows then you can create folders and just cut and paste the chapter links, but you loose the arrows. Also you cannot create links to the chapters yourself, should you delete a link you’ve lost it for good. These items are just so dumb that I’m praying that someone will tell me what an idiot I am that I didn’t figure out that the way to do it is this and that. I can only hope…

These are some of the main points I gathered from three nights of precious little sleep but much fun editing my footage. Take everything I said above with a very large grain of salt. I usually know what I want to achieve before trying to materialize it and in this case I have no clue how to get there, so I just try to coax the software into doing what I want. Sometimes it works, sometimes it doesn’t. Other times I give up, let Apple take me by the hand and I’m pleasantly surprised. A few times (luckily very few of them) I just can’t do what I want and hit some twisted bug, misfeature or just a plain limitation of the software. When it is a bug or misfeature it is annoying but I can live with it. When it is a limitation, well, this programs are pretty basic stuff and the goal is for your granny to be able to use them, so it doesn’t bother me in the least. If I come to a point where I think I am able/want to take the heat I’ll step into the kitchen and get Final Cut or some-such. Until then I’m perfectly happy with my “basic consumer” stuff.

I may be adding things to the above list until I make a wiki page out of it. Or, then again, maybe not.

About this entry

Originally written on Jun 23, 2005 @ 00:59
Read article on it's own page (permalink)

New version of Flickr-Tools

Since I know I’ll be off-line and unable to do much development on the next few weeks, I’m trying to get as much features as I can in there right now, so even small enhancements like the ones I did today are going to be pushed out to CPAN as a new version.

Release early, release often, they say…

For version 0.02 I cleaned up some documentation bugs (yes, I do take some care with the documentation) and added a couple of methods which where no brainers to implement but I hadn’t had the time to put in there.

There is at least one other method which would be really useful (get the list of all the photosets a given photo belongs to) but I’m waiting to see if the good folks at the Flickr API developers team can give us that method so as not to force me to do a lot of API calls just for this one. I do hope they find the time, but with all the buzz surrounding the new auth specs proposal I’m not that confident they will. First things first, I guess…

Anyway, let’s see how much more I can do before going away on vacation at the end of next week.

Technorati Tags: , ,

About this entry

Originally written on Jun 17, 2005 @ 18:34
Read article on it's own page (permalink)

Flickr-Tools is up on CPAN

Well, that’s just it, Flickr-Tools is up on CPAN and should be made available any time now.

I’ve decided that I just can’t sit on it any longer. It is far from complete but I’ve just looked at a big thread on the Flickr developer’s mailing list with the promising title of “Big changes to the Flickr API” and which I’m guessing has something to do with the authentication methods or somesuch.

So, given that I’m rather pressed for time as of late (contrary to what I’d expected, sigh…) I’ll just post it as-is, limited and all, and start work on version 0.02 ASAP.

As it is, it already allows people to get information on persons, photos and photosets and to manipulate high-level…ish objects with this info.

With the modules structure I’ve put in place it is really easy to add support for more core API methods so now it is mostly a question of filling it up with what’s missing.

Oh and I have to read the thread carefully to see how the authentication stuff will be handled (if that is what the thread is really about).

Getting this out the door is basically a way to get some testing for free on other platforms and to give anyone out there curious enough about this a chance to see my main design ideas for this distribution, so suggestions are always welcome. Help in the form of code is also greatly appreciated, but I’m not holding my breath… ;-)

Technorati Tags: , ,

About this entry

Originally written on Jun 16, 2005 @ 17:55
Read article on it's own page (permalink)

The big weekend

Yesterday was a national holiday in Portugal and Monday will be a regional holiday in Lisbon, so this weekend is a whooping 4 day mini-vacation.

So yesterday I’ve spent most of the day working away on DVDLX. PHP really starts to suck after a certain level of complexity! I knew that already, but it is always bad when you have to go through it again. Still, I have no great choice in the matter at this point so it does no good to wallow in it…

Even busy as I was I caught a movie on TV, at dinner, and ended up watching it all the way through. The movie was Phone Booth (IMDB) and I’d never seen it before. What a great movie. Truly riveting!

So today it’s relaxing day and I’m going for a drive with Tuxa. Not sure where we’ll go, we’ll just get on the car, take out the map and decide.

About this entry

Originally written on Jun 11, 2005 @ 12:15
Read article on it's own page (permalink)


Flickr::Photo is good enough to go. Flickr::Person is also good enough to go. Flickr::Photoset is almost done. The underlying modules and classes are also OK for the first beta. Just a little bit more clean-up and I should be able to post it in a day or two. Thank goodness for that!

On a totally unrelated story, today something funny happened to me. For the first time I experienced something which made me laugh my head off: software update woke up, as usual, and noted that there was a new security update for panther (yes, I’m still using panther). Of course, being in the office with great connectivity I told it to install the update immediately. So a-fetching it went, until it got the update on the disk and started to do the actual installation. And then the “software update” program just died. It just bombed out! The software update program! It cracked me up! Now of course I have no idea whether the update actually got installed or not, but running the software update by hand tells me that there’s nothing new out there so it must be… Oh well, if we are going the Intel way we may as well start to act a bit more like Windows… :-)

So far I’ve been able to resist the temptation to go out and get myself a video camera to fool around with and make some stuff happen on iMovie and iDVD. Maybe I just need to borrow my parent’s camera for a few days and lug it around to make it forget about it once and for all. Then again maybe I’ll just get hooked but then I’ll now for sure I must get one. Oh well…

Oh and another tidbit: the batteries on the iPod do empty out! Just discovered that as I was leaving the office and the thing died on me. So no podcasts on the way home for me this time, just plain old radio. Which serves the important purpose of reminding me why I love my iPod so much while driving around!

Technorati Tags: ,

About this entry

Originally written on Jun 09, 2005 @ 17:17
Read article on it's own page (permalink)

And so it goes

This has been quite an interesting day…

First off I went for a swim at lunch break at the big pool (50m olympic-style).
Man it feels good to swim there. Glad to be in sufficient shape for it again. And I did get my 1000m time down by a few minutes in there, so not a bad run altogether.

Getting back to old, half-finished code is a pain! Even if I only left it for a few weeks. Anything unfinished will take me so long to get back into the swing of it again… Sheesh!

And Pedro (who was tracking the event) is rather hysterical about Apple’s announcement of leaving IBM and going with Intel in a year from now. But even in his state of agitation he still got the funniest part of it all. Oh the unfortunate things geeks say sometimes… :-)

And now gotta get home as my parents are coming by for dinner and my father is bringing the laptop and the DV camera for the first session of desktop video editing phun.

About this entry

Originally written on Jun 06, 2005 @ 19:50
Read article on it's own page (permalink)


I almost forgot about this: I’ve upgraded this weblog’s software. It is now running on Movable Type version 3.17 (upgraded from 3.15).

As a drop-in replacement upgrade everything should be just fine and dandy. But then we all know how this things tend to go so if you notice anything wrong with the weblog do let me know. Thanks!

About this entry

Originally written on Jun 06, 2005 @ 16:59
Read article on it's own page (permalink)

Catching up

My, my, I just turn my attention the other way for a bit and all of a sudden there’s a gap of more than 10 days in the weblog…

Well, I’ll just make a quick recap on how things are going, then. I have a feeling this can potentially turn into a rather long post so I’ll try to keep it short and to the point, in an itemized sort of way.

First off, the Perl Flickr API is just the same as it was when I last wrote about that. Some other stuff has gotten in the way. I do have a deadline I’d like to respect for it, since I’ll be going away on my summer vacation in a couple of weeks and I don’t expect to do much coding or to even have any sort of connectivity while away. So expect to have the first version up on CPAN by then, followed by a nice two weeks’ silence from me.

I’ve been a bit swamped at work which has bit into my personal time and has thrown me off the track with both the Flickr API project and all the stuff I have to get ready for DVDLX as well.

Other than that I’ve been listening to a lot of podcasts recently. I’ve discovered the TechPodcasts network and with it a lot of great podcasts to listen to. Thankfully this can be multitasked with doing other stuff, otherwise I’d just have no time to listen to all of it. So now I’m trying to reduce the number of podcasts I listen to from the huge number of potentially good ones I found there, but it takes time to listen to two or three shows from each source and then decide wether it is worth keeping or not.

One podcast which I did find out about (not from the TechPodcast network, though) is Tips From The Top Floor (RSS feed here). This show is just awesome! Everyday, simple tips for digital photographers. Not extra-advanced stuff, for sure, but just simple stuff which are incredibly useful and which I can use to be reminded of or learn about. It is also short enough to listen to on my commute which is a big plus. Kudus to Chris for a really excellent show.

Something else that got my already too thinly stretched attention is video blogging or vlogging as people sometimes call it. I’ve taken the easy way into this and just downloaded FireAnt and looked at some of the feeds that come in the default config. Now I don’t think I’ll get much into it since it does take up more time than blogs or podcasts, simply because you can’t multicast it (at least no so much as the other two), but there is definitely some interesting stuff going on there. Then again there is also a lot of trash, but that’s just the natural order of things, I guess…

And, speaking of video, my father want’s to get in on the desktop video-editing stuff. He has had a DV camera for a while now and shoots tape after tape of my nephew (as any self-respecting granddad should, of course) and being the intelligent person that he is, he knows no one is ever going to watch hours on end of Diogo sleeping, Diogo trying to eat his tows, Diogo crawling around, Diogo eating and so on and so forth. So he want’s to edit all that stuff and just make some cool DVDs with it. Since he and mom recently got a god laptop they now have all he needs to tackle it. Except for the software and the know-how.
Enter me, who has zero experience with video editing, trying to learn as much as I can about it (strictly beginner level, of course) in order to get dad up to speed and running with it on his own. Now the good thing about this is that I know that if it takes to it he’ll do a great job and we’ll have great family video stuff to watch from now on. The dark side of things being that I’ve always resisted entering the digital-video arena and now with all the studying and trying out of the tools I’ve got in order to help dad I hope I don’t get caught into yet another time sink.
Must resist the power of the dark-side, even if we both could run the family-video galaxy as father and son.

Which reminds me, I must go see episode III again!

About this entry

Originally written on Jun 06, 2005 @ 12:41
Read article on it's own page (permalink)

The content of this site is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 2.5 License.