an objects 10.times {puts "I am sexy and I know it!"}! # I am sexy and I know it!! # I am sexy and I know it!! # I am sexy and I know it!! # I am sexy and I know it!! # I am sexy and I know it!! # ....(10 times)....!
not? ▶ Field names, prefixed with underscore or not? ▶ How many coding guide lines is there actually? ▶ Microsoft Framework Design Guidelines ▶ IDesign C# coding standards ▶ Your company coding standard ▶ Your own coding standard. (Professional choice)
criteria's that makes us believe that object is a duck, can be recognized as a duck. ▶ But what that means from programmer perspective and how to implement it?
any class that satisfy conventions described in documentation (Should quack and swim like a duck). ▶ In .net Mixins using ReMix http://remix.codeplex.com/
The Enumerable mixin provides collection classes with several traversal and searching methods, and with the ability to sort. The client class must provide a method “each”, which yields successive members of the collection.
provides collection classes with! # several traversal and searching methods, and with the ability to! # sort. The class must provide a method <code>each</code>, which! # yields successive members of the collection. If! # <code>Enumerable#max</code>, <code>#min</code>, or! # <code>#sort</code> is used, the objects in the collection must also! # implement a meaningful <code><=></code> operator, as these methods! # rely on an ordering between members of the collection.! module Enumerable! # enum.to_a -> array! # enum.entries -> array! !# Returns an array containing the items in <i>enum</i>.! # ! # (1..7).to_a #=> [1, 2, 3, 4, 5, 6, 7]! # { 'a'=>1, 'b'=>2, 'c'=>3 }.to_a #=> [["a", 1], ["b", 2], !# ! ! ! ! ! ! ! ! ! ! !["c", 3]]! def to_a()! #This is a stub, used for indexing! end !
that write or manipulate other programs (or themselves) as their data, or that do part of the work at compile time that would otherwise be done at runtime. (Wikipedia) ▶ Keep programs DRY – Don’t repeat yourself.
▶ Benefits of interpreted language ▶ Quick prototyping with Rails ▶ It’s fun and it’s going to make your better! ▶ And definitely it will sabotage what you believe in.