nunojob:~ dscape/08$ echo The Black Sheep

Posts tagged ‘Rails’

dreamhost insanity day

The deal was – well – insanely good.

Unlimited storage and traffic, 1 domain name (plus all the extras) for two years. If you inserted 202 as promo code you would get a final price of 11USD.

I was lucky enough to get an update from Pedro while dreamhost was working and got a great deal. Even got a new domain name I was looking for: dscape.org! Yay! I had to use Google Checkout to buy as the website was not very stable and I didn’t want to risk it with a credit card transfer.

As one would expect *not* dreamhost.com was down for most of the day after the news started spreading on twitter. Dreamhost guys called that sluggish!? A hosting company website down by self DoS attack? As Alanis Morrissette would say “isn’t that ironic?”

The only thing visible thing that dreamhost did to change this was change the price to 22USD. Whoever decided that is clearly not the brightest crayon in the box. A hosting company is about having a stable service. You never charge different prices for the same service in the same day. If you want to do an insane promo, be prepared. Is it that hard to come up with a way to get the same (or more) customers without having your website on his knees and old customers leaving your service??

Final Considerations: How many cancelled their subscriptions paying 10USD a month for this deal? How much of a money loss will that represent for dreamhost? Is this a clear sign of a urgent need for income? Is it just insanity? How much money did Google made on this (1USD per transfer)? How many new domains were registered today?

Information Retrieval using the Boolean Model in Ruby on Rails

Google reinvents the wheel

About porting Ruby on Rails to Javascript:

In an effort to increase developer productivity at Google, Steve tried to convince the company to adopt Rails (and consequently Ruby) as a programming language. When that fell on deaf ears (Google really does not want to increase the number of languages that must be supported by their infrastructure), Steve decided to do what any other frustrated programmer would do: he ported Rails to JavaScript. Line by line. In 6 months. Working 2000 hours. Steve is a coding stud.

From: Steve Yegge ported Rails to JavaScript

In this six months Steve could have contributed to the rails core and improved the framework to a great extent. If he found security issues like the article refers than he should have fixed them in rails. I cannot even begin to understand why he didn’t by the way. Or at least reported them.

My conclusion of seeing that google allowed a employee to waste 6 months of work because they don’t want to increase the number of languages that must be supported by their infrastructure is that Google is Dumb.

Steve seems like a smart guy so if I was told to rewrite Ruby on Rails by an employer I cannot understand why he didn’t – at the very least – refused to do so and pointed out how stupid it was to reinvent the wheel. I simply hate javascript and love ruby. I think javascript is the worst thing there is in the internet. That’s one of the reasons I decided to take a chance on XForms. Well but that’s a personal opinion and has nothing to do with the case!
The question is:

So will this bring something new to the web?

Yes! But it’s not that this wheel is great and the other was flat. It can bring something but just because Google has the power to do that, in any language they decide to use. They have the man power to go beyond what rails offer.

But does this make the decision less dumb?

No. They could do it in rails and improve a great open source product.
Or is it that hard for engineers at google to learn a new language??

Valid and Well-formed XML Documents in Ruby on Rails

If your working with DB2 on Rails you probably need to check if the xml document is – at least – well formed.

I found a neat plugin called validates-xml that uses REXML to see if documents are well formed.

To install it simply

svn co http://validates-xml.googlecode.com/svn/trunk/ validates-xml-read-only

And copy that folder to vendor/plugins.

You can easily integrate schema validation with a validates_xml_with_schema method. But you should use REXML as it cames with the standard ruby bundle since version 1.8.

To use it simply restart your server and

validates_xml :xmldocument

That’s it!

Yet Another Ruby on Rails Web Application – Teaser

Rails::ActiveRecord XQuery && DB2::Mac

Most rails developers use OS-X. Mostly because rails is built-in the latest release (Leopard) and TextMate offers a great IDE to use with Rails. Some could argue that it also works nicely on Windows but I really believe that Rails ain’t done to be used on a Windows Platform. Many articles and interviews with rails creator DHH second this statement. Rails is easy to develop in OS X and deploy in a Linux distro of your choice.

In my most recent screen-cast I explored an interesting technique of taking advantage of rails RESTful design and DB2 pureXML features to easily create a web-service that could query a relational databases with XML support (like DB2). As you must know DB2 Express-C is distributed freely and offers no limitation to home users/small companies. So it would be awesome to expand ActiveRecord to support xml elements, if a schema was provided to the database.

