Registrations are now open for RubyLearning’s popular Ruby programming course. This is an intensive, online course for beginners that helps you get started with Ruby programming. The course starts on Saturday, 15th Mar. 2014 and runs for seven weeks.

Course Fee and Discount

Please create a new account first and then pay US$ 34.95 (for the first 10 participants, after which the course fee will be US$ 69.95) by clicking on the PayPal button Paypal

Note: If you do not have a PayPal account and would like to pay by credit card on PayPal then do email me at satish [at] rubylearning.org.


Download ‘Advice for Ruby Beginners’ as a .zip file.

Here is what Sandra Randall (Butler), a participant who just graduated, has to say – “You kindly offered me the opportunity to join your Ruby course. I’m new to development and found the course, even though basic for programmers, a little tricky for me. I managed to complete all of the assessments and really learnt a lot. Thank you very much for the opportunity. It has really given me the push I needed to learn Ruby and I’m currently treading my way through both the pickaxe and Agile Development books and enjoying it. I’ve recently been offered a position as a Junior Systems Developer at a local Software house in South Africa – all thanks to the push you gave me which gave me the motivation and drive to get going.”

What’s Ruby?

Ruby

According to http://www.ruby-lang.org/en/ – “Ruby is a dynamic, open source programming language with a focus on simplicity and productivity. Ruby’s elegant syntax is natural to read and easy to write.”

Yukihiro Matsumoto, the creator of Ruby, in an interview says -

I believe people want to express themselves when they program. They don’t want to fight with the language. Programming languages must feel natural to programmers. I tried to make people enjoy programming and concentrate on the fun and creative part of programming when they use Ruby.

What Will I Learn?

In the Ruby programming course, you will learn the essential features of Ruby that you will end up using every day. You will also be introduced to Git, GitHub, HTTP concepts, RubyGems, Rack and Heroku.

Some Highlights

RubyLearning’s IRC Channel

