dastels @ 9:02 pm
With my move to Google, I’ll be in a mixed Linux/OSX environment… so it makes sense to me to revisit emacs for my day-to-day programming.
With some help from zenspider and technomancy, I have the latest carbonized emacs up & running with a nice ruby/rails environment (rinari)… and of course… the zenburn color scheme.
Tags: emacs programming
dastels @ 7:36 pm
I just added a confirmation dialog to a cancel button on an app that I’m working on. I tested it and stopped for a second as I read the dialog.. then broke out laughing.
|
|
What do I press if I really do want to cancel?
|
Tags: programming wtf
dastels @ 10:34 pm
I’ve turned on comments… with fairly heavy moderation… we’ll see how it goes.
Tags: announcements blog
dastels @ 10:29 pm
Tonight I was exploring the current state of RubyCocoa (and it looks good), and I noticed a quote from Knuth’s “The Art of Computer Programming”, his 1974 ACM Turing Award Lecture.
Paul Graham has the text of the full lecture here.
This is a great talk, and should be required reading for anyone calling themselves a programmer. I found the last section, especially interesting.. here’s what I consider to be the core bit form it:
“Therefore I want to address my closing remarks to the system programmers and the machine designers who produce the systems that the rest of us must work with. Please, give us tools that are a pleasure to use, especially for our routine assignments, instead of providing something we have to fight with. Please, give us tools that encourage us to write better programs, by enhancing our pleasure when we do so.”
It struck me that Ruby and recent systems from Apple fill Knuth’s request quite nicely. According to Wikipedia, Knuth uses Macs.. I wonder how he thinks they answer his challenge from ‘74. I wonder what his view of Ruby is… Anyone heard anything about that?
Tags: apple programming ruby
dastels @ 11:37 pm
Steve Jobs isn’t the only one who can quote Dylan.
… speaking of Steve Jobs and changin’ times… I may be bumping into Mr. Jobs at the local Cupertino Starbucks before long…
Next month I’m heading to California… Silicon Valley to be specific.
After over 3 years of saying “I’m not interested” to Google, I’ve accepted their offer of a position. I’m not sure how public I can be yet about what exactly I’ll be doing… but it will leverage my experience and expertise in Agile Development, TDD, Ruby, Rails, and RSpec.
This change is not without some sacrifices, but we think it’s the right move at this time. One downside is having to end my association with Obtiva… which I have greatly enjoyed. They’re great people and great to work with.
One benefit is that I won’t be having to focus so much on billable hours to cover the bills anymore… so there should be more time for things like RSpec and writing.
Tags: announcements business google personal travel
dastels @ 1:45 pm
Here’s an article I wrote a while ago but didn’t get around to releasing. Enjoy.
Describing Equivalence Classes in Ruby with RSpec
Since writing that article, I’ve made good use of the code. Here’s an example of it in action: grouping the cards in a deck into their types. A second method then uses those groups to reassemble the cards into an ordered list.
CARD_TYPES = ['basic land', 'land', 'creature', 'artifact',
'enchantment', 'sorcery', 'instant', '']
def maindeck_cards_grouped
maindeck_cards.equivalence_classes(*CARD_TYPES) do |card, the_type|
card.magic_card.card_type.downcase.include?(the_type)
end
end
def maindeck_cards_ordered
cards_by_class = maindeck_cards_grouped
(CARD_TYPES.inject([]) {|cards, type| cards << cards_by_class[type]}).flatten
end
Tags: rspec ruby
dastels @ 11:56 am
Voting starts Wed, Oct 12
There are loads of cool applications.. go check them out and place your vote.
Our application is here. It’s not the typical Rails application. Be sure to have a look at the manual first.
Tags: rails rumble
dastels @ 10:18 pm
The stats for our project:
+----------------------+-------+-------+---------+---------+-----+-------+
| Name | Lines | LOC | Classes | Methods | M/C | LOC/M |
+----------------------+-------+-------+---------+---------+-----+-------+
| Controllers | 70 | 55 | 2 | 6 | 3 | 7 |
| Helpers | 6 | 4 | 0 | 0 | 0 | 0 |
| Models | 891 | 734 | 13 | 110 | 8 | 4 |
| Libraries | 0 | 0 | 0 | 0 | 0 | 0 |
| Model specs | 2283 | 1835 | 0 | 0 | 0 | 0 |
| View specs | 0 | 0 | 0 | 0 | 0 | 0 |
| Controller specs | 0 | 0 | 0 | 0 | 0 | 0 |
| Helper specs | 0 | 0 | 0 | 0 | 0 | 0 |
+----------------------+-------+-------+---------+---------+-----+-------+
| Total | 3250 | 2628 | 15 | 116 | 7 | 20 |
+----------------------+-------+-------+---------+---------+-----+-------+
Code LOC: 793 Test LOC: 1835 Code to Test Ratio: 1:2.3
A few things to notice:
- very “rails” light… small controller… very literally a controller.. all the action happens in the models,
- all the specs are for model classes, the controller & view do very little.. although the controller could probably do with a few specs, and
- there’s over twice as much code in the specs than in the working classes.
The spec run:
$rake spec
(in /Users/dastels/Projects/Ruby-Projects/merlin/trunk)
..........................................................................
..........................................................................
..........................................................................
........................................................
Finished in 62.891545 seconds
278 examples, 0 failures
and the coverage report:
|
|
Note that echo was under development and actually didn’t get finished in time. Also we ran out of time before getting to mindbender.
|
Tags: rails rumble