Archive for the 'web' Category

My “Wow!” moment learning Ruby

Friday, January 12th, 2007

I´m a absolutely beginner in Ruby, but recently, after I changed to my new web host, I was tempted to make a try.

My background is mainly in Java language, with some SmallTalk just because since I left my graduation, I never saw a so beatifull syntax. And until now, I write sometimes somethings in SmallTalk, when I need to think about the problem in hand without worry about the environment or language little tricks and details. After all, I think compiled and typed languages are doomed to become history.

My new web host gave me a lot of space and bandwidth, but only 2 practical choices of programming languages for dynamic web sites: PHP or Ruby. For personal reasons I hate PHP (please, I don´t want to start a flame war about what is the best language, this is just my personal opinion). My first job was about programming in PHP, and I don´t have good memories…

I´m studying right now, and for the people which come here looking for Java tips or tricks, I want to say I had a ‘Wow!’ moment right now. Look for this little piece of code:

1.class Product < ActiveRecord::Base
2.
3.	validates_presence_of :title, :description, :image_url
4.	validates_numericality_of :price, :only_integer => true
5.
6.	protected
7.	def validate
8.		errors.add(:price, “should be positive”) if price.nil? || price <= 0
9.	end
10.end

Don´t worry about what this code do. But the syntax is very cool, isn´t it? For me, some constructions doesn´t seem so strange, because they look like Smalltalk, but for a JavaMan… You can see the ‘if’ block? Or the method call in a null reference?

I see you in my next “Wow!” moment…

The web noise

Friday, November 17th, 2006

When I´m again starting a new mega-over-ambitious web project, I ask myself the same question: “What´s is the f&*%ing reason for doing a web oriented project, if this project should be a very tiny, nice desktop project”? Maybe because doing it in a web way is sexy, a tech fashion. Maybe I´m starting to become a old guy with old ideas, but when we stop to ask reasons and start to do things using “best practices” or “experts recommendations” without thinking about, something is very wrong.
Some great pros of thin clients are low deployment costs, low hardware requirements, distributed and parallel platform almost for free.
Some cons of web solutions: the everyday fight against the HTTP stateless protocol, the browsers lack of standards.
Some pros of rich clients: rich user experience (you are in control of every pixel on the screen).
But there are great means to low the deployment cost of desktop applications. The Java Web Start Technology is under used, but a great to glue all together.
The nature give the most simple answer which works, and in development isn´t different. If the desktop development was the first to appear, it was because
it is the most simple solution which works. The tendency to create only web applications today is increasing the projects costs,
and helping its younger death.
When starting a new project, think about. What your opinion?

Great RCP toolkits for Java: Netbeans and Eclipse.

Great Web applications for Java which FAKE a desktop: WingS and Echo2.

Web Standards X The Browser Nightmare

Tuesday, November 14th, 2006

Why we yet suffer with browsers which doesn´t support web standards?
There are standards, and the responsible organization is the W3C .
If your browser doesn´t follow web standards, complain with your browser supplier, don´t curse the poor web designer, who did a good work learning, researching, to make a modern web site. Welcome to the 21st century. There a list of browsers to you make a upgrade.
If you are starting a new web project, and your manager or client aren´t aware of standards, caution! Stop everything, explain the reasons, there is a lot of them around.

I already worked in very poor standarlized projects. I konw what I´m saying.

My 2 cents.