Monday, December 14, 2009

A Good Programmer?

I came across this blog post via Hacker News tonight, and it gave me a little food for thought.

I should know better, of course, than to just take stuff like this as gospel truth, but I hear it a lot from people like Jeff Atwood, who make their living talking about programming. To be a "good" programmer you need to be the kind of person who just loves it, and does it all the time.

The second one I don't know that I agreed with too much, mostly because I know plenty of people who talk up "bleeding-edge" technologies who are only talking them up because they're bleeding-edge, and couldn't even begin to actually program in it if they wanted to because they lack even the most basic skills. This is primarily what I run into with kids singing the praises of the latest Microsoft technology (not to piss on Microsoft technology necessarily, but there's a reason for that). However, taken with the rest of the list, it's a little more understandable. I'll still hold on to my dreams of kernel hacking, though. ;)

The one that really hit me in a tender area was the last one..."If your potential programmer didn’t do any programming before university, and all his experience starts when she got her first job, she’s probably not a good programmer." Ouch. That describes me almost to a T. Granted, I started programming in my undergrad career while pursing another degree, and the Master's was technically an extension of a "hobby", but before that I had never done any programming. In CS 120 I had to go to my professor's office for help because I didn't know what FTP was. Yes, it was that bad.

I had no access to any resources to even begin to understand how to do it, and didn't know what to look for anyway. It has been the primary source of my low self-confidence in my programming ability the entire time I have been attempting to make the computer bend to my feeble will. Even now, when I know I've improved so much, I still never feel like I've worked hard enough or dedicated myself enough to improving my skill. I've tinkered with a wide variety of languages but am still very much a C++/Java person.

Anyway, expressing my insecurity is not particularly helpful...I'm off to start reading more books and working on more projects.

Saturday, December 12, 2009

Two Changes!

I've moved my portfolio page to CodeMonkeyInc on Google Sites because, frankly, I am fully capable of writing a website backend, but I couldn't design my way out of an empty pool. Not to say I haven't tried really hard, but I lack the requisite skills in terms of creating backgrounds and other important images that look clean and professional, rather than like I made them up in Gimp after dicking around for a half hour. Also, I have yet to actually BUY hosting, so my iweb account will be going down after I graduate anyway.

The other thing I did this weekend was post a few of my person projects to Launchpad so I could show them off on the portfolio page. Right now my projects on there aren't extremely impressive, but ScribbleMidi is coming along really well, and I'm anticipating having a semi-working system soon. Launchpad is a wonderful, free way to publicly post your open source projects.

Sunday, December 6, 2009

Battle With the PHP Script From Hell

In seminar class we have to write a script that takes in a gigantic (3.2MB) text file data dump, parse the data out, and insert it into a MySQL database for an application we're working on. The first pass was done by a classmate, and although it got the job done quickly (averaged around 13 seconds), the other requirement was that the script be easy to modify by non-programmers, and this was not even remotely easy to modify (it took me a half an hour to add one line). So I took it upon myself to rewrite the whole thing, and so far the result has been an interesting exercise.

Problem 1: The data is delineated by XML-style tags, but is not in an XML structure.
Problem 2: Some of the records (collections of data that represent one art piece) are invalid, as they just describe different image file names for a single art piece.
Problem 3: Some of the data is unique (such as the style, technique, etc), and the values are often in a list separated by semicolons.
Problem 4: The current version of my rewrite takes well over 400 seconds to run.
Problem 5: I had pretty much a weekend to write this.

The data dump and the way the records are structured is unavoidable. I approached the problem by reading in one record at a time and passing it through a series of functions to pull out the appropriate values, then inserting them into the MySQL database. It does this one query at a time, however, which I suspect is part of the problem.

The first step in improving is exploring the REPLACE function. I'm currently running a query that checks a table if the current values exists, otherwise it needs to be added in. Making these required entries unique should remove the need for these extra queries.

The result? Down to around 330 seconds, not as bad. The primary keys are a little screwed up, as expected, but since it's an auto-incremented number, it isn't a huge deal.

At this point the primary bottleneck is in the bridge tables. Here's how this works: all the bridge tables simply connect an art piece with its corresponding style, technique, etc. So there's a style table, which is only a list of styles, but we need to take the artID (one select query), then select the corresponding styleID, and put them in one table. This wouldn't be so bad except it's 2 queries in a row for each of the tables; that's a lot of individual queries.

