There’s a great article sys-con.com called: Why Do ‘Cool Kids’ Choose Ruby or PHP to Build Websites Instead of Java?
I’ve been developing desktop and web apps in Java for a fair few years and I’m no Java-basher by any means. But when I’ve built stuff in my spare time I’ve always used PHP, so I guess I kinda fall into the article’s cool kids category. Before I give my reasons for not using Java for spare-time projects I thought I’d post some of the great FUD from the cool kids article:
PHP and Ruby etc are cool for building pages, but they are not ideal candidates for building middleware logic. Given that Java covers the “high end” of the spectrum well (where sophisticated processing is needed), wouldn’t it be great to use Java all the way?
PHP, Ruby etc not good for middleware logic? I’d say that as languages, Ruby and Python are ahead of Java in terms of functionality – they both have rock-solid OO support and functional programming features like closures that are still not in Java. PHP is a bit behind but as of version 5 it also has sold OO capabilities. It’s simple enough to write well-structured classes and build code using well-known design patterns using Ruby, Python or PHP so I really can’t see how they are not suitable for middleware.
Is it Java as a programming language too difficult to use, comparing with those scripting oriented interpreted languages? Yes, this maybe the reason.
WHAT THE FUCK? On syntax alone I’d say that Ruby is the most difficult to pick up. The only reason I would consider Java more difficult to learn is that it’s strong-typed and a beginner would have to learn about casting, generics and so on. And I guess the insistence on abstracting everything to the nth degree does make for more verbose and more difficult to learn and remember syntax. This is Java-snobbery in action.
JavaServer Faces: JSF is the new kid on the block. Is it going to make building websites easier? Probably not. It is designed for simplifying building form-based applications.
If there’s one thing that turned me off from Java web development it’s JSF. I just cannot buy into it at all. How anyone can say that JSF simplifies anything is beyond me. I know JSF2.0 fixes a lot of 1.x’s problems but boy were there a lot of problems. Tons of Javascript injected into in each page just to make the basics work. POST requests for everything, this beggar’s belief, it breaks basic navigation and made it impossible to bookmark a page. Duh.
The scripting languages are pretty easy to learn, and lack the complexity of Java (generics being an exquisite example of that). To learn Java, it’s not like just picking up a book and having all you need to begin developing. This is the polar opposite of scripting languages, where a short book or online tutorial will provide all you need to begin. After all, many people would rather die than learn something new. And Java takes some effort to master. Whereas with a scripting language, the basics are easy and then one simply needs to learn about other “packages” or plug-ins.
This is a snippet from the first comment and this is real FUD-gold. Generics an exquisite example of complexity? I think the commentor, raysea, needs to go and find out why generics don’t exist in Python, Ruby, etc. The rest of this comment is again pure Java snobbery.
OK, a lot of websites are fairly simple, mainly composed of markup pages, scripts and some lightweight logic on the server side, where PHP and Ruby are good for. Java maybe an overkill for such websites. But there are a lot of websites that are much more sophisticated than “lightweight” logic on the server side. For example, FaceBook was relatively simple initially, but now with FaceBook API and Platform, its complexity is growing. Why not use Java for such websites?
He uses Facebook as an example of a sophisticated Java app but this is such an extreme example it’s not worth thinking about. How many people are using Java to build sites with Facebook’s complexity and scalability requirements? Next to none. So where is this extra sophistication that Java provides being used? People use the example of intranet sites with lots of controls. Is that harder in Ruby? Nope. And besides, same question as before: how many people are building intranet sites versus extranet ones? I find it hard to see many examples where I would need Java to build a site.
So why do the cool kids shun Java web dev?
For me, it’s simple: Because the cool kids what to get things done quickly and cleanly and they know full-well that their Ruby, Python or PHP app running on Apache will fly. The other reason is that Java web frameworks have mostly become bloated monsters that abstract everything to the nth degree and required a lot of XML config whereas Rails, CakePHP and Django have mastered the art of quick and painless web dev.
I don’t doubt that Java running on Tomcat will outperform PHP on Apache but unless you are writing the next Twitter it really doesn’t matter – unless your app becomes super popular you are never going to reach the limit of a scripting languages performance.
Well, I’m going back to Java from PHP
Java’s saviour has arrived. The Play framework takes the best ideas from Rails etc and offers a Java framework that eschews complexity, configuration and bloat and lets you concentrate on the job in hand: building great webapps.
If the energy people expend dancing and working out can power cellphones, lights and other electrical appliances, why not apply the same concept to all the energy spent by millions of people every day simply walking along city sidewalks? That’s exactly the premise behind Pavegen slabs, which can be inserted among regular sidewalk sections to capture the kinetic energy people spend just walking.
Each rubber slab from UK-based Pavegen Systems gets depressed by about 5 mm each time it gets stepped on. Using just that small movement, it can convert the kinetic energy used into electricity, which is then stored in the slab. Specifically, 5 percent of the energy harvested is used to make the slab’s LED glow, making it clear to users that their energy has been captured. The rest can be used to power pedestrian lighting, information displays and many other applications. Pavegen’s patent-protected technology has also been used to harvest energy from users’ footsteps on stairs; custom branding is available.
Following recent tests in East London, Pavegen is now seeking both investors and additional testing sites for its eco-iconic innovation. One to get in on early…?
Website: www.pavegensystems.com
Posted January 25th, 2010 |
Published in Asides
All I ask of you is one thing: please don’t be cynical. I hate cynicism — it’s my least favorite quality and it doesn’t lead anywhere. Nobody in life gets exactly what they thought they were going to get. But if you work really hard, and you’re kind, amazing things will happen.
—Conan O’Brien on his final show.
Posted January 24th, 2010 |
Published in notblog
Something a bit different.
I thought I’d start trying to style some posts a bit differently and try and get away from the usual blog style of content-with-sidebar-you-might-also-like-RSS-share-this kinda thing.
Using some Wordpress plugin awesomeness I’m free to style a page how I want.
This is the first attempt at something different. It’s using 960.gs and jQuery. If you’re reading this in an RSS reader or on the home page then jump over to the post proper and check it out. I’m quite pleased with the way it turned out, the 960.gs grid keeps everything nicely uniform when elements are removed.
Styling posts is just really a chance for me to dick about a bit with CSS and Javascript but one element of blog design that I think really does need a shot in the arm is sitemap pages. Most people just have a list of post titles, sometimes grouped by category, but often just one big list. Not very user friendly.
We went to buy a new bed the other day. We’d already seen the one we wanted and we knew how much it was going to be.
So, we went into the store and had one final look at the bed to make sure it was the one we wanted. The price was £369, the same as in the brocuhers we had looked at. All good.
We went to the sales desk and told the salesperson which we wanted. She checked stock and took our details. And then: “OK, that’ll be £405 in total, please”. Now, beds are big and heavy items and I should have probably expected a delivery charge but it hadn’t even crossed my mind that I would be paying anything more the £369. Nowhere in the brochures or in store were any prices quoted as being + delivery.
I argued a bit about the extra charge and I thought 35 quid for delivery was a bit steep. Apparently the delivery charge was such because they had to travel a fair distance from the warehouse – not my problem. We couldn’t have the bed delivered to the store and pick it up from there, “no storage space” apparently.
By this time I was pretty p*ssed off to say the least. She still made the sale this time but lost any future custom from us. She also lost any word of mouth advertising.
Posted January 21st, 2010 |
Published in linux
The curse of the Linux shell history command strikes everyone, me included.
I’ve seen people fall into historical hell many a time…
You’re working in a shell and you need to run a command that you know you’ve run before, you know it. goddamit it, you’ve definitely run this one before. The command you want is at least 20 chars long and it’s just too much to type, so you either:
- Don’t find the command as you keep up-arrowing through your history. By the time you’re bored with the up-arrow, you’ve pressed it at least 40 times and you could have re-typed the command you were looking for in full by now, twice.
- Use CTRL+R and start to re-type your command so that the shell will find it in your history. And it doesn’t. So you type more. Still doesn’t find it. And then, as you fill out the command to find it, you’ve re-typed the whole thing anyway.
ThemePerPost is a Wordpress plugin that lets you change your blog’s theme for individual posts or pages.
ThemePerPost is ideal for people who want to style their about page, create a unique landing page, show theme previews for design showcases, split one Wordpress install into multiple sub-sites. It’s for anyone who wants to have posts and pages with different styles.
You can create your own small one-file themes or you can use any existing theme.
You can download it from this Wordpress page or you can check out the ThemePerPost page for more info. If the plugin isn’t working right for you or there’s something that needs changing/improving then give me a shout. I’d love to hear from you.
Posted December 27th, 2009 |
Published in Wordpress
I’m working on a Wordpress plugin that allows you to switch themes on a per-post or per-page basis. That’s why this page looks different, I’m trying the plugin out here before releasing it.
The idea is that you upload a new theme into the usual Wordpress theme directory. You can use this theme for a single Post, a single Page or more of either. You specify which Posts/Pages are to use a theme other than the WP default by using a Custom Field. All you have to do is enter the theme’s name in the Custom Field value and the theme of that name will be used for the Post/Page it’s entered on.
I’m fairly sure there will be something like this out there already but when I tried to find a theme switcher all I could find was plugins that switched the whole theme.
Go back to the home page.
One of my goals for 2010 is to just do it. I released Squareleaf this year and it taught me a few things:
- It doesn’t pay to be a perfectionist – All websites have bugs, you just haven’t found them yet. A few were found in Squareleaf in the first few weeks, I was disappointed, and while it may have driven away some potential sign-ups it was ultimately a good thing. I got emailed by people to tell me what was going wrong and this meant they actually gave a shit enough to send an email. Cool. If I was still looking for perfection with Squareleaf it would still not be released. As it is, it’s out there with a couple of bug fixes and some new features, 400+ users and some good suggestions from them for new features.
- Release early and release often – Get it out there. See what people think, get feedback from people who will use it. See if you have an audience and how big it is going to be. Stop worrying about the details – most of the time people don’t care.
- The hardest step is the first one – The biggest hurdle is releasing something for the first time. Is it going to be shit? Will people hate it? I was bricking it when I released Squareleaf and emailed some friends and colleagues to ask them to check it out. It’s better to try and to fail than to not try at all.
So, from now on I’m not going to waste time worrying about perfecting the small details. I’m not going waste time wondering if an idea will work – if an idea for an app/product/service/whatever doesn’t require any serious time or money investment then I’m just going for it. Suck it and see.
I released two apps last year and carried on my two blogs. In 2010 I want to be putting out a lot more than that.
There’s always so many reasons not to do something – next year, forget the reasons and just do it.