Posts Tagged ‘conferences’

LSRC 2010 – Day 2

August 28th, 2010

Below are my notes from the second day at LSRC.

Faster Test Suites

Nick Gauthier gave an impressive talk on reducing the execution time of a test suite.  The original suite took over 15 minutes to run.  Using factory_girl, shoulda and paperclip, he strongly recommended empty DB testing (no fixtures, all tests setup and tear down their objects/records), and the use of “no side-effect” test blocks.

Switching to the use of fast_context the execution time was brought down to 5 minutes.  Using perf_tools he found that calls to ImageMagic (from Paperclip) were calling out to the shell, taking a lot of time.  So he mocked those calls and brought it down to 3 minutes.

Using Hydra to do multi-core (concurrent) testing he brought execution time down to 1 minute.

Hydra is easy to set-up (no sockets or daemons to configure).  Just add a Rake task and configuration yml and you’re ready to use it.

When you run Test::Unit the Rails environment is loaded 4 times!!  Cucumber loads the environment twice.  RSpec and Hydra load it just once.

Further tweaking EXT4 journal_data_writeback and atime (access time) on the file system he got testing down to just 50 seconds.  Using Ruby Enterprise Edition (with the tmalloc) and more tweaks (this time to the Ruby _HEAP and _GC settings) he had tests running in 18 seconds.  A 4417% increase in performance!!

Check the comments below for a link to Nick’s presentation slides.  He’s been kind enough to provide the link!

Searchability

Luigi Montanez gave an insightful presentation on SEO.  He doesn’t believe that you have to be an “expert” in SEO.  You simply need to have good content and Google (or Bing) will handle the rest.  There are some things you can do though to make sure you don’t sabotage your pages when crawlers visit them.

Make sure you have a sitemap.xml (sitemaps.org) and a robots.txt (robotstxt.org).  These help crawlers know what to pay attention to and what to ignore.  Make sure you use either a www or non-www domain.  If you have both choose one and redirect to it.  You don’t want to have the site indexed under both.

When redirecting make sure you use 302 and 301 appropriately.  302 is for a temporary redirect, and Google/Bing will not index the page it’s redirected to.  Use 301 instead, if your intention is to have the page permanently moved.  Be cautious too because many web frameworks will use a 302 by default, instead of a 301.

Do not change your content by region, nor require cookies for someone to view content.  Also page titles are very important.  Always follow the “Page Title | Site Title” style (or you can replace | with a – or some other delimiter, just be consistent).

In your URLs dashes (-) are word separators, underscores (_) are not!  Make sure you are using dashes in your URLs!!  Take advantage of meta tagging, and Google Webmaster Tools.

Takeaway:

  • Think like a searcher (search engine: crawler, index, rank)
  • Optimize your title tags (they are the most important thing)
  • Use Google Webmaster Tools (it provides valuable insight)

Components

Nick Sutterer gave a cool demonstration of Cells and Apotomo.  They allow you to create stateful widgets in your Rails views.

Padrino

Joshua Hull gave a talk on Padrino, another web framework built on top of Sinatra.  It takes a minimalist style approach (take what you need).  It’s light-weight and fast.  It has all the basic stuff you’d expect of  web framework including a simple mailer.

LSRC 2010 – Day 1

August 27th, 2010

Had a great info-filled day today at LSRC.  It’s my 3rd year attending.  Below are some of the highlights of the different talks I attended:

Real Software Engineering

Glenn Vanderburg gave a great opening talk about software engineering.  he said software engineering doesn’t work.  He explores the roots of the idea of “software engineering” all the back to the first NATO Software Engineering Conference on the subject.  At the conference they described best practices as:

  1. A software system is best designed if tests are interlaced with the software as it’s developed, rather than at the end.
  2. Creates a simulation which matches the requirements, contains the control which organizes the design of the system.
  3. Through successive repetitions of testing and design, the model ultimately becomes the software system itself.

Sound familiar?  He then talks about what went wrong, how did we start with what sounds like Agile and ended up with waterfall.  He talked about how the creator of waterfall process (Winston W. Royce) actually was trying to express he didn’t feel it worked.  His paper was so poorly written though that people (paying attention mostly to the fancy diagrams, and not the text) believed he was in favor of it.