I’m aware that a pure xml database stategy would be a bad approach but there are situations when it simply makes sense. And in those situations one would profit greatly of two things wich are missing.

  • XML Support for ActiveRecord – in construction?
  • DB2 for Mac – will this ever exist?

Antonio Cangiano is creating a plugin that revolves around this concepts, but in a DB2 centered perspective. In my opinion it would be best if the rails plugin worked not only for DB2 but for any database adapter with XML support – as long as such is provided.

Let me give you a sample. Imagine that you have a database model for translating you rails application. It could be something like:

Languages

  • ID, int
  • DOCUMENT, XML

Imagine that the xml file is

<language isoname="pt-PT">
  <hello>Olá</hello>
  <bye>Até a próxima!</bye>
</language>
(...)

If this makes sense in your application then you could easily do something like register your model to observe (see observer design pattern) the session['language'] for changes and, if it’s changed, it would get all the XML for that language – it would fall back to default if such was not available – and create the hash with the values. The problem with this approach – besides making no sense for the internationalization problem! – is that in the observer model you would have to:

Language.find :first

And fetch the whole xml and then process it. If the XML document has 10MB, it would take some time. With XQuery support on ActiveRecord we could simply

Language.find :first, 
  :xcondition => ["//language[@isoname==?]", 
    session['language']]

Or, if we simply wanted to say hello in many languages – like flickr in their first page – we could simply

Language.find :first, :xcondition => '//hello'

There are just two problems that prevent rails developers from being able to do this kind of things. And those are the lack of XQuery abilities in ActiveRecord and the fact that Mac developers cannot use DB2.

METS Standard with IBM DB2 Express C using XForms as user-interface and Ruby on Rails as a Rest Web-services

HIGH QUALITY VERSION DOWNLOAD HERE

Well, here is the long promised screen-cast. The amount of topics covered is simply huge. To get you ready for the screen-cast I prepared some other more introductory screen-cast as well as some articles on these subjects. I’m sorry that I don’t have the time to document the REST, but I really advice to invest some time learning it as it’s a very pragmatic way of delivering high quality web services.

I strongly advice you to download this screen-cast from rapidshare as both Youtube and Google Videos quality is really awful. You can download it from here.

This work was really fun to do. So I hope to have the opportunity to develop it further and manage nested rest routes like /mets/1/agents to return the agents of the first submission information package (sip) using some cool DB2 pureXML features. I really feel that with a good plugin to help users take full advantage of DB2 pureXML features and a little of imagination this web-service could be of some use.

I also expect to complete the xforms model as it is not indexing a fileptr to each category when such is selected. I hope to implement this soon enough.

Here are the associated resources I developed:

And here are the other two screencasts I produced to introduce you to XForms and METS:

I also advice you to take a look at this articles. All of them where very helpful to my work.

Devolvam as passwords aos vossos utilizadores com Ruby on Rails 2.0

Uma coisa que me chateia imenso nas webapplications de trazer por casa – traduzindo aquelas que são feitas por colegas meus ou por outros amadores pela web fora – é o facto de guardarem quase sempre as passwords na base de dados em plaintext. Acho que não tem o direito de saber a password que uso, nem que a use exclusivamente nesse site (como é o caso)

Assim, se quem fez a aplicação for mal intencionado, pode simplesmente obter a vossa password escrevendo

select * from users where user.username = 'nick'

Mas mesmo que não sejam mal intencionados, outra pessoa pode aceder a base de dados. Ou podem simplesmente não se ter protegido contra sql injection. Há um milhão de razões pelas quais nunca se deve guardar as password em plaintext, sendo que a principal deles é o facto da password não ser vossa. É do utilizador. E isso faz toda a diferença! Não acreditam em mim certo? Estou a exagerar.

Convido-os a visitar esta página

Agora procurem por ‘qualquer_coisa. O resultado é

  • Pesquisa por “\’qualquer_coisa”:

Este \’ é importantíssimo pois significa que a página se esta a proteger contra ataques de sql injection. Caso contrario um hacker podia, com alguma sorte, obter informação privilegiada que estava contida nessa base de dados.

Mas ninguém faz um erro destes, certo? Errado. Vamos ao google e procurem php em páginas de Portugal. O sexto resultado, e único que testei, é a associação nacional de farmácias. Se procurarem por ‘qualquer_coisa o resultado é um não tão surpreendente erro. Isto é um exemplo de milhares, alguns dos quais onde vocês inserem as vossa password (e sabe-se lá o que mais) diariamente. Não se sentiam melhor se soubessem que nessa base de dados não está a vossa password?