**Note: at this point I realized I made an extremely stupid error and kept adding onto the records array rather than clearing it after each record was processed *facepalm!*
Fixing that major leak got the script down to 131 seconds.

After making a huge difference with the array I managed to cut it down even more by fixing the art table creation. This function was using two different queries to build the table, which was unnecessary. It's now running at around 16 seconds!

Right now I'm pretty happy with where the script is at, so I'll save the optimization of the bridge tables for later.

Wednesday, November 18, 2009

Linux in Media

I know for a fact that a lot of Sci Fi original movies use Linux in their computer scenes (one of them was really, really, obviously Gnome desktop, which made me extremely happy). it's free, doesn't violate any copyrights, and allows the movie makers to customise the look of it so it can look suprar scientific. I wonder how much media actually uses Linux for their "fancy tech computer" scenes...or if most of them just use a flash movie or what...

Thursday, November 12, 2009

World Usability Day

I went to World Usability Day down at IU and was really impressed, that was a fantastic conference. Very, very, very small, but gave me a lot to think about and didn't put me in a grouchy mood. No one there expect myself, Dr. Gestwicki, and Austin were programmers, which made us feel like outsiders in a sense, but we all still gained a lot by going and enjoyed ourselves quite a bit.

The highlight of the conference was definitely Rod Collier, the guy who designed the Letterman Building here at Ball State. His presentation was both informative and interesting, his PowerPoint was amazing, and he gave some fantastic examples of innovative design in his own home (which he designed himself!).

Unfortunately I didn't get a good sense of what everyone was thinking of when they were talking about design and usability...I guess it was just physical objects...but most everyone there avoided the topic of computers like the plague (even the guy who worked for Tuitive, which designs web-based apps and webpages for clients). This was unfortunate, since CS could use more good usability people.

Another refreshing aspect was the attitude; everyone there obviously knew what they were talking about, but didn't seem to be wallowing in their own sense of self-importance, which was extremely refreshing...I felt like this was due to the fact that these people are professionals, working for real clients, rather than a group of artists, which really makes an enormous difference.

It also encouraged me to get a better design sense...I still have a lot of work to do in that regard. Especially since one of my interests is web design, this will be an essential skill. Unfortunately I'll always be a struggling outsider, because I don't fool myself into believing for a minute that design is something people can just "pick up". The amount of studies done on usability, the ridiculous amount of unusable systems, and the amount of money companies will spend on design are all obvious proof that design is another "this isn't as easy at it looks" area, but on the plus side, I'm far more aware of it now than I ever was before.

Now, if you'll excuse me, I'm off to redesign my website again :)

Surface Project Success!!!

I meant to post this WAY earlier, but I've been unbelievably busy. The Surface project was a great success! It didn't crash, people seemed reasonably interested in it, and we made some very interesting observations.

Primary observations of interest:
1) People didn't seem aware of what the navagation bar was. They would mess around with the cards already on the table rather than interacting with the navigation bar.
2) They kept trying to resize the cards (totally understandable)...we'll need to build in a flexible resize function for all the UI elements if there is any continued work on this project.
3) They "accidentally" discovered the flip function. Again, there needed to be an obvious visual cue for this.
4) They kept trying to interact with their own names, which was, in retrospect, a completely obvious interaction we neglected to take advantage of due to time constraints.

We're going to start going through the data soon, which will also be extremely interesting. More to come!

Thursday, November 5, 2009

Brief UI Post

I installed TweetDeck today just to check it out:




Oh. My. God. Why. This is easily the worst UI design I've seen in a while. What do all those little icons do? I have no idea until I hover over them with the mouse. Why so much noise? I can't even tell what I'm freaking looking at.

And don't get me started on the Growl integration:



Yeah, that's attractive...takes up a ton of screen real estate, makes an annoying sound, and doesn't conform to my Growl theme (quick toaster pop-up along the bottom).

I hate, hate, hate cluttered UI designs that take up more space than they deserve. If you can fit all your content into a thin column, you make the application the size of said column. If you need more of these content windows, there's this concept call tabs. Nothing that only takes 140 characters to display should EVER take up my entire desktop real estate.

To be fair, I'm a stickler for clean desktops. As should be obvious:



So I'm definitely biased. But I have trouble viewing something like that as usable. Need to do more research on this topic :)