A path for quickly becoming productive with Node.js

If you’re an experienced web developer, and you want to learn Node.js and be somewhat productive with your time, here’s an easy path to begin with.

I’ll assume you know raw JavaScript and a little raw Node. Enough JavaScript to be familiar with the DOM, anonymous functions, and callbacks. You dont have to know React or anything of the sort.

First up, Learn enough to recognise the new syntaxes in ES2016, along with promises, arrow functions, generators and async await. You don’t have to be good at them; just be able to know how to read them.

Now learn enough Node and NPM to start a vanilla Express server and realise how much work it would be to write a whole fully featured web application in it.

Now quit jQuery, cold turkey.

If you come from using a Rails-like framework such as Rails, Django or Laravel, the though of scouring NPM for all the packages you’ll need, you’ll be wanting someone to make opinionated decisions about the right packages for the job for you. May I suggest Adonis.js. It comes with all the MVC, Authentication and ActiveRecord stuff you’re used to, along with loads of other good stuff too. You’ll have a good reason to learn about Generators, Promises and async await here.

Resist the urge to jQuery.

If you want to write your front end as a single page application (SPA), to run in front of your API, you could use what you’re familiar with, or you can start afresh with Vue.js because it has the gentlest learning curve of any of the mainline frameworks, all the best stuff from the other frameworks, and you don’t even have to learn a bundled/compiler if you don’t need it.

Vue is easy to learn, easy to adopt, and you’re never forced into complicating things too early. Go at your own pace, and eventually you’ll learn about components, which will change everything. Get started with Vue’s single file components and never look back.

With Vue, you don’t need a router out of the box, until you know you do. You also don’t need state storage until you know you do.

You want to write a universal app, or use Material design you can do that when you want. Heck, you can even bring in JSX if you’re feeling that. And you dont have to add any of these packages to your project, until you need it, and in any order.

tl;dr: Learn enough JS and Node to spot new JS language constructs, starting with Adonis will give you a reason to learn the new stuff while giving you an easier path to success.

Disagree? Got a easier, faster path to productivity and learning all this crazy JS? Chime in below, or hit me up: @Glutnix on Twitter.

HOWTO: Fix file sorting in Finder’s column view on Mac OS X Lion

I’ve been banging my head against this one for a week now: Finder just wouldn’t sort things alphabetically for me. I use column view, and it seemed that my old ^⌘1 and ^⌘2 keyboard shortcuts weren’t working.

Mac OS X Lion’s Finder introduces two ways to sort: Arrange By and Sort By.

Arrange By is more useful in icon view and list view. Setting Arrange by to something else, such as Kind or Last Opened, will have Finder ‘arrange’ the file listing into categories which are ‘sorted’.

If you go to the View menu you’ll see Arrange By. If you then hold down Option (⌥) you’ll get Sort By. Here’s where I got caught out. If you have the submenu open when you start holding Option, you’ll need to have the menu close and reopen before you get the right options.

When working correctly, in column view it seems that the Sort By menu will be disabled unless you have Arrange By set to None.

There’s also a “Arrange” button in the toolbar now, which will display the Sort By menu when you option-click it.

So, if your sorting isn’t working the way you want it, here’s how to reset it:

  • View > Arrange By > None (^⌘0)
  • Hold Option, View > Sort By > Name (^⌥⌘1)

I hope this helps you in your file management endeavours. I ❤️ Lion!

Hat Tip: Barney-15E on this thread at Apple Support Communities.

A Rainy Day’s Entertainment

How do you stay entertained when you are snowed in?

Well if it was snowing, I sure wouldn’t be inside; Snow in Wellington? EPIC. I’d be out there enjoying it!

If it snowed so hard I couldn’t leave the house? Alright.

1. Video Games
I’d be all up playing any combination of Minecraft, DoomRL, Weird Worlds, Team Fortress 2, or Spelunky, or whatever! If my girl was with me, I’d probably Wii Bowl for a while.

2. Catch up on my bible reading
I’ll be honest, I’m currently more than a few days behind on Arise’s One Year Bible plan (M’Cheyne’s Classic). I probably should be reading up now as is.

Bible reading is pretty interesting when you have it in context, so I like to use a commentary like the ESV Study Bible. The Bible’s books, especially the New Testament was originally written by their authors with specific audiences in mind, which usually aren’t explictly me. For example, Paul’s letters were to fledgling churches around the Mediterranean: I think context helps a lot for understanding what’s actually going on and why the figures in the Bible wrote what they did. The ESV Study Bible has lots of great insight in its commentary.

3. Internet
I’d be online consuming past issues of every video on The Escapist, especially the Loading Ready Run stuff, catching up on my RSS feeds (though I do have that almost down to a science).

4. Read or listen to a book or podcast
I love to read, or listen to, science fiction. It gives me a chance to see inside other (fictitious) people’s lives and how they would react to crazy circumstances. Science fiction isn’t so much about the explaination about how futuristic technology might work, but rather how we as human beings might react to it, and how we as a race might change because of it.

What would you do on a snow-day?

What’s 2011 got in store for me?

I’m taking what might look like some big risks this year. I’m giving up my well-paid full-time work for an internship at my church in Wellington and a part-time job at a Wellington PHP and ActionScript house.

Part of the internship at Arise will be doing a Local Church Certificate qualification. It’s not much, or probably even all that difficult at NZQA Level 4, but means I’m a student again. Probably a financially-challenged student. The rest of the time I’ll be helping out where my skills and time lead me. Most likely helping with the website and creative side of things, and with anything else that I can help out with.

Slicing my work-time in half when I’m (almost) 30 isn’t something I intend to take lightly. I probably wouldn’t have applied for the internship if my buddy Dan didn’t offer me part-time work at Instinct working on ActionScript and PHP projects.

