Tuesday, December 29, 2015

History of my Javascript (random thoughts)

Loosely coupled, well-supported and easy to use.  SailsJS really is the epitome of a NodeJS ORM/MVC framework. I ended up using SailsJS  because I expected certain standards and they delivered.

NodeJS has matured over the years and multi-core environments make it so much more awesome!

I have always tried all new technology and dabbled in:

  • ASP 3.0
  • XML/XSLT
  • .NET
  • Visual Basic
  • JSP

However, I lived in Ruby land for a few years and grew through Ruby 2 and Ruby 3 and found that maintaining love for it was more pain than it was worth.  Gems and libraries died off from support, assistance was hard to find.  Ruby and Ruby on Rails as a trend became a maintenance nightmare.

These downfalls are not due to the language or framework, but due to the fact that "IT" constraints don't upgrade as fast as the development arena does. We were stuck with old software for way too long.

I worked in PHP for quite a while, Codeigniter, Symphony, Cake and Zend.   All good but somehow never felt right. Seemed like a hybrid of Perl with Java and C conventions.  Documentation was great but consistency behind usage was all over the place.  I had a good 'bout of about 10 years with PHP and just gave up as NodeJS, Dart and other JS related languages started to peak.

I turned back to my core, what I knew, and Javascript was there.  The concepts of:

  • Easy to understand
  • Prototyping
  • Mutable objects
  • Lambda support
  • Asynchronous by design
... were so natural to me. Moving from frontend JS to NodeJS was so easy.

Scared by the past failures of
  • jScript
  • Apache Jaxer
.. server-side JS just still sounds bad. 

However, knowing Google and their V8 Engine was taking storm over the initiative was a HUGE revival!

I am very happy that I have turned back to my core knowledge as it has provided many awesome solutions.

Long live Javascript!




Tuesday, December 8, 2015

I Love Javascript but...

I love Javascript. It is the language of my choice.  I can do everything with it.  I love NodeJS as well.

But, I hate when I open a project in an editor with Javascript.  Browser-side and server-side code, they all have .js extensions - eek!

It is easy to confuse your IDE with multitudes of Javascript files that are named the same but are in completely different interfaces of your application.

How to solve?  Perhaps adding some silly extra extension to your frontend files like:

clients.interaction.js

But who wants to write that extra suffix?  Sure you could make it shorter like "ui" or whatever. We do have EJS which heralds the distinguished .ejs extension but it still looks very close to .js.  Perhaps:

clients.view.ejs

Now onto backend, we like our short file names, Clients maps to clients.js in a controller, right? Again, if we kept the nomenclature throughout the app, we might have "clients.js" for a:
  • UI processed Javascript file
  • UI template Javascript file
  • Controller file
Oh yeah, forgot to mention the potential model:

clients.model.js

I just think that adding all those "dots" is silly for application but an IDE that lists all files can easily make you lose your place, even if you have navigated into the correct folder.  Therefore, we might need to think about a standardized convention - or do we?  Or is this ask stupid and petty?  Not sure, but I do find myself opening one file just to close it after I realize I am in the wrong folder.

We could go with the acclaimed CamelCase model and that would suffice but enforcing case-sensitivity on files sucks for Windows users.  It would look pretty though:

  • ClientInteraction.js
  • ClientView.ejs
  • ClientController.js
  • ClientModel.js
Any ideas are welcome for managing modern NodeJS applications.

Monday, December 7, 2015

How Did I Get Here?

First things first, pardon me being all over the map in this post, it is rather general as I just write what comes to mind.

I have spend the last 5 days:
  • Learning oCaml
  • Writing Python scripts
  • Remembering my Perl days (and writing code)
Isn't technology super fun?!  I can't say it has been a bad experience. The issues I have encountered have challenged me to make different decisions and find smarter ways to achieve short-term goals.

At my core is VanillaJS.  Back in the day, I was all LAMP stack.  I moved into MVC more and delved into PHP and Codeigniter, Zend and Symfony. Can't forget to mention the shit-pile we call Drupal and the wonderful yet awfully insecure WordPress.

I was tired of that and moved into Ruby and picked up Ruby On Rails.  Awesomeness was there but short-lived - it just didn't scale well and the developers were too arrogant for my taste. 

I originally started development without code at all - I was a designer using charcoal pencils, drafting material and eventually Corel Photopaint.  

I was an art major, I was and am still talented with art - not sure why.  I also am a music "guy" - have played drums since I was ten years old.  I also tried: Trumpet, Trombone, Saxophone, Guitar, Piano. I stayed with drums for some reason and didn't find passion in the others.

I actually learned that I wasn't an art major about one year into college. I hated the judgmental instructors who wanted to draw on my shit. I changed over to music.  Hell yeah! I'm gonna be a music major!   Nope.  That was boring as fuck and seemed eerily repetitive of my high school days; time for a change!  

I became a cartographic design major.  It seemed right, a mix of computers, art, science and such - what fun. Except that every other student in my classes had "super computers" of 1994.  I hand drew all my shit, laid lines on grid paper and used technical tape to make fancy diagrams.  I was doomed in that idea - I needed a computer!!

We always had computers in the household.  My father somehow would obtain the "leftovers" from his workplace which included an old Apple IIe, Commodore Vic 20 and some brand of MS-DOS workstation.  We also had that wonderful and loud dot matrix printer - geez were we cool!

With that MS-DOS computer we had Windows 3.1.  I had to load it from 5 inch floppy disks to run it every time; it wasn't very efficient.  I didn't really get the whole idea of the GUI that Microsoft had developed and I turned to making something useful with QuickBasic

I was collecting a lot of toys during that time.  Truth be told, I was a hoarder and scalper.  I had every Power Ranger, Spawn and Star Wars figure and I was determined to make money on selling them.




Lo and behold came my first ever website, The "ToyScout" (no it no longer exists). My goal was to buy and sell Star Wars figures across the globe. Awesomeness of the idea is that it actually worked.  I collected about one thousand dollars of foreign toys making overseas trades for my expensive hobby. I truly had the holy-grail of global modern Star Wars to later sell at conventions and toy shows.

My first programming application helped me keep track of my inventory of toys - it was awesome! I could easily lookup any item that I had and move it through my QBasic application.  I was very proud f myself.  Being the son of a great Fortan developer, I suppose I picked up something. 

I have to continue more later, this story can go on forever...