Earlier the focus was the machine. Days are gone when we thought so much about saving an extra byte, trading code simplicity for speed. A compromise here, a saving there, ad infinitum.
The focus has definitely shifted to human understandability. Beauty of code now lies in its simplicity (some folks would argue that it always did, and they're right, but its more so apparent now).
First it was Ruby, then Rails, and now BDD frameworks like rSpec and Cucumber prove the point. Just have a look at these executable code examples.
Ruby
animals = [ "Tiger", "Cow", "Python", "Horse" ]Does a C for loop or C++ iterator look more elegant?
animals.each do |animal|
puts animal + "is cool!"
end
#=> Tiger is cool! Cow is cool! ...
Rails
class ProjectCode that you can just read, isn't it?
belongs_to :portfolio
has_one :project_manager
has_many :milestones
has_and_belongs_to_many :categories
end
rSpec
lambda {Yes, that's a real executable example.
employee.develop_great_new_social_networking_app
}.should change(employee, :title).from("Mail Clerk").to("CEO")
And now, Cucumber
Scenario: Search by topic
Given there are 240 courses where neither has the topic "biology"
And there are 3 courses A,B,C that each have "biology" as one of the topics
When I search for "biology"
Then I should see a the following courses:
| title |
| A |
| B |
| C |
More beautiful, more succinct, more concise. That's what programming has evolved to be.