Mas voltando ao assunto, a táctica que vou usar consiste em usar um algoritmo de one way hash chamado SHA. O utilizador, quando se regista no site, insere a sua password. Esta é processada (num processo que se chama de digest) para uma hash que contém não a password mas sim a encriptação dessa password em SHA. Como SHA é um algoritmo de one-way-hash, é fácil obter a hash única para qualquer palavra mas quase impossível de decifrar no sentido inverso. Para ser suficiente, mas não é.

Comecemos por ir para a consola do rails. Entrem no terminal e naveguem até onde tem a vossa Ruby on Rails web application. Agora escrevam.

./script/console

Quando lá estiverem podem verificar que aplicando este algoritmo a palavra porto obtemos sempre a mesma resposta.

>> password = 'porto'
=> "porto"
>> Digest::SHA256.hexdigest(password)
=> "01735c5ff1608734e4c38449a00b74bb9a8d5423ed548238da70178e9e803483"
>> Digest::SHA256.hexdigest(password)
=> "01735c5ff1608734e4c38449a00b74bb9a8d5423ed548238da70178e9e803483"

Não sei se repararam mas o nosso utilizador usa uma palavra pass muito fraca. Isto vai fazer a diferença, por o hacker pode obter a password facilmente se tiver a hash.

Como? Sim eu disse que era muito difícil crackar o SHA, alias não conheço ninguém que o tenha feito. Ninguém conhece :P

Mas o hacker pode pegar numa lista de palavras comuns nas passwords e, para cada uma das palavras associar a hash correspondente. Agora se tiver a vossa hash pode comparar com o dicionário que criou descobrir algumas das passwords da base de dados, aquelas que estavam na lista de palavras comuns.

Para resolver este problema usamos um salt. Um salt é também uma palavra (como a vossa password) que sera usada para evitar esta técnica. é mais simples mostrar que explicar, e por isso mesmo:

>> password = 'porto'
salt = [Array.new(6){rand(256).chr}.join].pack("m").chomp
>> salt = [Array.new(6){rand(256).chr}.join].pack("m").chomp
=> "19L6gVcD"
>> salt = [Array.new(6){rand(256).chr}.join].pack("m").chomp
=> "CqEVe632"
>> password = 'porto'
=> "porto"
>> Digest::SHA256.hexdigest(password + salt)
=> "c017e1c49096149097050c76f0406dce9245058e0d..."

De certeza que o hacker não vai procurar pela string portoCqEVe632 e, portanto, os nossos utilizadores estão seguros. Caso queiram saber um pouco mais sobre o que se passa no criação do salt, e que é aquele pack(‘m’) peçam nos comentários e eu escrevo um artigo sobre isso. Senão nunca mais saio daqui! :P.

Agora surge a pergunta, como usar esta informação em rails. Simples.

Vamos começar por criar um projecto:

rails secureusers && cd secureusers

Agora precisamos de criar o modelo de utilizador

./script/generate model User username:string \
  password_hash:string password_salt:string
rake db:migrate

Abram o vosso User.rb model, apaguem o que lá tem, e insiram o seguinte código

require 'digest/sha2'
class User < ActiveRecord::Base
# usei o attr_accessible em vez do
# attr_protected :password_hash, :password_salt
# porque é boa prática em Rails usar o enabled para 
# os campos acessíveis e não o contrário.
#
# Imaginem que tinham um campo isAdmin e se 
# esqueciam de por no protected.
# Ao dizerem que enabled só o :username impedem 
# o acesso a todo e qualquer outro campo,
# excepto aqueles que foram explicitamente 
# escolhidos por vocês.
  attr_accessible :username
  attr_accessor :password

  def before_save
    unless password.blank?
      salt = [Array.new(6){rand(256).chr}.join].pack("m").chomp
      self.password_salt, self.password_hash = salt,
      Digest::SHA256.hexdigest(password + salt)
    end
  end

  def self.authenticate(username, password)
    user = User.find :first,
        :conditions => ['username = ?', username])
      if user.blank?
        raise "O utilizador não existe"
      elsif Digest::SHA256.hexdigest(password + user.password_salt) != user.password_hash
        raise "A autenticação falhou"
      else
        user
      end
  end
