Sunday, May 31, 2015

JavaScript Hands-on Training

JavaScript is one of the most popular languages in the world. It is the dominate language of the browser and is growing increasingly popular outside of it. It is used to create servers with Node.js, and to create mobile apps with frameworks such as Titanium and Ionic. It is even used to create levels in many popular computer games.

But inspite of its popularity most programmer never bother to study it. Partially it is because it looks familiar. If you program in C, C#, C++ or Java, JavaScript seems like a language you already know. But looks can be deceiving.

Unlike other object oriented languages, JavaScript lacks classes, so people waste valuable time trying to create them. Instead of class inheritance, JavaScript has prototypical inheritance. It is a strange but beautiful way of doing inheritance. Too bad most developers never learn to use it.

There is a trend in many imperative languages of late, adding functional programming features. A few years ago C# added lambdas and LINQ and recently Java 8 also adds lambdas. What is a lambda? It is a fancy way of saying anonymous function. JavaScript has had that ability since 1995. It also has first class functions, which means functions can be used almost anywhere a value can. They can be passed as parameters, returned from functions, stored in variables, arrays, and objects. This also means that JavaScript has high order functions. What are high order functions? It is when a language can both pass functions as parameters to functions and also return functions from functions.

I am going to be teaching hands-on JavaScript in the Los Angeles area later this summer 2015. Why should you study JavaScript? Because understanding JavaScript will give you the ability to unleash it. You will understand concepts that you may have only glossed over before.

  • What the "use strict" expression actually does
  • Why there are four different ways to call functions
  • How to remove nasty loops from your code by using recursion
  • How to write pure and compose-able functions
  • How write mutation free code
  • How to write code which is easier to unit test
  • and much, much more

I will have more information once the dates have been confirmed.

The Rockncoder Reference Page

When I tell people that I've been developing software for over 35 years, first there is disbelief and occasionally the very flattering, "You don't seem old enough". But I have been at this a long time now. I sold my first application a learning game while still in high school in the l979. 

Recently I've decided to create a list of my talks, apps, games, conference appearances, videos, etc. together in one place. The list isn't complete yet but here it is:

SoCal Code Camp San Diego 2015

The always free SoCal Code Camp is coming to UCSD in San Diego the weekend of June 27th and 28th. I am actually going to take it a bit easy this time around and only do one talk titled, Functional JavaScript. This is something that has grown closer to my heart the last few months as I've ponder why my code isn't quite as nice as I'd like it to be. In my search for new ideas, I've run it an old one: functional programming.

Functional programming has been apart of computer science pretty much since the beginning with Lisp, invented in 1958, being the first major language using its techniques. Functional programming eschews mutating variables and espouses pure functions. Things which are very hard to do right in OOP, like compose-ability are trivial in FP.

Please come and check out my talk and be sure to check your interest so that we can get the proper size room. For those who have never been, UCSD is in the amazingly beautiful La Jolla area of San Diego. It is very close to the ocean, shops and restaurants. Code Camp is a perfect excuse for a weekend vacation. Who knows maybe you can get your company to pay for a hotel room since there is no cost for the training.

To rate this talk:

Here is the full talk description:

For most of its nearly 20 years, developers have tried to make JavaScript more like other imperative languages like Java and C#, but was that wise? Unlike those languages JavaScript doesn't have class inheritance or information hiding, but it does possess high order functions. What are high order functions? Function which can both be sent to functions and return from functions. This allows JavaScript to be programmed more functionally.

Functional languages like Lisp, Scheme, Clojure, and Haskell espouse the beauty of pure functions. What are pure functions? Functions which always produce the same output when given the same input without mutating any variables along the way. This also makes it trivially easy to compose new functions by combining older ones, while in imperative languages, creating compose-able objects can be rocket science hard. The difference between functional and imperative programming can be described as the difference between telling the computer what to do (functional) and how to do it (imperative).

Functional programming can be a bit difficult to wrap your head but in this session I will give some examples of common programming problems that we face everyday in JavaScript and see how functional programming can help us.