______ programming language sucks! May 1, 2008

Filed under: PHP, Random — thepet (Follow on twitter) @ 10:03 pm
______-programming-language-sucks

Fill in the blank.  I promise you it sucks.

PHP sucks.

Perl sucks.

Java sucks.

Ruby sucks.

Ruby on Rails especially sucks.

.NET sucks.

C++ sucks.

Python sucks.

While I do get quite a kick out of picking on my boss’s favorite, perl, I do recognize that each language sucks and each language doesn’t suck.  Personally, you’ll probably never see me start a project in perl, c++ or anything Microsoft only.  Mostly because there’s too big of a learning curve in it for me.  I definitely favor PHP for most projects, but that’s soley because of familiarity.  I could see myself choosing Java/Python/Ruby for some specific task over PHP.  And Ruby on Rails just works in ways my brain refuses to think, it’s like trying to teach myself a new way to breathe.

So my personal favorite is PHP.  I like that I can code up things in a flurry of creativity.  If one night I’m feeling especially inspired I can crank something out fast as a proof of concept.  Unfortunately for me, my interest vastly drops after I prove the concept and the proof of concept code is often used as the real code.  So the ability to code “bad code” in PHP is both a good and a bad thing to me.  I mean… I even wrote TweetWords while mostly drunk.  Even though the code worked and didn’t have any glaring issues… it was ugly and hard to extend and maintain.  That underwent a 75% rewrite to get most of the drunken design out of it and has been being improved weekly by my friend Ben and me.

So I know PHP well, I write a lot of spontaneous crap in it, and PHP is used in many open source web projects.  This is why I tend to lean on it so much.  And everything perl can do PHP can do, which is why I’d never start a project in perl.  And I  understand that some of the reasons why I like PHP are the reasons others hate PHP.  Oh well.

So what is the right language to use?  All of them.

You have to look at your situation and choose the proper language for the job.  Some important factors off the top of my head are:

  1. Who is going to be writing it and what are they strong in?
  2. How complicated is it?
  3. How important is the ability to scale it?

I’ve seen extremely simple concepts implemented with massively complex designs and frameworks.  They took 100 times longer to implement than they should have taken and any modifications to them took extra time too.

I’ve also seen more complicated concepts attempted to be done with too basic designs.  They failed to scale and were a pain to modify and extend.

So pick the language that is right for the situation.  And don’t be afraid to venture outside your comfort zone, you’ll never improve or learn anything new.

And lastly, here’s a handy chart using google and monster data.

suckschart.png

 
 

phpitter 0.10 beta April 20, 2008

Filed under: PHP — thepet (Follow on twitter) @ 7:21 am
phpitter-010-beta

Just packaged up a version 0.10 beta of phpitter.  It’s really looking prettier.  And now has a gtk notify plugin that looks much fancier than the libnotify plugin I had going.

It also does spell checking if you compiled php-gtk with –with-spell.  And I’ve got some good timeouts set for pulling the timeline so the UI doesn’t go all unresponsive when twitter is down.

Here’s a screenshot:

phpitter_main.png

 
 

phpitter beta release. April 15, 2008

Filed under: Linux, PHP — thepet (Follow on twitter) @ 6:10 am

Well, I switched from GtkTextView’s to GtkHTML’s for the tweets and popup. This way it’ll handle hyperlinks for me. I was getting close to figuring out how to figure out which word someone clicked on in a GtkTextView, but this was way easier.

Since now hyper linking works, sending updates works, the reply/retweet/direct buttons work, and the libnotify plugin works… I’ve stuck it out on code.google.

Check out the project and download it to give it a try.

phpitter_tweetinfo.png

 
 

phpitter shapping up April 14, 2008

Filed under: PHP — thepet (Follow on twitter) @ 10:56 am

Last night I hacked at it some more. Here’s what it looks like now:

phpitter_normal.png

Ok, now see that message from @jimctc that says “@micah pic from the breeder. she arrives first weekend in may.” Check out what happens if I hover over @jimctc’s avatar for that message:

phpitter_message_details.png

Also, here’s what the simpleLibNotifyNotice plugin does (note, this requires libnotify and the cmd line tool notify-send):

phpitter_new_message.png

I really need to get hyperlinks working in GtkTextViews… but that scares me.

I don’t get along well with CSS, will try to get the blog formatting to work right…

 
 

More fun with php-gtk. April 13, 2008

Filed under: PHP — thepet (Follow on twitter) @ 2:50 pm

Can’t stop fooling with this.  GTK is a funny funny system.  You have to know all the tricks to get things to layout right and capture the right events.  Wish it was more intuitive.

This new cut of phpitter is much cooler.  It looks better, updates the timeline every so often, saves/loads timeline data, will keep a history of 40 tweets deep (configurable actually), and has a couple of plugin hooks.

There are two plugins with it to show how the plugin hooks can work.  One will turn the tweet entry text red if you go over 140 characters.  The other is a sample notification plugin.  All it does is output to the cmd line who tweeted what to you.  Would be really easy to hook it in to a gtk window pop up, or the libnotify system.

Here’s the code.  And the screenshot:

 
 

php + gtk + twitter April 12, 2008

Filed under: PHP — thepet (Follow on twitter) @ 8:58 am
php-gtk-twitter

So… yeah. This was a fun Saturday morning. I wrote a gtk twitter client in php. Well… I wrote a proof of concept gtk twitter client in php.

The code is ugly and I’m sure has tons of issues, but it pulls your timeline and allows you to send updates. Check out the horrid screenshot, and here’s the rough code..