Cost is *always* an object, and engineering is about what you can do with a dollar vs. what a “bumbler” can do with two.  Mathematical models are not supposed to be about correctness, but about saving on costs.  In traditional engineering you create models because it’s expensive to use up materials, labor, etc.  In software these things are extremely cheap and expendable, so mathematical models are less important.

Engineering is a science AND art.  It involves designing AND making, with cost AND elegance balanced.

Don’t build software as if it were bridges.  The source code *is* the design!  Customers are not paying for the source code.  It is the design of the software system.  Programs themselves are the models.  The customer in the end desires working software.

How to Build Awesome Teams

The guys from Hashrocket talked about their hiring process and what they felt made for great teams, core ideas:

  • Hiring
  • Transparency
  • Community
  • Methodology
  • Environment

They frown on:

  • Micro-management
  • Penny pinching (they still budget)
  • Death marches
  • Meetings (daily stand-up, monthly mission control)
  • Hierarchy
  • Future-proofing

When they hire candidates they look for people who are smart and get things done.  They look for individuals who like to communicate, participate and contribute back to the community.  They need to be a cultural fit.  They look at their online presence, see what they’re Twittering about, review their work on GitHub (code, commit hygiene, etc).  They also require a candidate to subject themselves to a week long interview, where they pair program and go to after-hours with the team.

Keynote: Tom Preston-Werner (GitHub)

Today everyone can start a business on their computer.  What you need though is an idea.

  • go to user groups (learn about people’s problems)
  • drink (seriously, it makes you honest)
  • find people you can work with (co-founders)
  • build something you love (that inspires you)
  • look for untapped potential (who are the early adopters, and how awesome can it become?)
  • keep your day job (not having time is a poor excuse)
  • fight entropy (keep it simple, and get stuff done)
  • ship it (or you might as well not exist) [ship it squirrel]
  • charge money (investors only care about money, not your company, so make customers your investors)
  • have fun! (“drink-ups” where drinking is sponsored)
  • never give it up (it’s going to be hard, don’t let fear hold you back)

If you want to have a $100,000 a year salary, you just need to get about 500 subscriptions at $12/mo (with a few premium or mid-level price options).  It’s totally realistic and in your grasp.  Don’t be afraid of not knowing something … people just like you started out with just an idea.

LSRC 2009 – Day 3

September 27th, 2009

How Much Testing

This presentation was very interesting.  It looked at the age-old question of “how much should we test and what do we test?”  It started out going over several real-life stories of companies who had failed to properly answer the question.  One in particular had a test suite that took over 15-20 minutes to build, over 5 minutes to start the server once built, and then used “webunit” tests that took forever to run.  Also the tests only covered 21% of the system — four years later the coverage was 24%!  (As a side note: Selenium testing is hard, to do right.)

For testing it’s critical to get feed back as immediate as possible.  So if your test suite it taking hours to run then you have issues.  You also should ask yourself if your tests are actually failing from time to time, are they really catching bugs and providing value?

Tests should influence your design.  If you are not finding that tests are influencing your design, they you’re probably not doing something right.  The speaker didn’t seem to specifically push TDD or BDD, but I could understand what he meant by this.  In order to test code easily you have to have testable code to begin with.  Code that is not easily tested is probably overly complicated and not designed/abstracted well.

“How easy is it for you to write a new feature?”  This begs the answer as to why testing is a good thing.  Well designed code is easier to maintain and change, and with tests you gain confidence that your application is working as you expected despite the changes.  Martin Fowler often explains that modifiability is the more important attribute to your code (even above performance), and you gain this through understandability (code is easy to follow/read) and testability.  Writing tests helps you write well designed, understandable, and testable code.

There are a lot of reasons why folks are not writing tests.  The speaker addressed the concerns of both management and developers.  Surprisingly he explained that managers are no longer the road-block, and that most managers now want testing – but the developers are resisting.  To write tests first requires a shift in thinking, and for many developers who’ve been coding a certain way for their entire careers, find this shift sometimes uncomfortable.

