Posted by Jacob Harris
Fri, 27 Jul 2007 01:20:00 GMT
After months of rehearsing and revising, I finally gave the talk at OSCON. I think it could use another month of refinement, but people seemed to enjoy it, and I actually enjoyed giving it as well. If you were at the talk, thank you for coming and feel free to let me know if you have any feedback or questions.
My talk was Rails Under the Knife, a look at the some of the internals of Rails to get a better idea of 3 powerful Ruby techniques:
- Metaprogramming
- Reflection
- Blocks
You can download the slides at
This talk is aimed at an intermediate Rails programmer who knows the basics of Rails coding (I have another similar talk for beginners called Rubyisms in Rails), but still is a bit unsure about the power trio of serious Rails hackery. Hopefully, this will help to provide some inspiration for you to delve into the Rails code on your own. Enjoy.
Posted in Programming | Tags oscon, rails, ruby | no comments
Posted by Jacob Harris
Wed, 02 Aug 2006 16:46:00 GMT
I am pleased to announce that the digital shortcut PDF version (to purchase, you have to go to the Digital Shortcuts page or you can buy it from Safari Sorry!) of my Rubyisms in Rails presentation is finally available for purchase. At 54 pages in length for the low price of $9.99, I guarantee you’ll glean at least 18.5 cents of insight from each page (disclaimer: that’s a mean instructional value; although gorgeous, the title page is not particularly educational in itself).
In addition, the book is also now available in Safari Books Online, and possibly Amazon or other retailers as well. Also, be sure to check out the list of other upcoming Ruby titles.
So, what’s in it? If you’ve read the original presentation, you already have a sense of the scope of material I am covering here, but the shortcut allows me to focus on the material in greater depth. The result is a richer and more thorough examination of the examples presented in the original slides. If you are an intermediate to advanced Rails hacker, you probably know all this stuff already. But if you are a newcomer to Ruby through Rails, or you still find yourself still stuck coding PHP or Java-like Ruby, this ebook might help to align your thinking to the Ruby way.
Will I write another ebook? I’d say yes, but I’ll have to think up another interesting topic. But if you are ever thinking of creating a technical book, I’d recommend starting in a smaller dose like this first. As I discovered, even 54 pages can be a lot of work, and it’s better to test out your time commitments and abilities with something small before you start pitching large references. But that’s a topic for another blog posting. Make me happy: Buy the ebook or read it on Safari and give me your feedback. Thanks!
Update
Fixed purchase link to be go to Shortcuts page (where you can add to cart).
Posted in Books, Web Coding, Programming | Tags rails, ruby, rubyisms | 10 comments
Posted by Jacob Harris
Tue, 25 Apr 2006 17:44:00 GMT
In an apparently blatant attempt to be more like Amy Hoy, I’ve decided it’s time I did some Intro to Rails writing. Tonight I’m going to be giving a little talk on what I’m calling Rubyisms as seen in Ruby on Rails. I think one of the things that makes Rails so cool is how it is built upon some of the best aspects of Ruby’s style: duck typing, symbols, blocks, and metaprogramming. And yet, I think many newcomers to Rails don’t really notice some of the magic going on behind such simple declarations as
<% 30.minutes.from_now %>
or more complicated Rails cases like
class Review < ActiveRecord::Base
belongs_to :article
validates_presence_of :author
end
My humble little slideshow goes out to those Rails newcomers hacking code to look like PHP or Java. The conceit is to use some sample Rails code as starting points for deeper explorations into some of the Ruby coolness lurking inside Rails. This is a nice little look under the hood, but I hope it will educate people new to Rails on how to embrace Ruby style for cleaner and cooler code.
I’m posting the slides early for some last minute feedback and I might update these files if any other errors are found. I’d like to thank NYC.rb compatriots Sebastian Delmont, Ryan Raaum, Trotter Cashion, and David Black for their help and corrections as well.
The presentation itself is two parts. I’m releasing it here in two style. The light version is stripped of interstitial chapter screens and is a lot easier on the bandwidth:
If you like what you see there and want to get the version I’m presenting with images, the full 2MB PDF dump is also available:
Anyhow, I hope you enjoy my little presentation, and as always feedback and corrections are welcome in the comments.
Update (8/2/06)
This presentation is now available for sale as a digital shortcut from Informit (54 pages, $9.99). Please see my Rubyisms Redux for a small pitch and purchasing links. Thank you!
Posted in Web Coding, Programming | Tags rails, ruby | 7 comments
Posted by Jacob Harris
Fri, 06 Jan 2006 21:13:00 GMT
I have to agree with Obie Fernandez when he complains in his posting Enterprise Is Not An Insult about some of the recent derision directed at the Enterprise lately from the avant garde in the Ruby On Rails community lately. The problem is most of the mockery comes over a misunderstanding that “enterprise” means “insanely large”, which Obie points out is completely different from any definition used by people who actually work in enterprise software:
Plenty of us say “enterprise” when referring to internal-facing systems written by corporate IT departments and it doesn’t carry a stigma for being too large or too small, too simple or too complex. Enterprise projects might be large, take years, straddle business units and have global effects or they might be small, departmental efforts with only a handful of end users. So many factors influence the success of enterprise software in a given organization, only few of which have anything to do with technology.
Yes, there are large products that call themselves “enterprise-class software”, but that doesn’t mean that all enterprise software has to be big, slow, and hard to develop. But unfortunately, mocking the state of enterprise software has become an oft repeated dumb joke lately. This is like when a comedian throws out a laugh line – like slamming Microsoft or calling France “surrender monkeys” – to get a quick laugh; it’s funny at first but soon loses its novelty.
Giving a definition of my own, “enterprise software” means “business software.” All businesses want to increase their profits, and they do that by reducing inefficiency (ie, “we can track all of our operations within Excel”) or expanding into new niches (ie, opening overseas offices or offereing new business). Enterprise or B2B software – whether shrink-wrapped or custom – is what helps them get there. The best enterprise software becomes as essential as the CEO or infrastructure to a company’s success. And smart companies look to develop such software as quickly as possible, both to increase their profits quicker and gain advantage over their competitors. Yes, there is slow and clunky enterprise software, but there is also lightweight and rapidly developed enterprise software too. Speaking from personal experience, at Alacra, we work with a lot of vendors both large and small, and I can assure you that agility and profitability are far more important than slavish adherence to some awkward and enormous toolkit. Consider that the agile methodologies of Extreme Programming and Scrum were first heavily used in such large enterprise environments as Chrysler and Honeywell respectively. And I would argue that the success of such radically-new-at-the-time technology like the Web, XML, or Java was entirely due to the B2B community recognizing their value early and embracing them fully.
Which is why I think the jokes have to stop; does Rails want to continue to present itself as a niche tool for small B2C development or does it want to be a B2B player? Why have we gone from Rails does too scale! to Uptime is overrated?
Yeah, 99.9999% uptime is overkill for almost all software, but if you’re going to sell to business you shouldn’t mock people if they want 99% uptime. They’re not whinging; they want to make your product an essential tool for their business. And so I think Rails needs to embrace enterprise needs. I think David is right to resist such code additions to the core, but I think it has a place in third-party contributed plugins and code snippets. To be an enterprise player, people will want to plug Rails into working legacy database schemas, handling composite keys, potentially even interfacing with back-end service-oriented architectures; maybe even hacking lightweight support for such horrors as SOAP or CORBA. And I think such work is what Rails needs to really succeed. Maybe you think it’s selling out, but I’d rather see Ruby in the enterprise than C#. There is a middle ground between obscurity and (code) obesity; let’s not mock people for trying to find it.
Posted in Net Culture, Web Coding | Tags agile, enterprise, rails, ruby | no comments
Posted by Jacob Harris
Fri, 06 Jan 2006 04:11:00 GMT
It’s been an excellent week for my geeky self-esteem, with beta invitations to both Ma.gnolia (a new bookmarking site) and Measuremap (a blog statistics tracking program). Both are written in Ruby on Rails and both look pretty awesome. That’s all I’m going to say (not sure how much I can legally say yet), but I will close with the observation that there’s an energy for new projects on the web I haven’t seen in years and that the Ruby on Rails community is one of the nicest and most open I’ve ever seen.
Ah well, two down, approximately 100 to go.
Posted in Web | Tags betas, ma.gnolia, measuremap, rails, ruby, web2.0 | 1 comment
Posted by Jacob Harris
Fri, 16 Sep 2005 01:49:00 GMT
It’s an interesting time for web development. Not only is Ruby On Rails steaming along towards version 1.0, but it’s spurring the development of other web frameworks in the MVC mold.
As a case in point, consider Django, a new web framework written in Python. Now, I have been dabbling in Ruby on Rails, but I don’t really have the time to learn Python yet sadly, and I can’t really figure out which would be better to do a site from scratch in. What is a developer to do?
Thankfully, fellow blogger Jeremy Voorhis has stepped into the gap. If you haven’t seen it, be sure to check out his entries on working with Django on his blog.
Incidentally, there does not seem to be much ire or competition against relative newcomer Django by the Rails people. In truth, there never should be. It’s a big enough web for both, and I think there are some things that each framework can learn from each other (Django could benefit from something like ActiveRecord, Rails would be improved if it had Django’s mechanism for specifying database schema). Such situations are rare in the computing world (see the eternal flames of emacs vs. vi, windows vs. mac, compiled vs. scripting, typed languages vs. dynamic typing, etc.), which makes such cooperation all the more remarkable.
Posted in Web Design | Tags django, jvoorhis, rails | no comments
Posted by Jacob Harris
Tue, 23 Aug 2005 08:43:00 GMT
I like Ruby on Rails a lot. It’s a pretty awesome web development frameworrk and it’s generated a serious amount of buzz for its young age (just over a year). One major milestone that’s ahead for the language will be a 1.0 release that among other things promises to deliver more API stability than there has been with more recent releases (as well as freeing developers and writers from creating code that’s partially outmoded on arrival). Will that mean though that the big development work for Rails will be done? Hardly. If Rails is really to succeed as a development platform, I believe it can only happen if the distribution problems are solved. And Rails 1.0 seems to be a necessary precursor to that.
I like to think with web application frameworks there are 3 Ds that are important for the platform to succeed:
- Development – how easy is it to develop?
- Deployment – how easy is it to place on your own servers and systems?
- Distribution – how easy is it for third-party users to deploy on their servers?
I think Rails has done very well in the first case. In the second case, I think tools like Switch Tower will help to make the second problem as nice as the first. But I think the third problem is the most problematic in Rails right now. Essentially, there are no nice and standard ways for developers to package up their Rails-developed programs for other users to easily install (without Rails experience).
Let me give a concrete example here. As you may know, I recently switched this blog from Wordpress (a PHP-based service) to Typo (a Rails-based service). I currently am hosting on Textdrive, which is rare among hosting providers in that it supports the latest Rails versions, so at least I did not have to fight with my ISP to get Rails as an option. But even then, I must admit that Wordpress’ setup was a dream to use, and not knowing a lick of PHP, I was able to get a blog up, installed, and running in no time. In contrast, I do have some knowledge of Rails, but Typo was definitely harder. For starters, I had to manually create tables in a MySQL database by running a MySQL file to create the tables (good thing I didn’t use one of the more obscure adapters like MS SQL that didn’t have a manually written schema file for them). I had to go an edit the database.yml config file manually in a shell (not confugured via an install script) Importing the data from Wordpress was a bit difficult too, and I had to fix the import script. Finally, I discovered that I have actually been dispatching Rails methods with the FastCGI dispatcher, even though I’m not using it currently. So, my blog went down over the weekend and I didn’t know. Not good.
This is not to trash Typo, which is a truly excellent product. Nor is it to condemn Rails, which is still too young to even explore a thorough solution to the distribution problem yet. But I think if we start thinking about the future of Rails, the distribution problem is important, because without easy distribution, Rails will be doomed by the network effect. What do I mean by that?
There are a lot of PHP developers out there these days, far more than develop for Rails, Django, Seaside or some of the other frameworks out there. Why? Is PHP a better framework? Arguably no. But is PHP in a whole lot of publicly deployed web products, like Wordpress? Or more wikis than you can shake a stick at? Yes. This in turn leads to more people thinking of developing in that language, books being written, etc. which accelerates adoption of PHP even further. The network effect.
I think 37 Signals, Robot Coop and such have done a lot to advance Rails over the last few years. But ultimately, I think it’ll do more to sell their particular style of visual design than Rails as a development platform. Sure, there are people making custom solutions from scratch that might be wowed by the backend magic that makes it all happen. But I think there’s a bigger pool of programmers who might find themselves having to setup a quick Wiki for their intranet or such? Given the choice, how many of them will write a system from scratch in Rails? And how many of them will just grab an existing PHP-based solution? And once they’ve done the latter, how likely is it they’ll look at Rails ever again? The best way for Rails to grow is for there to be many Rails apps to choose from. And to get there, Rails needs to make distribution as easy as development.
(I hope to follow up on this in a few days with some further observations and ideas.)
Tags distribution, rails, ruby | no comments
Posted by Jacob Harris
Thu, 11 Aug 2005 09:50:00 GMT
Just wanted to note that I have moved this blog to Typo, an excellent blogging system written in Ruby on Rails . If you’re not reading this in an RSS reader, the change should be pretty apparent, although I must apologize for not having rethemed yet. Otherwise, I look forward to hopefully spending more time blogging and less time doing maintenance in the future.
Posted in Meta | Tags blog, rails, ruby, typo | no comments
Posted by harrisj
Tue, 03 May 2005 04:39:00 GMT
Still busy, but there is a great article at O'Reilly Radar on how great frameworks are sometimes extracted wholesale from successful applications rather than built from scratch up. That is, it's
often better to extract the framework from the application, rather than build the application on top of a framework:
That is, at 37signals, they try to design the usability and function of the application first, and that drives the implementation. And if they can then extract a re-usable framework, all the better. For example, basecamp wasn't built on top of Ruby on Rails. Rather, Ruby on Rails was extracted from basecamp.
This echoes some of the complaints I was making earlier about the
unwieldiness of SOAP for web standards. And it fits in with the philosophy of nimble technologies perfectly. Create a product, solve a need, and make it work great and the frameworks will follow, but complicated frameworks in themselves solve nothing.
Posted in Web Coding | Tags rails, ruby, soap | no comments