Only the best powering Lightning

It is Sunday night, CBC is going well and no server hiccups at all, so I’d take a bit of time to post some stuff and benchmarks we’ve hit with Lightning.  Lightning is the name we are calling our new platform.  Not only does it sound better, it also works with a few other products that are coming out that support Lightning. Lightning is a name that has meaning for the goals we are looking to accomplish.

Continue reading…

What is clean code?

I’ve always really wondered what people thought when they hear the term “clean code”.  I often hear people say it is commenting your code, while others say object-oriented programming, and some just say “no spaghetti code”.  While I agree with all those, I tend to lean towards object-oriented programming the most.  In fact, I don’t even believe commenting your code should necessarily be a function of clean and legible code.

Lately, my team and I have been tackling a goal I set to clean up our code, to make it faster and more reliable. Prior to starting this project, we had just over 200k lines of code.  Had a lot of duplication of functions, a lot of code that could be simplified by turning into more generic functions and a bunch of functions that existed but never used.  200k lines of code is a lot, but we are also building a very complex system and we do use some open source libraries like Mootools that add to the total.  However, given that JavaScript has never been particularly nice with OOP, it is difficult to make nice clean extensible code and save on lines of code.  We’ve built hacks into our JavaScript to mimic OOP to our best abilities, but it still isn’t as perfect as you’d find it in languages like Java.

As you can probably tell, my approach is to cut down on code by making functions and existing code more modular and used by more sources, as opposed to living in the cache as a one time use function.  Granted that the function is clearly written, declaring variables in plain text and using variable names that make sense for what they do, commenting becomes much less relevant, especially when the functions themselves are less than 30-50 lines of code (including line breaks). Commenting is something I felt was always added to help another developer understand one developers sloppy writing.  Yes, creating code is like writing.  If you cannot properly outline your introduction (declarations), your content (the main code) and the conclusion (clean up and return statements), then no one will understand what you are attempting to carry out.

Continue reading…

Algorithms vs the world

[EDIT: For some odd reason, WordPress decided it wanted to delete the rest of this post… so here’s to writing it again]

Haven’t you ever told yourself while in school : “I won’t ever use this again, why am I learning this?”.  Well I do all the time, being that I am fresh out of university, those are still thoughts that continue to come to me. However, recently I’ve discovered that I am beginning to use concepts learned in school in order to adapt them to real world scenarios.  More importantly, I am using algorithms.  There are two algorithms I am using primarily these days, that revolve around Tree Structures and Statistics (as in that really confusing class you need to take when enrolled in Computer Science).

Continue reading…