Ultimately the answer to the question “How much testing,” can be answered by asking, “What’s the right level of assurance?”  If you’re a company like Twitter (for example) if you lose tweets, or a search doesn’t come back exactly right is it really a big deal?  If you’re a patient in a hospital and your heart-lung machine software fails, is it a big deal?  Obviously you wouldn’t necessarily worry if Twitter admitted to less than 70% code-coverage, but you might be concerned if your heart-lung machine was anything less than 100% code-coverage.

Be Awesome

This was a very fast-paced talked that just touched on values or principals you should adopt to “be awesome,” taken from the speaker’s personal experience:

  • Pair program (remote paring is hard, but possible)
  • Respond to change
  • Use micro-frameworks and tools
  • Creativity and craftsmanship
  • Monolithic processes are unfun
  • Are your apps a joy to maintain?

Cucumber

I got the pleasure of seeing Joseph Wilk in person!  He gave his usual presentation on Cucumber, although there were some new features thrown in there.  Tagging was one of them.  The slideshow was pretty involved and if you would like to see an example of his presentation go check out this video:

Herding Tigers

This was the last big talk of the conference.  It was presented by Danny Blitz, who’s a very dynamic and interesting character.  He basically talked about agile teams, which he refers to as “tiger teams.”  He didn’t really talk about Scrum or XP or the more formal Agile methodologies, but instead discussed his own take on the corporate environment.

Book suggestions:  The Passion of Command, Corpus Business

What is a Tiger Team?

Small development team where velocity and quality are the primary drivers.  The team self-improves, has no meetings (or very few and short), test-automation is taken very seriously with actual QA members on the team.

“A lot of companies fake agile, wtf is a 3 hour scrum?!”

Workplace Archetypes as Animals

  • Tiger:  calculating, cautions individuals who avoid fights they can’t win
  • Cow: herd mentality, afraid of risk, have no original thoughts
  • Bear: big, mellow, live and let live attitude, also avoid fights they can’t win
  • Leopard: unmatched in ferocity, not a good team player though (avoid these)
  • Elephant: C level execs, invincible in battle (even a tiger will not take on an elephant)
  • Hyena: scavenger, dangerous weasels, steals ideas, back-stabbing

Leadership Characteristics

  • Faith and Love
  • Hope
  • Success belongs to the team
  • Failure belongs to the leader
  • The buck stops here
  • Fearlessness (moral courage)
  • Listener and learner
  • Protector

Also good leaders should manage by intent (servant leadership), not micromanage.  They should reward failure, people will make mistakes – let them feel comfortable in making them, as long as people learn.  Demand to be questioned, if your team is afraid of you they will not question your decisions and warn you when something is wrong.  Glorify the lower levels.

Good “grunts” show politeness and professionalism.  (They got it easy.)

Agile is a buffet not a dogma.  Methodologies are wrapped around Agile, *it* isn’t a methodology itself.

LSRC 2009 – Day 2

August 30th, 2009

Dave Thomas Keynote

Always a great speaker, Dave came down from Dallas to help kick off the conference.  Dave has been using for over 10 years, and he’s still using it.  He shares his reflections with us as to why he still enjoys programming in Ruby.

Ruby is an interesting language.  It can be described as a multi-paradaim language: object oriented, procedural, prototype-based, and functional (all at the same time).  He also points out that Ruby thinks the way he does, which also means – like Dave (or anyone of us) – it’s imperfect.

We shouldn’t worry about perfection though and instead should be pragmatic.  There isn’t only one way to do anything in Ruby, there is no “right way.”  It’s this ambiguity that helps encourage participation.  If Ruby were perfect there’d be no room for creativity, growth or adaptation.  Ruby is adding stuff – not taking away.

Dave also talked about his experience with being publicly “slammed” by Zed Shaw. He said he realized at that point in time that Ruby is not a community.  Ruby is a tool around which communities form.

Passionate people are messy, Ruby is messy.

Programming Intuition

A lot of people are programmers, very few are great programmers.  The difference in productivity between a good programmer and a great programmer can be a factor of 10.  Ruby rejects the idea that the world is simply two buckets of good and great.

  • Do one thing
  • DRY (Don’t Repeat Yourself)
  • SLAP (Single Level of Abstraction Principle)

