I’ve finally gotten around to releasing my Slider Puzzle source code. Hopefully someone out there can find a good use for it. I was tempted to set up a Jessica Alba puzzle on some free web hosting site and then link to it from here (as an example of how this code could be used), but I thought better of it.
At work, we do these things called “code reviews”, where everyone on the team reads over your code and gives you comments. It’s actually more helpful than one would think. Sometimes you don’t see small mistakes, like forgetting to update a comment, and sometimes people have suggestions on how to more gracefully do something. You actually learn a decent amount after attending a few of them. Occasionally someone will get ripped a new one, but that doesn’t happen too often.
I tried to give myself a code review before I released this code, but undoubtedly there will still be some imperfections somewhere. Hopefully the code is understandable though. If you decide to use it, let me know and I’ll give you a shout out on this blog.
Google Reader / Welcome to 2005
Despite all the press they’ve recieved, I’ve never used a feed reader. I knew what they were for, but for some reason I didn’t think I really needed one. When I re-started this site last year, someone emailed me asking me to put a link to the RSS feed, so I did, but I didn’t really bother trying out a feed reader myself. I finally got around to checking out Google Reader today, and honestly, I can’t believe I waited so long! This thing is great! You wouldn’t think they it would be that handy, but after setting things up, it’s actually a really nice tool.
Feed readers basically keep track of various sites you’re interested in and alert you when a new blog post / update occurs. In Google Reader, if you think a particular blog post / news story / whatever is interesting, you can share it with your “friends” (this is really your Gmail contacts, so you have to be careful – Google got some flap over this recently).
After playing around with it some, I went around to all the places I normally visit to see if they had links for feeds. Most didn’t, which was slightly annoying, but since I didn’t really bother paying attention to feed readers until recently, I can’t really blame other site owners. Anyway, if you’ve never bothered to check out a feed reader, I highly recommend taking a look at Google Reader (side notes: it’s free and I’m not being paid anything to talk about it or link it here).
Ads
After doing some experimentation, I’ve decided to keep the Google Ads strictly to the blog. They’re not generating a whole lot of clicks, but they’ve gotten a few. I placed them on a few choice pages for a while, but I decided to take them down because I think ads can cheapen the look certain pages (plus I felt kind of dirty having them on things like the VB Array tutorial). I think my rule of thumb will be to keep this site ad free unless I’m dealing with a) the blog or b) a page that’s getting 10,000+ views a day. A friend of mine gave me the second option as a rule of thumb for when to use ads and it seems to make sense (the ads can help deal with the bandwidth plus make you a couple of extra bucks). I don’t mind having them on the blog since I don’t think they come off as annoying, they can be blocked without the page looking strange, and since I don’t update every day, they can serve as somewhere to go if you’re truly bored (for those of you who click ads, whoever you are).
Ambitions / New Company
So yeah, I haven’t been doing all this ad experimentation simply for just this site. For about a year now I’ve been talking to some of my old grad school buddies about possibly starting a web 2.0 style site that could generate revenue. Nothing really came out of it at first since they were still finishing their thesis projects, however, now that one is done and the other is almost done, we’re actually making some progress. We haven’t coded anything yet, but we’ve spent the past month brainstorming ideas and narrowing things down. It actually looks like we’re going to make a run at this, which I think would be pretty cool. If you never hear me mention this again, you’ll know things fell through, but if the wheels keep turning I’ll make sure and keep you all posted on this.
I was just looking over the php side of it and overall it is pretty decent. There are a few things that could have been done differently if you targeted php5. I don’t know if you knew, but php4 is no longer being developed (just security fixes) and in August it will be unsupported completely. Although there are usually legit reasons people are stuck on 4.
Anyway, with php5, you can replace the opendir/readdir/closedir section with scandir, which also sorts the results, so that would cut down your code by a bit.
Also, objects always return references in 5, so instead of indexing the $rMetadata array each time you add an element, you can assign it a reference to a temp var and modify the temp var.
I have no idea if it’s faster than the regular file functions, but there is a file_get_contents function available. Ack! It’s only available in >= 4.3.0, sorry.
The only thing that had me wondering was why you split the metadata by “\n” and then replaced “chr(13)” in each element. Why not just remove “\r” from the metadata before splitting it?
I hope I’m not coming across as overly critical or condescending. That’s not my intent at all. The idea of code reviews got me interested. I’ve been doing things on my own for so long, it’d be great to have other input.
…maybe that could be a web project…
> I hope I’m not coming across as overly critical or condescending.
No worries, I actually really appreciate the feed back. All of what I currently know about PHP comes from tutorials I’ve read online or code samples I’ve seen. I picked up a PHP 5 book a while back, but since I’m currently running PHP 4, I haven’t given it much of a look. I’ve heard that PHP 4 will no longer being supported, I just haven’t taken the time to upgrade. I’ll probably try and do that pretty soon.
As for the chr(13) replacing, it probably should be done up front, I’ll make that change in the next version.
> The idea of code reviews got me interested. I’ve been doing things on my own for so long, it’d be great to have other input.
They’re actually kind of fun – sometimes. Some reviews I’ve done have dealt with 100+ pages of code, and it’s impossible to really read over it all. And sometimes the comments you get reflect the reviewer’s style preference and aren’t really that helpful. Over all I think they’re really useful though. I’ve never been to a code review where there weren’t at least 6 or 7 comments (one review I went to had 45+ comments – the meeting for it took over 2 hours).
Hi,
Just found your blog on Technorati & Digg upcomming news feeds and read a few of your other posts.
ISeems good contents,Keep up the good work. Look forward to reading more from you in the future.
Thanks,
Michael