Some of the mentors and students hang out at RubyLearning’s IRC (irc.freenode.net) channel (#rubylearning.org) for both technical and non-technical discussions. Everyone benefits with the active discussions on Ruby with the mentors.

Google Hangouts

There is a Hangout Event that is open for students, for drop-in hangouts where students can pair program with mentors or with each other. This is often where you can get help with your system, editor, and general environment. Anything that can help you with your coding environment that you are having problems with are usually discussed interactively here.

Git Repositories

Shared (private) repositories available for those that want to learn git and the revision controlled programming workflow. This allows students that want to collaborate while learning. This is a great way to record your progress while learning Ruby.

eBook

The course is based on the The Ultimate Guide to Ruby Programming eBook. This book is priced at US$ 9.95. However, the Kindle edition of the eBook is available for US$ 6.

Challenges and Side Tracks

This is course material not found in the RubyLearning Study Notes nor in the E-Book! Depending on participation levels, we throw a Ruby coding challenge in the mix, right for the level we are at. We have been known to give out a prize or two for the ‘best’ solution.

Who’s It For?

A beginner with some knowledge of programming.

You can read what past participants / online magazines have to say about the course.

Mentors

Satish Talim, Michael Kohl, Satoshi Asakawa, Victor Goff III and others from the RubyLearning team.

Dates

The course starts on Saturday, 15th Mar. 2014 and runs for seven weeks.

How do I register and pay the course fees?

  • You can pay the course fees either by Paypal or send cash via Western Union Money Transfer or by bank transfer (if you are in India). The fees collected helps RubyLearning maintain the site, this Ruby course, the Ruby eBook, and provide quality content to you.

To pay the Course Fee:

Please create a new account first and then pay US$ 34.95 (for the first 10 participants, after which the course fee will be US$ 69.95) by clicking on the PayPal button Paypal

How does the course work?

For details on how the course works, refer here.

At the end of this course you should have all the knowledge to explore the wonderful world of Ruby on your own.

Remember, the idea is to have fun learning Ruby.

Technorati Tags: , , ,

Posted by Victor Goff

Follow me on Twitter to communicate and stay connected

Be the first to comment

This guest post is by Elise Huard, who is working as a freelance software engineer. She has 15 years of software under her belt and is keen on providing experienced advice as well as coding help. She has programmed in Ruby for 6 years before turning to Clojure and Haskell, and enjoys exploring the world of functional programming. She lives in Berlin, Germany with her family.

Elise Huard With Clojure, Scala and Haskell on the scene, functional programming is getting a lot of attention. I’m going to explain some terms that are related to functional programming, to help you understand, and – who knows – nod intelligently random discussions you read or overhear.

This is meant to be a little “Don’t panic” lexicon, not going incredibly in-depth but trying to describe the terms in as simple and friendly a way as possible. To know more, I invite you to read up on the concepts, but I hope this’ll get you started.

Closure

A closure is a function that “stores” the surrounding scope. An example in javascript to make this clearer:

1
2
3
4
5
  function multiplier(factor) {
    return function(otherFactor) {
      return factor*otherFactor;
    }
  }

The function multiplier returns another function, which will multiply any given number with the argument factor.

The function that is returned by this function “closes” over factor – that is it will retain the factor variable information even though it is no longer in the scope of the multiplier function. Every number that is fed to the returned function will be multiplied by factor.

In this example we used an argument of the surrounding scope, but it could also be any other variable in the function scope.

Currying

You have a function that takes several arguments – currying allows you to apply one or more of these arguments and return a new function which takes the remaining arguments. Applying one of the argument is called partial application.

In some programming languages, this is a very easy operation

haskell currying
1
2
plusThree = (+3)
plusThree 5 -- 8

in some others, it’s a little more work syntactically, but it’s possible

javascript currying
1
2
3
4
5
function plusThree(x) {
  return function(x) {
    return x+3;
  }
 }

Higher Order Functions

In functional languages functions are first-class citizens. You use them more or less as you would use any other type of value (I say more or less, because establishing equality of two functions is not possible, you cannot compare 2 functions as you would some other types).

Higher order functions act on this concept, and either:

  • take one or more functions as arguments – one example is map or filter.
  • return a function (like some of the earlier examples in currying and closures) which can then be used in later operations.

Hindley-Milner Type system

The Hindley-Milner type system is the name of a type system for the lambda calculus, which comes with a fast type inference algorithm. It’s called Hindley-Milner because it was independently described by first Roger Hindley, then Robin Milner.

Type inference means you don’t have to specify the type of every single variable or function (as is the case in java or C), because the compiler will infer the type for you, which will save a lot of typing and makes it nicer to read.

The H-M type system is used in Haskell and ML type languages (like OCaml).

Homoiconicity

Homoiconicity means that the abstract syntax tree has the same structure as the program. Going from one to the other is a straightforward conversion.

Another property of homoiconic languages is that the program representation is also a data structure in the language.
Example below, for Clojure: every expression is also a list (which is why it’s a Lisp-like language, LISP = LISt Processing)

1
2
  (defn addTwo [x] (+ x 2))
  (addTwo 5)

The advantage of homoiconicity is that code = data. You can manipulate your program as if it were data, since it’s effectively a data structure already.
Homoiconicity is used in lisp-like languages to allow powerful macros – anything that lisp can do to data structures, lisp macros can do to lisp code. Move over ruby DSL metaprogramming!

Immutability

Strictly speaking not a property of functional programming, though it is a corrollary of purity. If your function can not change the state of the program, variables will be immutable. Say adding an element of a list will take a list as an argument and return another list, which is the same but with the element added.

This may seem like a dreadful waste of memory (especially when the data structures/objects are large), but in functional programming languages there are often optimizations under the hood which will re-use the existing data structures.

Immutability is considered an advantage when working in concurrent programs. There is no danger that the data you’re currently working on will be changed while you’re working on it, since it’s immutable. Then there are strategies of reconciliation to work out which function output will win.

Impure

Impure programming languages allow side-effects in the code without pointing them out with loud syntactic claxons.

The difference between a pure and an impure programming language is that in a pure programming language, it’s made very explicit when a function has side effects, and which kind, and that it’s impossible to confuse functions doing side-effecting with pure functions.

Popular impure functional programming languages are Clojure and Lisps, OCaml, with Scala and Javascript in their own category since they implement both functional and object-oriented paradigm.

Lambda

greek letter ?, used (in the functional programming context) to refer to:

  1. lambda calculus
  2. an anonymous function – a function which is used immediately and doesn’t need naming for further reference, for instance being passed in as an argument to a higher order function (like filter, map, etc).

Lambda calculus

?-calculus, Wikipedia says, is a formal system for expressing computation based on function abstraction and application using variable binding and substitution. Lambda calculus is a universal model of computation (one can express anything a Turing machine can do in lambda calculus).

Should you know the details of lambda calculus to do functional programming?

No, unless you’re really interested in the mathematical underpinnings of functional programming, have some time and aren’t afraid to spend some time reading with pen and paper scribbling mathematical formulas.

Lazy

Lazy evaluation (so not lazy like lying on the couch) is strictly speaking independent of functional programming. It means that an expression is only evaluated when the resulting value is used or displayed. So you could have lazy evaluation in imperative languages.

I mention it in this little lexicon because lazy evaluation was actually introduced for the lambda calculus, and Clojure and Haskell (especially the latter) have plenty of lazily evaluated functions in their standard library.

Advantages:

  • being able to create infinite list or series, and you only evaluate elements as you need them
  • only evaluate the part of a conditional structure that needs evaluated (so in Ruby, if – else is actually lazily evaluated)
  • sometimes performance gains by avoiding unnecessary calculations

Monads (et Al.)

There are numerous text and blog posts about what monads are, some of them crystal clear and some of them slightly obfuscating the concepts.
Here’s the thing though: unless you’re doing Haskell or similar statically typed pure functional languages, you don’t really need to know what they are.

In short:

  1. monads allow people to bundle in side-effects in a pure typed language (IO monad, state monad, etc). They have a type, which indicates which kind of side-effect they’re used for
  2. monads also have a number of mathematical properties and associated functions. Those functions are designed to let you daisy chain monad-handling functions or to change ordinary functions to handle monads.

Other terms you might hear: Monoids, Functors, Applicative, … these are also only really necessary in the context of Haskell and company. Learning about them when you’re working in other types of languages might be interesting in the abstract, but is not essential to your everyday programming.

Purity

Purity can be used in two contexts: a pure programming language, and a pure function.

Purity for a functional programming language means: side-effecting has to be explicitly indicated, as is the case for Haskell (both in the function signature, usually returning monads, and in the code).

In pure functions, there are no ‘leaks’. A pure function’s only input are its arguments, and its only output is its return value(s). This brings us to referential transparency

Referential Transparency

This is a property of pure functions – if you apply a function on a set of input, then it will always return the same output. This is due to the lack of side-effects (see side-effects for explanation), which means no hidden parameters will change anything about the execution.

As an example of a function that wouldn’t be referentially transparent, consider a function that would use a random number in its result. The random number (a side-effect) will change the result every time the function is run, so the function is not referentially transparent.

why is this useful?

Well, referentially transparent part of the program are dependable and easy to test. You only have to test on the sets of expected arguments without setting up any other state that could influence it, and it will reliably crank out the same output every time you run it.

Side Effects

Side effects are everything that can change the state of the world – that means the state of your program (outside of the scope of current function), or the standard output of your terminal, or a file, or database content.

Let’s be clear, a program has to have side effects (if only displaying a result in the terminal), otherwise it has very little point. Let’s put it more strongly: the program’s sole reason of existence is to have some desired side-effects, like migrating a database, showing a web page, calculating some statistics and showing them to you

I hope this was helpful and will give you some terms to be going on with! Welcome to the wonderful world of functional programming, I wish you all a pleasant journey!

Feel free to ask questions and give feedback in the comments section of this post. Thanks!

Technorati Tags: ,

Posted by Elise Huard

Follow me on Twitter to communicate and stay connected

13 comments