How do good programmers think?  Does a good programmer simply boil down to command of the language and ability to recognize/use patterns?  NO!  Programming deals in abstractions and great programmers talk about code as if it were not abstract, but in tangible terms.  Good programmers can “feel” code, there is an emotional reaction.

Our brains are made to adapt to our environment (which we perceive through our senses).  Humans are wired to want physical attachments.  What senses do programmers use?

  • vision (why OO is “easier”)
  • hearing
  • kinesthesia (perception of movement, weight and position)

Code is not 2D, it’s not even 3D, it’s multi-dimensional.  So diagrams are not always useful.  Code sometimes has a “viscosity” and can be felt to push back or resist you.

What do we perceive as beauty?  Elegance?

Cultivate a Sense of Code

  • No specifications / think about it
  • Use tools that help you
  • Practice, use methods that provide immediate feedback

Experts operate on intuition, not on recipes or rules.

  • Master Ruby’s method lookup (it’s worth knowing)
  • Useful to limit scope of magic
  • Can modify individual objects with modules
  • Tr to replace inheritance with extends

Succeeding with Ruby on Rails

This talk was about the owner of Thoughtbot and how they got to where they are today.  Below are some of the notes from the talk:

  • Started in 2003 with 4 people
  • Not everyone wants to run a company
    • wanted to go into business to work the way they wanted to
    • happiness is very important
  • Perl was their “happy language” from Java, but Ruby and Rails ruined it
  • Decided to only do Ruby on Rails, revenue skyrocketed afterwards
  • Hiring is very important and hard
    • hire only people who want to learn and teach (passionate)
    • skilled
    • right attitude
    • salary (the best you can afford, not necessarily that money can buy)
  • Don’t compromise on core principals
  • Be nice

Identify what’s really important for you, don’t compromise on that decision, and be nice.

Hiring Process

When hiring people Thoughtbot first reviews a resume and code of the applicant, before they even do a phone interview.  Then an initial phone call is done, followed by a second interview if there is interest.  The 2nd interview is more technical in nature.  If an application is considered, they have to participate in a week-long immersive pair-programming situation with a developer on staff.  After this last step is then someone considered to be on the team permanently.

Core Principals

  • sustainable development (40 hrs a week)
  • all are technicians (even html/designers)
  • no contracts or outsourcing

Clients

When it comes to client relationships the approach Thoughtbot takes is to “do the best you can.”  This doesn’t always mean you succeed at every project, but you know that you did your best in trying.  Set expectations, be proactive and above all nice.

Thoughtbot does not believe in subcontracting and they insist you should work on the way you want to work.  If a client doesn’t want to work with you then you should ask them to find another team.  In the long run it isn’t worth being unhappy and you’ll just be frustrated (as will likely the client), all around bad.

Client Management

  • project planning form
  • Highrise
  • master services agreement
  • project lead (SM/PM rolled into one)

Design and Development

Like 37Signals, Thoughtbot is a big believer in design first.  They will figure out how a UI looks and works before coding.  This helps flesh out details you might not realize until later, when it’s more expensive to fix.  They practice pair-programming with an iterative, TDD development approach.  Pivotal Tracker is used to manage their backlog.

They also believe strongly that people should do what they enjoy.  Folks are encouraged to work on projects that interest them, there are not set roles or boundaries.  If a designer wants to get more into Rails, he’s allowed to take on some Rail work in a project.  There is always at least two developers per project.  If one becomes bored or wants to work on a different project it makes it possible to swap people out without affecting the project to terribly.

Open Source

Part of the culture at Thoughtbot, they’ve made many open-source contributions to the Rails space.  Abstractions don’t stay internal to the company.  By releasing open-source software they get their ideas validated and legitimized.  Payback includes recognition in the market space.  They also have to support the software less, because the community itself supports the software (crowd-sourced support).

The one suggestion for other companies looking to do open-source contributions:  keep quality high, incubate internally for a while before releasing, make sure it’s something you enjoy using yourself.

Products

The talk ended with the question about why and how do you keep Ruby relevant?

  • consulting scales w/ people
  • but we want a small company
  • products can scale without people
  • make products you use yourself
  • make products you enjoy using

How long will Rails be around for (be popular)?  How long will Ruby be around for?  We have to take responsibility for Ruby and Ruby on Rails so it remains popular.