end

Usei o attr_accessible em vez do protected porque considero esta uma boa practica. Prefiro dizer quais os campos acessíveis que quais os que se deve proteger. Assim não corro o risco de me esquecer de proteger algum campo. E os que são para ver nota-se bem quando faltam :P Podem ler mais sobre isto aqui.

Depois de toda esta explicação o código deve ser muito facil de entender. Até para quem não sabe Ruby. Vamos testar?

>> nuno = User.new
=> #<user id: nil,
  username: nil,
  password_hash: nil,
  password_salt: nil,
  created_at: nil,
  updated_at: nil>
>> nuno.username = 'nuno'
=> "nuno"
>> nuno.password = 'porto'
=> "porto"
>> nuno.save
=> true
>> nuno
=> #</user><user id: 1, 
  username: "nuno",
  password_hash: "c490ea11d96be24ece2ca0dba11d84fc9b...",
  password_salt: "V+b7Sqjh",
  created_at: "2008-02-12 19:28:54",
  updated_at: "2008-02-12 19:28:54">

E agora autenticar:

User.authenticate 'nuno', 'porto'
=> #</user><user id: 1, 
  username: "nuno",
  password_hash: "c490ea11d96be24ece2ca0dba11d84fc9b...",
  password_salt: "V+b7Sqjh",
  created_at: "2008-02-12 19:28:54",
  updated_at: "2008-02-12 19:28:54">

Fixe. É so por no session[:user] ;) Para finalizar aconselho-vos vivamente a suportarem open-id para o processo de autenticação dos utilizadores. Existem plugins muito bons que o fazem, e podem ler mais sobre open-id no seu fantástico guia supersónico.

e-archia.net

Bem a minha primeira aventura em rails chegou a metade. Quem estiver interessado em ver as sources, pode sacar este não-tão-pequeno ficheiro. Senão fica aqui a screenshot. O site não está online porque eu, com a pressa, não tenho a certeza ser fiz escapeHTML ao texto que vem da base de dados. Ficam as screenshots:

Working different models in the same form on Ruby on Rails

Well it’s been a heck of a week, loving somethings on rails and hating others :P

Anyway I had a problem with working with different models on a form. If you are having the same kind of issues I’ll give you some pointers:

My notes file is so big I think I’ll never solve all those issues. *g* Anyway another pointer I can give you is to check out haml. I didn’t used it but it sure is simpler than html.

Random in Ruby on Rails

So your doing a find on your model and you want a random instance. I didn’t find a method to do this so I decided to make my own.

In this case I wanted a random quote. So after generating the model all I had to do was:

def self.random
  Quote.find_by_id rand(Quote.count) + 1
end

And now you can simply call your random quotes in any controller action you desire. Just

@rquote = Quote.random

If this is the lamest ruby ever please feel free to give me some feedback :) I will be delighted to learn a different way!

[EDIT: Discussion about this at Rails Core]

This version of RMagick was created to run with ImageMagick 6.3.3 but ImageMagick 6.3.8 is in use

A paciencia tem os seus limites e vou dormir. Se entretanto alguém descobrir a solução para isto peço-lhe o favor de me deixar nos comentários.

The Rails Way

Livro novo para ler. Darei feedback quando acabar, estou bastante feliz por ter a oportunidade de o ler!

Rails is more than programming framework for creating web applications. It’s also a frame-work for thinking about web applications. It ships not as a blank slate equally tolerant of every kind of expression. On the contrary, it trades that flexibility for the convenience of “what most people need most of the time to do most things.” It’s a designer straightjacket that sets you free from focusing on the things that just don’t matter and focuses your attention on the stuff that does.
To be able to accept that trade, you need to understand not just how to do something in
Rails, but also why it’s done like that. Only by understanding the why will you be able to consistently work with the framework instead of against it. It doesn’t mean that you’ll always have to agree with a certain choice, but you will need to agree to the overachieving principle of
conventions. You have to learn to relax and let go of your attachment to personal idiosyncrasies when the productivity rewards are right.

Skitchcast: Ruby Gems is now on v1.0

Here how to update your gem to 1.0 and RoR to 2.0.2

From Ubuntu/Windows to Mac OS-X Leopard

I just got my first brand new MacBook and, as one would expect, some problems emerged by leaving my usual OS combo (Ubuntu/Windows) for Mac OS X Leopard. I’m still undecided whether to install Ubuntu or use VMWare Fusion to use Linux. As for Microsoft Windows as long as I don’t need to use .NET I don’t think I’ll install it. Not even with the free licenses Microsoft provides University of Minho students.

