- Write a dispatcher from xmpp4r to ActionController. Get rid of that ugly while true loop.
- Write a proper render action. Have ActionController look for some sort of proper template, like status.chat_response.erb. msg.from could be easily DRYed out, since you'll be responding to the same person every time.
- Release it as a rails plugin
- Profit.
Thursday, June 26, 2008
Area Man Misses the Point of MVC
Wednesday, May 14, 2008
TomsTechBlog.com: Free and far too expensive
Before I get right into it, I found a serious bug in Google tonight: I searched for something, and this post came up. I don't care what I'm searching for, there's no search terms on earth that should bring this crap to light.
As for the post, it's essentially a handful of thinly veiled rants about how sad Tom is that he doesn't work at Google. I'll quote parts of the post here, with my comments in italics.
Google App Engine is essentially just a free web host. Google.com is essentially just a free search engine.
Given that, I made a quick chart comparing Google App Engine to a popular shared hosting company (for the record, I've never done business with this company). I compared Google's free service to the other company's $5.95 per month service...
Average Webhost Data Transfer per Month 15,000Gb 300-310Gb (10Gb per day Setup Free Free Database (Open) MySQL (Proprietary) BigTable PHP Yes No Ruby Yes No Python Yes Yes Perl Yes No As you can see, Google falls behind in every single category. So the question becomes this: is there really anyone who can't afford $6 a month?
Despite drastically missing the meaning of 'every', this comparison has some built-in assumptions that were formed with the aid of a giant bucket of fail. Do you think Google would spend centuries worth of labor of the smartest programming minds of our era building something that wasn't as good as fucking MySQL? Neither do I.
Google App Engine's ability to scale depends on how much server resources Google is willing to dedicate to the task of running these applications. Google is not going to risk slowing down their primary services for a Google App Engine application. So their ability to scale could very well be less than other companies, we just don't know.
Alright Tom, here comes the enlightenment, are you ready for this? Sitting down? GOOGLE APP ENGINE ISN'T MEANT TO BE A FREE SERVICE! Sure, it's free for the "small fish", but that's not who Google cares about. Google has some of the industry's the smartest people, and as an application developer, I'm ecstatic to be able to send them my hugely popular python web app and have them scale it to kingdom come. If this strikes you as wrong, you should go back and re-read Adam Smith.
The Google App engine may some day be worth mentioning but as of right now its nothing short of comical. Essentially Geocities 2.0. I don't know what internet you remember, but Geocities was a joke of a website where people were forced into contrived communities in order to create a free small website. Google is offering their infrastructure and expertise. Focusing on the free website aspect just enlightens the world to your myopia.
Congratulations Tom, you utterly fail.I can't imagine any serious developer signing up for this under the current circumstances. I can't imagine you commenting about serious topics.
Monday, May 12, 2008
An angle bracket tax?
Thursday, January 24, 2008
PHP Sucks Balls.
Language Features
- It's dynamically typed. This isn't a feature. It's a design decision made early on.
- All arrays are associative (hashes) Which means that if you want to build an array, you have no easy way of guaranteeing that all indices will be numeric. Sounds like a recipe for trouble to me.
- It's object oriented with a reflection API. Ruby, Java, and Python are object oriented. PHP is a procedural language with some stapled-on shit that they try to pass off as object orientation. Note that they still haven't implemented proper class and instance scoping, which makes objects in php just more typing, not more usable or functional.
- It uses different operators for numeric addition (+) and string concatenation (.) This wouldn't be necessary if it had anything more than the most useless type checker in the universe.
- It supports eval() and lambdas (somewhat) BASIC implemented eval() this well 30 years ago. Having a "dynamic" language with such a poor-performing eval() really should scare users of the langauge.
- Can execute system commands and read from local and remote files (all one-liners) So can BASIC.
- Supports coercing scalars into boolean decisions (means you can just do if($x) instead of if($x!=null && $x!=0 && $x!=false ... ) Coercing anything into boolean values is one of php's worst offenses, so it's a tad hilarious that this article mentions it as a "Feature". For instance, try evaluating 'if(1), if(0), if("1"), and if("0")'. See anything funny?
- Usable in both web and command-line contexts Usable, but different. Just different enough to make a completely useless command line program.
Built-in Functionality
- It comes with a vast array of built-in functions to do all sorts of common tasks. Here are a few off the top of my head:
- Base 64 encoding and decoding And it lacks proper i18n support at the same time. Which would you rather have?
- URL encoding and decoding My grandma could write a function to encode and decode URLs in about ten minutes. This is hardly worth noting.
- HTML character encoding, decoding and tag stripping Again, I use a library my grandma wrote for this purpose.
- SAX style XML parsing Yes. Computer languages can use SAX style parsers now. Is it really worth noting?
- REGULAR EXPRESSIONS OMG ITS IN CAPS!!! Trivia quesiton: Can you find a language made in the last 15 years that doesn't support regular expressions?
- Array sorting, custom sorting Sorting an array? Wow. That's tough shit. I had to get to CS 102 before I learned how to sort an array myself.
- md5 and sha1 hashing So, they like, copied the pseudocode from wikipedia and compiled it?
- It can natively connect to the most popular Database engines around. But it can't do so without resorting to using different functions for each database. (eg mysql_query() vs pg_query())
- It comes prepackaged with graphics manipulation capabilities (GD) No. It knows how to access a GD installation on the same system.
Irrelevant complaints^H^H^H^H^H^H^H^H^H Just a few of the complaints this article refuses to^H^H^H^H^H CAN'T refute
Now, here are some common complaints about PHP, and why the don't matter:- I don't like PHP because it's not statically typed (like my beloved Java) News flash: static typing sucks - deal. Based on the logic this article demonstrates, the static vs dymanic debate is one it shouldn't touch with a ten-foot pole.
- PHP doesn't have namespaces, so there can be naming collisions. Oh noes! Seriously, this is a theoretical objection, not a practical problem. Use a class dude - makes for a nice way to wrap your functions. This isn't theoretical in the least. See above, where querying to similar database engines use the same functions, BUT WITH DIFFERENT PREFIXES. PHP's lack of proper namespacing forces the language designers to do stupid shit like put "namespace_" in front of colliding function names, which makes the whole language even messier than it otherwise would be.
- I hate globals Globals can save your life. Globals pierce through all the layers of code and get right to the heart of the matter. You say you don't like globals, so try to remember that the next time you grab a singleton from your static factory. Globals save the lives of programmers that don't know what the hell they're doing. Note to author: Reconsider what side of that elusive "circle" you're on.
- PHP allows/promotes poor programming practices I call shenanigans on that one. PHP appeals to a broad audience, especially new coders, because it is ubiquitous. It's just as easy to write poor code in any other language (an Interface with exactly one Implementation anyone?) I'm not sure PHP allows it more than anything else, but it sure does market itself to the dumbest bunch of idiots that ever did type on a computer.