Daily Archives: 22 - Sep - 2004

For when you’ve accidentally retagged all your music with the genre of Polka…

I’ve been working a bit today on implementing undo for tagging. I thought it was going to be much harder than it has turned out to be so far. I already have a basic framework up and going that can retag files again, and track what files need to be changed and how, to reverse the operation.

What I have to do is finish up with testing the new code, and converting the various code paths that can change a file to all go through the new class I’ve made. I’m thinking that the JuK internals could use a slight refactor, and I think that wheels has been thinking the same thing based on what he told me of his work on integrating Audio CD ripping into JuK. I’ll have to discuss it with him when he gets back. :-)

Ruby and some hacking

Richard Dale has been nice enough to try and explain the use of braces in Ruby.

I think I see what he means. From what I’ve been reading, you can associate blocks of code with different functions using the brace notation, which is simply a very nifty feature. It is how Ruby handles iterators, for instance, and it is possible to code many constructs using these.

What I have yet to do, however, is find a way to get braces to work with if, while, or other flow-control type statements. For example, the program yes implemented in Ruby:

while true
    print "y\n"
end

I can’t get this program to work using a closing brace for the end, or even adding an opening brace manually and then using a closing brace. I think this is because the while statement seems to imply a begin (as does the def statement, for example). I mean, it’s not like it’d kill me to learn to type end again, it’s just that it means Ruby is fighting for mindshare in my head not with Python and C++, but with bash and high school Pascal. ;-)

Learning Ruby

I was reading a book about Learning Ruby during my copious spare time in class today. So far I like the language (especially the super keyword, which I’ve only ever used in Turbo Pascal 7.0 where it was called inherited). However, there is a big thing that annoys me: The begin and end keywords. Call me stubborn, but I am so used to { and } for forming blocks of code that I don’t even want to go back to anything else. Python neatly sidesteps the problem by not having keywords for this sort of thing. Although I’m not fond of using indentation for creating blocks, that at least works with my programming style.

Other than that, I think the language is very nice so far, although I haven’t had a chance to check out any of the standard libraries.

In a different class today, we had three teams (including mine) presented on simple projects that we were going to develop over the course of the semester. One group is doing a project where they will post audio clips of lectures to an online website for authenticated students to browse later. Ignoring the fact that this shouldn’t take 5 people more than two weeks to implement, one of the slides on their presentation made a big deal about how Internet Explorer would be required. Required for playing a sound clip (I suppose it would be streamed, but that hardly adds difficulty to anything).

During the Q & A section I pointed out that Internet Explorer was rapidly losing market share, not to mention all of the Macintosh computers in the University computer lab that would be poorly supported. Not to mention the fact that the Department of Homeland Security (you know, the gub’mint) has recommened abandoning Internet Explorer.

After all that, their response was, “Well, IE is the majority. It should degrade nicely though.” *sigh* That’s why I hate IS classes. The Computer Science program at the University is actually part of a CIS (Computer & Information Sciences) college. The IS (Information Science) half of the program is for the so-called application programmers, who are essentially the people who go on to get jobs programming simple inventory managers using VB or something equally lame.

I wonder what would happen to a programmer in a company if he told his manager that he had locked out even 10 to 15% of their company’s potential market because he refused to spend the hour required in this case to make sure that the application was cross-browser compatible.