Ask Matt: Question from Austin

Austin asks:

I am looking to embed a photo gallery into my website, but not sure what online photo album to use. In the past I have used Gallery2 and Gallery3 but Gallery seems a bit clunky and outdated. flickr and picasa seem cool, but is it worth the trouble of setting up an online album?

Personally I like flickr. I’m a Pro (paid) user with the service and have been since before Yahoo purchased them. It has always seemed to work well. If you’re going to be uploading tons and tons of photo’s, I find it’s easier to use a service like that which isn’t going to limit you on storage space or bandwidth. Additionally I use the Flickr Photo Album plugin to have a photo album on my site.

For the number of photo’s I tend to take and upload, having them on my server/account just ends up becoming problematic.  If I ever change web hosts, moving them is difficult if not impossible.  So I guess my answer would depend on how many photo’s you plan to host.  If you’ll have a low number, I could see a decent argument being made for just hosting them yourself.

This post is part of Episode 8 of the Ask Matt Series.

Ask Matt: Question from John

John asks:

Why do you do the Ask Matt series?

Basically it’s a good way for me to interact with my readers.

This post is part of Episode 8 of the Ask Matt Series.

Ask Matt: Question from Kamen

Kamen asks:

I have been developing on Wordpress for a couple of years now and everything I know has come from Google hunts, asking others, and banging my head on my desk from time to time.
Where did you get your start? Did you start with a platform and learn the PHP and CSS as you went? Or did you have a foundation of the code first?

In short, which came first… Wordpress or the code?

Good question, thanks for posting it.  The short answer is the code came first.

I started as a PHP developer before I even knew what WordPress was (in fact, I’m pretty sure it was before WordPress, in its current form, even existed).  My first project in PHP was a blog, it’s a great way to teach yourself any web language if you ask me.  From there I built a multi-user / multi-blog system called LSblog (it was basically Blogger, supported templates, comments, image uploads, etc).  From there I started making content management systems and then moved into Web Development professionally.

A little bit after LSBlog, I jumped around between blogging services quite a bit, but ended up settling on WordPress while it was still in its infancy (shortly after it being forked from b2).  I was still early in my PHP development, so I banged my head on the desk a lot as well as I tried to customize it.  It was even harder back in those days.  For some changes, at that time, you had to edit core WordPress files to do things (which is considered a big no-no these days due to the great Theme/Plugin architecture that WordPress offers).

I definitely think that having a foundation in PHP outside of WordPress will only help you in your WordPress development, especially if you ever venture into plugin creation.  It’s not 100% necessary probably, but it will help you understand why WordPress does some things how it does and will allow you to choose the right solution for the job.

But don’t be afraid to try things, and don’t be afraid to write sloppy code (in the beginning).  Every coder has written horrid code that they have nightmares over having to go back and support it.  Sloppy code happens when you’re learning and with time you’ll start writing code that is more efficient and easier to support / enhance.  You’ll also get better at digging through existing code and finding ways to make it do what you want it to do :)

This post is part of Episode 8 of the Ask Matt Series.

Ask Matt – Episode 8

It’s been quite awhile since I’ve done one of these, but thought I’d open it up once again.

So here’s your chance. Ask me anything you want in the comments and I will give you an answer. It can be anything from Technology to Photography to the why is I-95 an odd numbered interstate. There’s no question that is unacceptable.

This post is part of Episode 8 of the Ask Matt Series.

Ask Matt: Question from Bobby

Bobby asks:

WHY WHY WHY………is Oracle considered better than MySql or MS Sql Server? I think it sucks. It’s bloated, prone to errors, and nothign works the way it is supposed to. In SQL Server, to backup a database….you right click it and choose backup. In oracle, you go through 10 steps and most of the time it just fails. The whole system is buggy. I swear Oracle DBA’s don’t make millions because Oracle is powerful, they make millions cus they know the work arounds for Oracles Bugs.

So, I guess the question for you is…..what is the best database and why?

Well, given my background, you can probably guess that I’m going to end up recommending something that is open source.  I would also say  most of my experience comes from databases that have a strong presence in the web community.  Historically, the bulk of my experience is with MySQL, which really is a nice database platform.  It supports several table types (MyISAM, InnoDB, etc) which have their pro’s and con’s.  It also enjoys wide support from programming languages.

I’m not sure that I would rate it as the best though.  For instance, about 3 years ago I released an online feed reader called OneFeed.  It had a nice Ajax front-end that looked like Outlook’s typical 3 pane view.  Then it had crawlers on the back-end that were parsing the feeds that users had subscribed to.  It was definitely a learning experience.  My #2 bottleneck ended up being the database.  I had started off on MySQL with MyISAM table types.  Well, the feed crawlers were basically writing to the database non-stop, as in 24/7/365.  They were having to parse over 20,000 feeds once every hour at its peak.  So the problem is that with MyISAM, when a write goes to the database, it locks the entire table instead of just the record that is being written to.  This was bad because it meant the user interface was being slowed down because of the crawlers trying to keep up with their job (there were 12 crawlers at the peak).

So, I ended up shifting over to InnoDB which allows record level locking on tables, and this definitely sped things up quite a bit.  But the database was still sluggish to respond on certain queries.  The database size was also exploding.

About this time is when I shut OneFeed down.  However, I was speaking with another developer that was working on an online feed reader as well.  They, too, were having the same issue that I was and they took it to the next step, which was switching to PostgreSQL.  With PostgreSQL they were able to kill several birds with one stone.  They achieved faster query times and smaller database sizes.

PostgreSQL also offers triggers and more robust features.  However, some of this is becoming moot as the platforms have started moving towards each other.  MySQL has picked up triggers, etc, and PostgreSQL has been stepping it up on performance.  So, these days, there’s less difference between the two for the average user.

