Archive for March, 2007

Unfuddle Your Project!

Posted on March 11th, 2007 in Programming | Comments

I set up a small server using some spare parts at my apartment, which I leave up and running 24/7. I connect to that server via the small router I have (only opening the ports I want to have open, obviously) whenever I’m not home, using a dynamic IP service. This server is mainly used as my Subversion repository, with all the projects I’m working on. Unfortunately, this isn’t working too well, as blackouts, Internet outages and even system lock-ups (hey, I said the server was made using spare parts) at my apartment render it useless. It happened to me this weekend, when I was away from my apartment, so I couldn’t work with anything I had planned.

So I searched around, and found the most excellent service that I needed, called Unfuddle. Unfuddle is a site that offers source control services, along with bug tracking, for free for simple, private projects (or a minimal fee for larger projects). I created an account yesterday, and I just arrived at my apartment, so I immediately transferred my source code to the Unfuddle servers. I played around with the service for a while, and I have to say, this is really a great solution for those in need of source control in a remote server.

The simplicity of the service is really the nicest touch, in my opinion. It’s really easy to navigate around the system and work with your project. Looking through your source code in the repository (using Subversion) is a breeze, and adding issues to the bug tracker, or any other message is just as easy. Seriously, it’s a great tool for all those software developers out there who need a place to have their code handy, ready to work with, anywhere you are.

The higher fees are for largers groups with different projects and many users, along with added security features. If I were working with a group, I would totally pay up for one of these services. If it works great for a lone individual like me, this has to be excellent for groups of two or more. So you should take a look at this service, as it’s a good one. I have nothing bad to say about Unfuddle for the time being. Hopefully it’ll help you too.

Yet another FizzBuzz post

Posted on March 10th, 2007 in Programming | Comments

A couple of weeks ago, CodingHorror (an awesome and wildly popular blog) wrote about the fact that programmers can’t program. Like I mentioned in my previous post, this can’t be any more true. But in reality, I think this is more of an issue with people over-analyzing the problem at hand.

In today’s world, things tend to get really complicated. Programming is no different. In my current project, I’m already reached a point where I would like to tell my boss “No more code – Fix this junk and forget about the users until it’s fixed.” Admittedly, most of that junk has been done by me. But I’ve been campaigning to stop development for a while and fix the current problems without adding any new features.

But this isn’t the story I wanted to give today. As far as the “FizzBuzz” phenomena goes, I think most of those people who couldn’t solve that problem were most likely over-analyzing the problem. Of course, there had to be people who honestly didn’t have any earthly idea on how to code the solution. But for the rest, maybe thinking of a solution that was too flashy could’ve been the problem.

Like many others, as specified in a follow-up post, I immediately fired up the text editor, and coded the solution in Ruby (which I was studying at the time I read the original post) in about 10 lines of code, thinking “Wow, that was easy.” And seriously, it is, if you take the KISS route (that’s “Keep It Simple, Stupid”, for those who don’t know) as I did. Just a simple if-else condition, along with the trusty mod operator, it was easy.

I can only imagine many thinking about putting the FizzBuzz code in a separate class, complete with iterators, inside neat and well-designed blocks of code, ready for Object-Oriented goodness. Why? This is simply overkill. Unfortunately, many developers think that way. It’s possibly our nature, just as it was in our nature to try to solve the FizzBuzz problem.

Sometimes, keeping things simple is just what we need in a crazy world like this.

Learn to write code for my sanity

Posted on March 5th, 2007 in Computer Science, Programming | Comments

I’m currently at work, and I seriously needed a break, which is why I’m here, writing something for my blog. Why? It’s a long story, but I’ll keep it short.

My boss decided to start using part of our program that hasn’t been modified since 2004, and last used in early 2005. Of course, with all the changes we’ve done, lots of bugs started cropping up, so he put that on my lap. The problem is, I didn’t make this part of the program. Someone else who worked here until early 2005 worked completely on that module. Now that person is long gone, and I’m stuck with his code.

“No biggie”, I thought. “This shouldn’t be too difficult to modify for what the boss wants now.” Then I opened the file… It was a total mess.

I mean, I had seen messy code, a lot from myself. But this was messy. And if I have to bold and italicize a word, it’s because I really mean it. This was the worst code I have ever seen written by any developer ever. I know that PHP has a reputation for producing some awful code, but this really took the cake.

We start off with lots of Dreamweaver generated code at the beginning (some Javascript code that apparently doesn’t do anything in the application). Then we head off towards the land of unknown variables: $dbQuery1, $dbQuery2, $dbQuery3, and my personal fave, $c. Also, there was virtually no indentation all around, and the indentation that did exist was very poorly done (some if-else blocks were completely on the left margin of the code). Add up that there were exactly two comments consisting of only one word throughout the 600 lines of code, and you have a developer with a huge headache, trying to figure out what the damn thing does. And while it kinda works, now I’m faced with the dilemma of trying to add new functionality to the module while not breaking anything.

The worst part of it all is that I showed the code to one of the technicians here who actually studied in the same web-development class as the previous developer, and he told me “That’s how he’s always programmed.” So I asked what the teacher did with that code, and he told me “The teacher probably writes worse code than that.” What? A college professor writing worse code than that?

I can’t believe that Computer Science professors aren’t enforcing their students to learn how to write clean and maintainable code. And I don’t think this is an isolated incident, because at my university, the professors didn’t enforce this either. And while we were taught to use indentation correctly, informative variable names and all that, they never said anything if we didn’t follow those simple steps.

If I were a college professor giving a programming class, I would enforce those rules, probably almost harshly. If I see generic variable names (like the ones I mentioned above), I’ll dock one or two points from the final grade. If indentation isn’t used correctly, another one or two points disappear. And if the code is as unreadable as the code I’m working on now, I’ll probably fail the student, or at least give him one more day to fix that code before giving it back to me.

I’m curious to know if anyone else has seen this at college, or if it’s just another Puerto Rican incident.

All the porn you want! (Not really)

Posted on March 2nd, 2007 in Software | Comments

Note: I noticed that this is the most-viewed in all my blog, thanks to this appearing in Google search results when people search for “Puerto Rican Porn”. Sadly to say, there is absolutely no porn on this site, so if that was your reason of coming here, you’ll be disappointed. However, if you do enjoy reading about technology, feel free to browse any of my recent posts.

Wow, I really can’t believe that this past week, my little ol’ blog has been bombarded with tons of spam comments. And this is a blog that barely has any readers at all. I can only imagine the amount of spam the more popular blogs on the Internet. Really, I don’t want to know where I can get she-male porn videos, or female ejaculation pictures. I’m not an avid pornographer, and rarely scour the Web for that stuff (note that I said ‘rarely‘ – at least I’m honest). But if I’m feeling a bit freaky, I’ll know where to go. It’s not like that stuff is totally hidden.

Anyway, I wanted to mention the Akismet Plugin that’s currently included in all Wordpress installations by default. After I got the first couple of spam messages, I decided it was time to activate the plugin to see how it works. After a couple of days, the plugin has captured more than 30 spam comments, and none have gone through. Pretty good job, if you ask me.

So, if you have a Wordpress blog, I really advise on activing the plugin. It only takes a few minutes, and you’ll be grateful once you stop getting offers for bestiality flicks. If you don’t use Wordpress, Akismet makes plugins for more than 20 different platforms, so you can check if your application is supported. It’s really a great plugin that should be activated by default on any blog or CMS app.