LSRC 2009 – Day 1

August 27th, 2009

Today was a training day.  The conference officially starts tomorrow, but there were some interesting things that I learned in my classes:

Ruby Craftsmanship with Gregory Brown & Brad Ediger

Code is written once and ready many, many times over.  It’s because of this fact we want to make sure we write good code.  Writing good code also helps you avoid shooting yourself in your foot or painting yourself into a corner on a project.  You’ll find your work more enjoyable as well, it’s more pleasant to work in a well-ordered project than one which is in disarray.

Reading code is an important skill.  You should practice often by reading code from other projects, like open source projects, and figure out how things are working.  Try to be as comfortable reading code as you are conversing with people.  Remember docs can lie (they can be out of date or just plain wrong), so it is important to be fluent at reading code.

A good majority of the morning was spent working through design koans and talking about why they are true.  A koan, for those who are unfamiliar with the term, is a Zen practice where the student is demanded to answer the question.  In the class they were a series of unfinished unit tests that had to be completed and made true.  You can find a set of them here: http://github.com/edgecase/ruby_koans

The second half of the class talked about the nuances between a class, a module, and a singleton. Why would you use one over the other?

Classes

  • can be instantiated as objects
  • class variables can have far-reaching (unintended) affects
  • object data exists separately
  • can implement interfaces

Modules

  • cannot be instantiated as objects on their own
  • help manage namespace and be used as a mixin
  • module methods are not included into their calling class

Singletons (class, not pattern)

  • are class-like entities, but cannot be instantiated
  • methods are stored per-object, rather than per-class
  • all class methods of a class are actually kept on a singleton class

The singleton stuff can be mind-blowing, so if you wish to understand it better you can check out an article “Understanding Ruby Singleton Classes“, by Peter Jones.

We were also encouraged to pair-programming during the session.  A rare experience I get to enjoy, since we do not pair-program where I work.  I got to pair with Ben Kimball, a local Austin developer like myself.  He wrote the unit tests (defining what the interface should be) and I wrote the implementation (the actual code to make them pass).  The interesting thing that was happening is that through the process of test/code writing we talked about the design and really came to understand what was going on and what was needed – resulting in a better design (that was also testable and tested) than maybe we could of done individually.

Greg and Brad also shared some other general bits of wisdom:

  • When working on problems, even when doing so alone, talk with your team as you go along.
  • YAML parser will automatically convert things that look like dates into a Date class.
  • Do not ever use class variables, instead use class instance variables (by opening up the singleton class), because class variables can have far-reaching affects.
  • If you work in an “enterprisey” organization you can still do TDD.  Just do your pair session and write your tests, which will flesh-out the design, then go back and create/update your “formal” design documents to match.

Additional things to research:

Getting Ready for LSRC 2009

August 22nd, 2009

This coming week I’ll be attending the Lonestar Ruby Conference (LSRC) 2009. I’m lucky that it’s held here in Austin, TX, my home town.

Last year was really insightful, especially given how new to Ruby I was, a little less than a year. Now I am coming up to nearly two years of using Ruby professionally. I’m really looking forward to this one, they usually help energize and excite me in terms of what’s possible with Ruby and Ruby on Rails. It is also cool to see what other folks are working on and doing with Ruby.

You can brush up on my 2008 attendance which I blogged daily about at the links below. This year I plan on doing the same, so stay tuned!

LSRC – Day 3

September 7th, 2008

Day three of the conference was not as good as the first two. The presentation by Rails Envy was great. Greg knows what he’s doing, and Jason is always able to inject humor.
Rails Envy – A Year of Innovation

Gregg and Jason spent about an hour touching on various “cool” things that have come out this year, or just finally came to popularity this year. Below is a list of some of the things that I found interesting:

* Prawn – a PDF generator for Ruby
* roo – used to read spreadsheets (works with Excel, OpenOffice and Google docs)
* Shard – lets you partition databases based on schema
* merb – a Rails alternative
* Mack – a Rails alternative, specially suited for portal applications
* Webby – a Rails alternative, geared around static web content (brochure sites)
* Shoes – a way to make cross-platform Ruby applications
* Sinatra – a good choice for more “purely REST” applications
* Redmine – a very flexible PM tool
* Adhearsion – VOIP with Ruby
* make_resourceful (and resource_controller) – both remove duplication you often find inside Rails REST-style controllers
* Starling – provides lightweight messaging
* Thin and Ebb – faster web servers than mongrel, allow deferred requests
* Neverblock – allows for multi-threaded DB adapters