Anyhow, that’s about the most I can tell you.  I’d say MySQL probably has broader market share, but PostgreSQL is somewhat viewed as being more robust still.  I really don’t know tons about Oracle, and have only played minimally with MS SQL Server.  So I can’t really comment accurately on those.  I know my brother likes SQL Server, and I’ve never really heard him (or anyone really) complaining about it being stupid.  So if you’re living in a Microsoft world, I’m sure it’s a great platform.  I’ve never really had to work with SO much data that I even needed to consider Oracle as an option.

This post is part of Episode  7 of the weekly Ask Matt Series.

Ask Matt – Episode 7

Here’s your chance.  Ask me anything you want in the comments and I will give you an answer.  It can be anything from Technology to Photography to the why is I-95 an odd numbered interstate.  There’s no question that is unacceptable.

This post is part of Episode  7 of the weekly Ask Matt Series.

Ask Matt: Question from Bobby

Bobby asks:

What is the best web language today?
What is the worst web language?
Does the practice of one vs another show the capabilities of the developer, or the limitations of the task?

Those are some tough questions to answer.  I’ve somewhat talked about this before.  I would probably say that the problem is the question is too broad.  I’d really need to ask back, “better in what way?”

My personal opinion, and I point out that it’s merely my opinion because I’ve been pulled into debates with folks that disagree on this, is that the visitor/end-user’s experience is what matters the most (you have to draw your line in the sand somewhere, that’s where mine is).  I feel that most of the currently popular web languages are capable of producing the same result to the end user, so the developer should use what they’re most comfortable with, whether that be .NET, PHP, Ruby, etc.  You’re going to be able to find clients that will let you develop in any of those languages, so that’s not a sticking point to me.  It’s difficult to go much further beyond that without more definition around the question.  For instance if you wanted to take it down to OOP, one language might start shining compared to another, or if it was an issue of smallest learning curve, another language might take the spotlight.

I know some other folks that argue it’s whoever the client is might dictate the language, and I see merit to the argument, however I’ve also found that you can lead a client towards a particular language under many circumstances, aside from them already having an internal environment setup that they want you to develop for (although I’ve also had clients willing to setup an environment just for what I’m building them).  So, all that to say, there’s a lot of exceptions/gray area.

I personally prefer PHP for web development.  It has a low learning curve, outstanding centralized/maintained documentation (seriously … it blows the rest out of the water when it comes to documentation in my opinion), and an amazingly strong community behind it.  It’s also a strongly proven language for web development.  All one has to do is look at Facebook, Wikipedia, Digg, WordPress, etc, and you can see it hard at work.  Yahoo! also has a strong presence in the PHP community which has led to some great API’s for search, geocoding, mapping, etc.  Most of their services have an API, and most of those API’s will return results in serialized PHP, making developing on top of them very easy.

As for the second question, which is worst, I’m not sure I can answer that for many of the reasons I outlined above.  There are some horrible ones out there, but they likely started to scratch an itch, you can’t necessarily blame the language if it got bent out of it’s original purpose.

The third question is an interesting one.  I think I would likely argue that it would show the capabilities of the developer.  Given that I view choosing the correct language as what the developer is most comfortable with, I’m not sure that I could answer any other way.  I’ve yet to see a webapp/website built on a language such as Ruby on Rails/.NET/etc that I couldn’t replicate in PHP.  I might not be able to replicate something made in .NET in Ruby/on Rails, however that is not a fault of Ruby, it’s a fault of my knowledge of the language.

Anyhow, sorry it took so long for me to write an answer, it’s been a busy week.  Hope that at least somewhat answers how I feel about the questions.

This post is part of Episode 6 of the weekly Ask Matt Series.

Ask Matt – Ep 6

Here’s your chance.  Ask me anything you want in the comments and I will give you an answer.  It can be anything from Technology to Photography to the best cure for hiccups.  There’s no question that is unacceptable.

This post is part of Episode 6 of the weekly Ask Matt Series.

Ask Matt: Question from Brady

Brady Asks:

What causes business cycles?

Talk about a complex question uttered in four simple words.  I’m afraid I may have to take a cop-out on this one.  I don’t really see any way to pinpoint it to one, or even ten specific causes.  The number of variables would be so enormous that I could probably write about the subject all night and still never do the question justice.  And yes, I know I said the economy was fair game in this round, sorry for not having a better answer for you.

Although, I could turn around and say they’re not cycles at all, since a ‘cycle’ implies regularity between the upturns and downturns in the economy.  However there is no, to the best of my knowledge, schedule to the ‘cycles’ we see in the market.

Needless to say however, I wish we weren’t seeing the current downturn we’re all experiencing.

But if you’d like to discuss it further sometime Brady, let’s grab a beer :)

Note: This is part of the Ask Matt series where you, the reader, get to post a question and have me answer it.

Ask Matt: Question from Ezra

Ezra Asks:

Do you know if its possible to turn an email box into an RSS feed?

I’m sure it is.  Although how to go about doing it will depend largely on your email provider.  For instance, if you’re on GMail, there’s an Atom feed available of your mailbox already, although it requires a feed reader capable of authentication for privacy reasons.

For other providers, it might get a little more complex, but it wouldn’t be too bad.  I’m not aware of any services that will do this automatically off the top of my head.   But setting it up on your own wouldn’t be all that complex if you have some PHP knowledge (which I believe you do).  You could use something like this PHP POP3 Class to poll your mailbox then you could use something like SimplePie to create an RSS feed of the data.  I don’t have any experience with the PHP POP3 Class, but I’m sure if it didn’t work out there are likely many more, and probably even IMAP implementations as well.  SimplePie, I have used, and find it to be quite nice.

Note: This is part of the Ask Matt series where you, the reader, get to post a question and have me answer it.