JavaScript Ruminations

Kadu Diógenes
2 min readDec 6, 2016

--

JavaScript was always a big pain for me. I remember the first days I started producing content for the web, I was very young and loved to make some dummy effects, like animate text in the browser status bar. Today we don't even have status bars ;-P

After this period of pure joy I started to use it professionally, but I never liked it, I still don't like it much, probably because I don't use it very much and consequently I don't understand it very well. CoffeeScript: Accelerated JavaScript Development teached me more JavaScript than anything else.

I use Rails and I really appreciate it, it's so simple and fucking powerful, but it don't give any structure for JavaScript, something that I appreciate but also have difficult to handle.

I appreciate because I remember the days I used JSF. I always have difficult to make it work with libs, plugins, components and all the JavaScript ecosystem available.

When I started with Rails, 5 years ago, I found it wonderful, finally I have the freedom to do what I want client-side with a very simple and clear defined interface to the server-side.

In this meantime JavaScript ecosystem flourished enormously. In 2014 I tried to learn ember.js and give up some months later. I play a little with meteor.js and find it really impressive, but it wasn't necessary for the work I was doing, nor the work I'm doing.

With Rails 5 I don't have the slightest need to use a JavaScript framework, but I still suffer and this is the reason I'm writing this, I need to register some aspects to reason about and improve how I use and develop JavaScript code.

I really like paloma, a gem that makes page specific JavaScript a breeze, but I have the feeling that I don't need it, this itch is bothering me so much that I really need to investigate if there is a simpler way to do the same thing.

I'm certainly that reading jquery-ujs and turbolinks code can teach me much things that I don't know. It's always impressive how much you can learn reading other people code.

The beginning for all this was some organizations I'm doing in the JavaScript code of a private project, I just realized that I don't know enough about JavaScript to do anything useful, but I think that now I know what to do:

  • Read and understand jquery-ujs and turbolinks
  • Do the simplest thing that could possible work

The second point probably is: I don't need anything more complex than jQuery plugins! Maybe everything I need is only unobstrusive JavaScript and jQuery plugins.

This appear a really firm ground to explore… neat!

--

--