Giter Club home page Giter Club logo

conference_notes's Introduction

===  Windy City Rails ===

Metrics based refactoring
=========================

metric_fu - Jake Scruggs
http://github.com/jscruggs/metric_fu

* Flog - code complexity
** http://ruby.sadi.st/Flog.html
* Saikuro - cyclomatic complexity
** http://saikuro.rubyforge.org 
* Reek - bad design detector
** http://github.com/kevinrutherford/reek

Rails 3.1
=========

* Rails 2.3.9 - deprecation notices for upgrading

* Engines
** http://piotrsarnacki.com/2010/09/14/mountable-engines/
** Namespacing
** Engine specific routes
** Migrations 

Various WCR Notes
=================

* In many web applications, dynamic generation takes factors of less time than static pull of content, and so going nuts over optimizing the first part of the pull will only effect that small factor
* Open source community is a marketplace

=====    Railsconf    ======

How to work with legacy code
============================

Tests really help allowing you to make change
  This is not every place in your codebase
  Test around your hotspots
  Look at your commit history
  Do bug fixes cause more bug fixes?

3 Experiments
    Find the most executed paths of your code
        These should be cleanest and tested
    Play Open / Closed Whack-a-mole
        Good code is open to extension but closed to modification
    Run dojo experiments
        take the same piece of code and throw it at 30 developers
        run again - how do they change the code
        how do we react when confronted with code
        how does the way we structure frame how people react

Yehuda After Hours
==================

Hey you - you're overriding behavior incorrectly
------------------------------------------------

class Person
    def say(thing)
        puts thing
    end
end

Person.new.say('hello')

class Person
    alias old_say say
    def say(thing)
        old_say thing.upcase
    end
end

### easier way ###

module Speaker
    def say(thing)
        puts thing
    end
end

class Person
    include Speaker
end

Person.new.say('hello')

module Yeller
    def say(thing)
        super(thing.upcase)
    end
end

class Person
    include Yeller
end

Person.new.say('hello')

ActiveSupport::Concern
----------------------

ActiveSupport::Concern # instead of doing self.included
                       # will pull in ClassMethods automagically

module MyFeature
  extend ActiveSupport::Concern
  included do

  end
end

Deep and dirty in Rails
=======================

Things to know when trying to share state w/ threads
----------------------------------------------------

threading - 3 tips - don't - do not share state - do not share mutable state

operator assignment is not atomic
    +=
    ||=


gem install atomic # an Atomic class that guarantees atomic updates to its contained value

my_atomic = Atomic.new(0)
my_atomic.update {|v| v + 1}
begin
  my_atomic.try_update {|v| v + 1}
rescue Atomic::ConcurrentUpdateError => cue
  # deal with it (retry, propagate, etc)
end

no thread safe string, array, or hash
  do not use mutating operation

define_method
  blocks carry carry around too much state

GC hidden cost of object-heavy languages
  do not create so many objects # fewer objects == better performance

Side Note that I liked
----------------------
Tests are tests - the red part of red, green, refactor
  if it doesn't turn red - your tests aren't testing anything







conference_notes's People

Contributors

butzopower avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.