First I had to decide what to install:

The question you are probably asking is why Firefox instead of Safari!? Because the damn unsafe add-on for del.icio.us is just that: del.icio.us! I just can’t live without it. Maybe if the guys over there worked the basics of security we could say that it’s both excellent and safe! And don’t say there’s a add-on for Safari as well. I’ll only accept it if the add-on is as good as the one provided by Yahoo.

Now we go for the fun part. The problems and solving them. Your attention please, this is only fun for me when I do it on my computer so it won’t be pleasure if you ask me to fix your computer! Joana this one is for you, I know how your mind thinks.. Almost as badly as mine. Oh well, we are related aren’t we? :\ Please release those crazy Christmas photos to the world! :X

I’ll start with a small OS free tip and then go for the Q/A part. If you are Portuguese like myself you just hate all the results that google gives you from .br domains. Most of the results are overrated and most of the times you just wish that they weren’t there. If this is the case just do your normal search in google but write -br in the end. Just test this, go to google and type governo brasileiro -br. It works ;)

  1. How do I get my mouse to behave like a normal one by removing this dreadful acceleration?

    Easy. Check Rúben’s blog @ http://blog.0×82.com/2007/12/mac-os-and-usb-mouse.html

  2. What’s wrong with the encoding on TextEdit? The automatic descovery does not work and even when I specifically tell him to use this encoding it won’t work. The Where is ISO 8859-15 dilemma.

    Still don’t know. Anyone? If you want to test the bug just do this (from here):

    $ echo é > ~/a.txt
    $ cat ~/a.txt
    é
    Open a.txt with TextEdit and get:
    È

    Cracked it! At least I have a partial fix for Migrating documents from Ubuntu to Mac OS X Leopard:

    cmd + space terminal enter

    {go to the directory where the file is}

    bash$ iconv -f ISO-8859-15 -t UTF-8 {filename} > UTF8-{filename}

    For me it was:

    bash$ iconv -f ISO-8859-15 -t UTF-8 Pam.tex > UTF8-Pam.tex

    And yes PAM is as in Pluggable Authentication Modules. So I have a latex work on that :P

    
    
  3. Where is type-a-name application? It’s not on the dock.

    Just press cmd + space and type what you are looking for. This is called spotlight. Either this or open Finder and go to applications.

  4. Why doesn’t it show my dashboard when I go to the left/whatever corner?

    Have you even configured your mac? Common.. Click the apple on the top left corner and go to System Preferences. Exposé and Spaces. And now that you are there take a look around and configure all the other things that you neglected.

  5. This computer is always underlining the words in red. (when the spelling is right :P If not you are a dumbass for asking this!)

    Just press cmd + mouse and change the language. Thanks Nuno Veloso from Apple Tech Team for this tip.

  6. How can I see the right mouse button menu?

    crtl + mouseclick

  7. PageUp/PageDown!?

    fn+ up
    fn + down

If after this you still feel like reading about Mac OS for rookies – like myself – you can check this section in Arun Gupta’s Blog or check this extensive list of Keyboard Shortcuts. Have fun!

Now let’s get back to work, something almost impossible when your doing a report on LaTeX and the encodings are never right.

One final touch: ctrl + alt + cmd + 8. Merry Christmas! :)

Ruby on Rails vs Java

Netbeans 6 RC2 Uninstallation Issue

Well i have been using Netbeans IDE Beta 1 for some time now.

I was using it to develop some Ruby on Rails projects. Some days ago I was in cryptography classes and tried to use the Apache Tomcat support for the Netbeans Beta 1. As I found out there was some bug in my way I decided to download the new RC2 and see if the issue got fixed in the meanwhile.

That when I first tried to uninstall Netbeans Beta 1. I got this error and still don’t know how to fix it. So I submitted it to Netbeans Community as a bug.

Anyone with the same problem got it fixed?

[UPDATE: Solution here]

I know that I have recently said that Netbeans has the best support to work on Ruby on Rails. It does. But just don’t use the beta. It’s crappy. If your on 512mb of RAM like me your computer will hate Netbeans Beta. I don’t even know if they will ever get this fixed. (Maybe a lightweight version of Netbeans is in order)

Is there such thing as the perfect IDE? We should be focusing on developing not on the IDE.