Gregg even did a few demos of particular ones. The one most impressive for me was Neverblock. Gregg demonstrated a series of queries that took 30 seconds to complete (because they were handled in a single thread, one at a time). With Neverblock the same set of queries took 3 seconds!!

LSRC – Day 2

September 5th, 2008

The second day at the Lonestar Ruby Conference was filled with heavy hitters: Bruce Williams, James E. Gray, Bruce Tate, Evan Phoenix, and Yukihiro Matsumoto (aka Matz) himself. I was also excited to see Dave Thomas (a personal hero, he wrote the “pick-axe” book and does the Pragmatic Books). I learned a lot.
Ruby 1.9

The day started with a talk by Bruce Williams. He’s well known and respected in the Ruby community, and he lives in Austin, TX – which is cool. It has that “Lance Armstrong” effect when you have notable people living in your own town. Anyhow, he talked about what’s coming up in Ruby 1.9. It was a lengthy technical discussion about the inner-workings of Ruby 1.8 vs 1.9. I will not get into it here, there’s plenty on the net about it.
Hidden Gems

The next talk was by James Edward Gray II, and it was one of the best presentations of the whole conference. He compared what’s going on in the Ruby community to Battlestar Galactica and presented a series of lesser known Ruby Gems that could help make life better. He debunked the myth that Ruby is slow saying, “Ruby is slow—it’s not true. It’s as fast as you want it to be.” (The “Ruby is slow” or “Rails can’t scale” were recurring themes in a lot of presentations – it’s the biggest misconception the community is wrestling with right now.) Some of the gems he presented that I found interesting were:

* NArray (Numerical Array) – really good a heavy number crunching, provides a 3-dimensional array
* SQLite – it’s a fast and free database, often overlooked by people
* RBTree – James considered this the “big gun of computing” (like the cylon soldier robots)
* FSDB – this isn’t a gem, but it works better than a RDBMS in storing time-sorted data (eg logs, reports, etc)
* Rinda – it comes with Ruby and doesn’t need to be installed, it is dirt simple IPC

He also plugged Scout, which is a Rails server monitor he wrote.
Ruby Best Practice Patterns

The last presentation before lunch was on best practices and patterns, presented by Rein Henrichs. I found his presentation to be clever. He presented it as a parody, “unfactoring” as he called it. The premiss was that developers who write clean, easy-to-maintain code were stupid and soon to find themselves out of a job. Instead he proposed we write code that was hard to maintain and thereby keep our jobs secure. Of course he wasn’t being serious.

Some of the points that I took away (and many of which I already subscribe to) were:

* Use intention revealing names for variables and methods
* Write code for maintainability, optimize for it, since 90% of a project is maintaining code you wrote
* You should be able to read something at a glance and understand what it’s doing (if you have to take time to “walk through the code” before you understand what it’s doing, it’s badly written)
* Use around_filter (in Rails) instead of before_filter + after_filter

Javascript Frameworks

This session was insightful. It mainly focused around SproutCore, which is the same JS library that’s used by Apple’s MobileMe. You can write an application with very ERb’ish style mark-up. You can get SproutCore on GitHub. Some of the highlights of SproutCore:

* standards based
* builds desktop grade apps in your browser
* mvc
* used by MobileMe
* more Ruby flavored
* generators
* fixtures
* uses Merb for local development

The Care and Feeding of Ruby Developers

