Tuesday, November 2, 2010

All-Consuming Web

I've taken on some new challenges, including rebuilding my personal web page, and, in the process, learning to become a better designer. At this point, unfortunately, this consists of learning how CSS works rather than graduating to a more philosophical discussion of what a "good" web design is. I know what kinds of web pages I like, but I have none of the required skills to make my own look the way I want yet.

In the meantime, I'm going to have to do SOME project in C++...

Wednesday, October 27, 2010

The Political Programmer

"You know, most programmers are libertarian", my workmate stated.

"I know", I replied, attempting to imply in my tone of voice that I had met many of these abstract libertarian programmers my workmate spoke of.

"It's because they think, 'Hey, I can solve this problem myself, I don't need any help!'".

"Yeah, they're also massive assholes".

I'm not a libertarian. I believe in giving as much help as possible, with the hopes that I'll receive some help in return. Maybe this makes me a bad programmer.

I finally began to come to terms with the idea that, not only am I a *bad* programmer, it was very likely I would never become a decent, or even remotely competent programmer. I'll certainly never be the hackers I romanticize. But, really, this no longer bothers me. Now that I've thrown off the shackles of insecurity, I'm free to learn at my own pace, and I'm starting to REALLY enjoy it. I read whatever strikes my fancy, work on whatever personal projects excite me in my off time, and this has been an amazing turn-around. I'm not trying to get through that C++ book to become a C++ super-guru anymore, I'm just reading it because I'm enjoying it. I'm no longer allowing myself to be embarrassed by a lack of knowledge in any topic anymore, and as a result I'm free to learn more.

If you find yourself becoming a slave to an ideal image of yourself, it may be time to re-asses that image and figure out if you really want to be that abstract that ideal, or if the ideal is what is really holding you back.

Saturday, September 25, 2010

Redesigns to Blow Your Mind

Since I last posted, I have become gainfully employed by a web development company and have been so for the past 8 months or so. Both the Master's degree and the move down here seems to have paid off even more so than I had any right to hope or expect. Always a good story.

In the meantime, I've become motivated to start working on a few personal projects again, primarily so I can keep the rust off my not-spectacular Java skills. Syntax is trivial, but it surprises me how easy it is to lose code design skills. In particular, I started a project with (apparently) the intention of using some sort of mediator pattern and, after not working on it for a few months, looking over the code again has made me cringe. The objects are working as both data containers AND UI controllers, which, due to the recent emphasis of MVC, and my own personal preference, seems like a Really Bad Idea(tm). So already, with not much code, I'm doing an overhaul.

None of this is particularly enthralling, but it again illustrates how important a design phase before code writing can be, even if you're the only person working on the project. I'm ditching 7 source files due to a complete lack of planning when I started...if there was any planning, I certainly can't find it now.

So, back to coding, and I hope to have a few functioning projects to write about soon.

Monday, January 11, 2010

Time to Start Over...Sort of!

So it's Monday morning and I'm starting my 3rd full day in Austin, Texas, after a harrowing 3-day truck-based move. So far I'm loving it here, oh so so much, and I've started my job hunt anew. I wasn't having any luck applying from Indiana, so I'm hoping that my Austin address will help a little. So far I've applied for 3 different IBM positions, and a few others. I'm excited and scared, but the risk should turn out to be worth it :)

An exciting fact about Austin is that it has a lot of LUGs, which will be great for meeting new people and being able to keep up on all things Linux. Hoorey!

Off to the future.

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.