As voltas com os estudos

Acho que já se notou que não andava muito feliz com o mestrado. Como se costuma dizer, quem está mal que se mude. Foi o que fiz.

Troquei a unidade curricular de especialização de Análise e Concepção de Software pela de Criptografia e Segurança de Sistemas de Informação.

Primeiro aula (para mim claro) andamos as voltas com o JBoss. A conclusão que cheguei foi que no meio de tantos xmls de configuração qualquer um se perde e mais vale usar o Apache Tomcat! Será que não aprendem com o Ruby on Rails? Convention Over Configuration! :P Não gostei muito da forma como se criam estes webservices. O facto de termos que andar com ficheiros de configuração para trás e para frente (cliente/servidor), sermos quase obrigados a programar em Java. Era bem mais fixe se estes webservices servissem xml como respostas a pedidos, por exemplo, e que depois fossem enclapsulados numa classe de forma a responder para cada linguagem de programação. Não que perceba nada disto, ainda estou muito verdinho.

De qualquer forma fica um pedido. Se alguém conhecer um bom guia para iniciantes em JBoss diga qualquer coisa. A gerência agradece!

DB2 Express-C 9.5 Released

A new version of DB2 Express-C was made available by IBM today. As you might already know DB2 Express-C is a free dataserver without limits on database size or number of users.

We got this news from

You won’t find this new version on IBM DB2 Express-C Website, but you can download the Linux Version here and the Windows Version here.Mac version is still not available. This is probably the down side as many of us are waiting for IBM to ship a Express-C DB2 version for Macintosh. Hopefully next time?

I still didn’t tested the new DB2 but according to Antonio

Version 9.5 brings to the table a great deal of new enhancements and features. Among these there is also the reduced amount of memory requirements and the improved efficiency of operations on Linux. Oh and it will also make you rich and more beautiful. I mean, pureXML support has been greatly improved and it is a release that is sure to please many people on both Windows and Linux.

I know the t-shirt looks great. Hopefully Vítor will send me one! :P

De volta aos carris

Estou a ler o livro Ruby in a nutshell do Yukihiro que é um dos dois únicos livros que a biblioteca da minha universidade tem sobre Ruby mas, infelizmente, não se apropria a um iniciante como eu. Então andava a aprender pelo help. Não acredito nessa do estuda rails e aprende assim Ruby.

A linguagem primeiro, a framework depois.

Só que existe um pequeno problema. Na biblioteca da Universidade do Minho existem tantos livros sobre Ajax como livros sobre Rails. ZERO!

Por sorte andava por entre o Twitter e o greader quando encontrei um livro para iniciantes em rails de graça! Nos próximos 58 dias quem quiser o livro Build Your Own Ruby on Rails Web Applications pode sacar-lo AQUI. Claro que a oferta apenas vale alguma coisa se o livro tivesse qualidade mas, ao que parece, tem. Pelo menos a ver pelas reviews que andei a ler.

OFF-TOPIC: Quem achar giro programar direct3D em .NET pode ler uma iniciação neste artigo.

UPDATE: Já estou a ler o livro e aviso desde já que a parte que ensina Ruby e OOP está medíocre. Leiam algo sobre Ruby antes de lerem este livro!

Life on the rails

I found Ruby in a talk with one of my friends. We were talking about how a problem that can be solved in Haskell in one line of code, could take hundreds to do so in Java or C#. It was obvious that, for some specific problems, Haskell was simpler and adequate.

Want a sample? Code permutation with n levels in C.

perms xs 0 = [[]]
perms xs n = [ p : ps | p <- xs, ps <- perms xs (n - 1)]

And like this he introduced me to Ruby on Rails. I was very thrilled to see a language that is dynamic, object oriented and adequate for web developing. I immediately thought about learning it, I just love learning new languages.

Today I checking my feeds and found a post about seven reasons to switch back to PHP (from Ruby).

It seems Ruby is like Haskell: the code looks greats and promises a lot, but it still doesn’t get where imperative languages do. (I’m still going to learn it, I just can’t resist it)

For now I’m waiting for a language that joins all that is good from imperative, functional, logic and object oriented paradigms.

If you know such programming language leave it as a comment.

 

 

PHP $61,000

 

Ajax $76,000

 

Ruby $70,000

 

Java $77,000

 

C# $78,000

 

Haskell $52,000

 

View Larger Salary Graph

Follow

Get every new post delivered to your Inbox.