This session was presented by the VP of Development and Technology at FiveRuns. He’s come to the conclusion that Rubyists are a different breed of developer. They’re not like the Perl and C++ folks. Rubyists actually care about aesthetics! Some of the highlights of his talk:

  • Pervasive Aesthetics
    • visual design aesthetics are very important, essential
    • aesthetics of the work environment (they will find a good place if you don’t provide one)
  • Collaboration
    • baked into the community from the beginning
    • course correcting feedback
    • independent of physical location
    • independent of organizational boundaries (business competition, politics, etc., not as much a factor)
    • people who are not contributing, etc. get seen as not being alive, fade into the backdrop
  • The Doing is Close to the Planning
    • results in more Stars
  • Living on the Edge with the Latest
    • tend to be early adopters
    • comfortable with the rapid iterations of open-source
  • Enlightened Capitalists
  • Care and Feeding?
  • Awareness
  • Purpose
  • How well do your other communities match these qualities?

Tate’s Talk

Bruce Tate gave a talk about unconventional wisdom. Rails was great in that it brought a lot of people to Ruby, but at the same time it made a lot of people stop thinking. The auto-magical nature of Rails makes it easy to take off your thinking caps. His talk was to challenge us to get back into thinking critically about what it is we do as Ruby developers. Dave was in the audience on this one. At one point he said, “The boilerplate controller code in Rails is crap; and it shouldn’t of been done that way.”

  • What do you aspire to be?
  • What motivates you? Beauty? Money?
    • money should be the motivator
    • beauty helps you get there
  • Who’s the beholder?
    • consider perspectives
    • REST has its advantages, but it comes at a cost
  • Fixtures and testing—remember isolation is the goal, and islands are not dry!
    • use fixtures for small projects, simple models, and teams with few developers
    • go fixtureless when it’s a large project, complex models, or teams are large or inexperienced
    • don’t use fixtures for edge cases
    • don’t use more than 4 then that’s a code smell, refactor
    • don’t use fixtures for count or roll-up tests
    • don’t use fixtures for edge cases

Tate’s final comments:

* Have purpose
* Value the economics (money)
* Your code should tell a story and be readable

Tate’s challege to us all:

* We are in a fortunate time and industry (with Ruby, in the US), mentor someone in Ruby
* Find ways to give back to the community
* Use your skills to change the world

Later that Evening

Evan and Matz were the keynote speakers. Out of respect I kept my laptop shut and listed to their talks. So not many notes here. Both presentations were very good. Matz reminded me a lot of working at NTT Verio—I miss those days.

LSRC – Day 1

September 4th, 2008

I’m attending the Lone Star Ruby Conference, here in Austin, this week. I’ll be attending some classes for the first day, then the presentations Friday and Saturday.
Advanced Active Record

The first class was insightful. It covered various aspects of ActiveRecord. It was cool to be able to see the Rails Envy guys in person. I think the time given for the code challenges could of been a little more generous. It felt a little rushed. A lot of it was a review, but they also covered some subjects I haven’t done that much with (such as the use of indexes). They also touched on plug-in and gem creation. Something I want to play with more very soon.

Things I’ve Learned

When you have to load a large sets of data it’s a good idea to wrap it inside a transaction. You can also use two extra gems that help make your job easier: ar-extensions and faker (you should check them out).

Do you have queries that are taking longer that you’d expect? Maybe you need an index. When you have a lot of associations indexes are a good idea to keep things speedy.

If you are using :include to pull in data from other tables try to avoid using :conditions along with it. You’ll find that things might get ugly.

One really cool thing I learned from this session was the use of counter caches. I’ll probably write more about this later, since I don’t have the time to go as in depth as I’d like with it right now.

How to write plug-ins and gems. (Well they didn’t go too in-depth on it, but I know where to start – so a new weekend project will begin soon).
Advanced Mocking

The mocking class was interesting. I learned more about the differences (although subtle) between a stub and a mock. Jim says there isn’t really any (for practical purposes). He taught that knowing when to use a mock vs a real object is a personal preference. As is when using a partial mock with a pure mock. (You can create partial mocks based on real objects/classes).

I’ll try to write more on this topic as well as it’s pretty interesting. It too requires some though and there’s not enough time to go into right now, so more later.
Overall

All and all the training was good. I wouldn’t say it was the best, but it’s definitely worth the price. The thing I think that was great about the training was you had access to the experts. Jim wrote Flexmock, for example, and how great is that to be able to have the author teach about his own testing library? The negative though with both is they felt rushed. There were a lot of exercises and a times it felt chaotic or rushed in terms of what your objective was and or what you already had on hand to start.