I’m pretty excited though. I’m gonna be put through this tough time to come out at the other end a different person. Beyond what I’ve said above, I’ve got very little more idea of what will go on. But I say to all of it:

Come at me, Bro!

😉

Programming for Health: A Reflection

I’m on ‘staycation’ –annual leave from my normal day job at Natcoll. Staycation because I’m not actually vacating where I am: I’m still at home in Wellington.

I’ve been volunteering at Catalyst IT working with Brenda Wallace to work on projects of her choice. She assigned me to work on Laconica (an open-source version of Twitter that works in a distributed fashion). In order to do so I’ve had to learn a little about many different technologies, like PostgreSQL, the weirdness of Apache+PHP on MacOS X 10.5, and overall, how to checkout and contribute code to an open source software project with Git.

I’ve now had three code merges into Laconica, albeit very minor ones, mostly fixing bugs.

I don’t even use Laconica. (Twitter is working just fine for me, thanks.)

But I feel great.

Computer programming is something some have described as the most complex thing humans have invented — it’s all abstract, there are few corollaries to it in nature. Probably the only thing more complicated is quantum mechanics (but that is, in fact, nature).

My job is to explain, demonstrate, and encourage people who have never programmed a computer in their life (let alone their VCR) to create rather complicated things we call websites.

Why have I enjoyed contributing patches so much to an project I don’t use or much care about? A couple of reasons:

The Zone

The elusive Zone has many names; Wikipedia refers to it as “flow“. It’s that state of being you get when they’re so intensely focussed in the task at hand that time and reality become irrelevant because you’re so energised and focussed and involved at what you’re working on, and having good success at doing it. You come away feeling elated and energised that you’ve completed something of value.

I haven’t been in The Zone for nearly four years. I’ve been teaching people how to program for nearly four years now, and nary the mind to knuckle down and flex my coding muscles. I’m too worked up with office politics, helping my workmates with the technology, and thinking that I wasn’t good enough to be in the industry.

Learning

It’s good to know that I can do it, though to do it professionally, I’d just need to learn more about the processes involved.

I’ve had to learn how to use Git, how to create PostgreSQL users and databases, and submit my finished code to the project administrators for merging with the mainline version of the program’s code.

I don’t normally get to be a learner. I’m a full-time teacher, and what I have to learn is usually because I need to teach it.

It’s nice to learn things for me and me alone. I may never get to teach what I’m learning here, but what I’ve learned is helping fulfill me (more on that later)

That old adage “Those who can, do. Those who can’t, teach”. It’s lies.

Actually I’m a tutor, but that’s just a particular kind of teacher. Not meaning to blow my own horn, but according to my student evaluations I am actually a really good tutor. Sure, I have my weaknesses, but overall, apparently I rock at it.

And I really enjoy teaching. It’s rewarding when the metaphorical light-bulbs turn on above the student’s heads. Some of them slowly brighten, some just pop on, and some of them shine more powerfully than others, but the lights do turn on. To know that a learner now understands one of the most complicated things there is to know,

I was at Wordcamp New Zealand here in Wellington over the weekend, and Nicki Gemmell was talking about using blogs at primary schools around New Zealand. She related how uploading an image to a blog was something a principal got excited about: “I uploaded a photo to our school blog today; how cool is that?!”.

As a programmer who has written photo upload functionality, I forget how far I have come and how valuable the skills I have really are. The challenge of teaching people to do things is fun and rewarding. Teaching students to do this even more complicated stuff is the same but even more challenging.

Teaching programming, from my own experience, is the ability to communicate the concepts and foster the understanding and use of them. I was told by a trainer there were four levels of competency:

1. Unconscious Incompetence – you are unaware that you don’t know how to do X.
… awareness brings:
2. Conscious Incompetence – you are aware that you don’t know how to X.
… learning brings:
3. Conscious Competence – you can do X, and you are thinking about it when doing it.
… practice brings:
4. Unconscious Competence – you can do X, but you do not have to think about it when doing it.

I say that there’s a fifth level: where you have become once again conscious of what it is you are competent at. And that’s the level where you’re ready to teach it.

To be able to teach, you must be able to learn, and then go further so you can show others the way.

Those who can teach, do teach.

People

Okay, I’ll be honest: being around Brenda and the other like-minded geeks at Catalyst IT has been a really energising experience. Being able to vent frustration at code and technology, bounce ideas off each other and have fun while doing it has been great.

But working on Laconica and spending some time reading other peoples code and improving it, and learning the technical, and social aspects of doing so has been fun and very enlightening.

My motivation for staying a teacher has been pretty simple: Hell is other people’s work. Most of the employment in the industry has been creating websites for companies; wish fulfilment for others. I could change the world one organisational website at a time, or I could change the world 20 web students at a time.

But working on an open source project has let me use my programming skills to directly improve, ever-so-slightly at this stage, the lives of people around the globe. By making the software they use better.

Having that sense of purpose in what I are doing is really important to me. I don’t want to just be working to collect a pay check: working to live. And I don’t want to be living to work either. I just want to do what is worthwhile while I’m alive: live life to the fullest. Use the abilities I have to do things worth doing.

I am a teacher. I am a programmer. I’ve been neglecting the programmer side of me.

“Computer programming is tremendous fun. Like music, it is a skill that derives from an unknown blend of innate talent and constant practice. Like drawing, it can be shaped to a variety of ends – commercial, artistic, and pure entertainment. Programmers have a well-deserved reputation for working long hours but are rarely credited with being driven by creative fevers. Programmers talk about software development on weekends, vacations, and over meals not because they lack imagination, but because their imagination reveals worlds that others cannot see. Larry O’Brien and Bruce Eckel