A programmer’s nit-picks

Programmers are notoriously nit-picky. We have opinions, stances, and preferences on just about everything and tend to get into frivolous (and often heated) arguments and discussions about our nit-picks. Compiled language vs. interpreted language? Nit-pick! Tabs vs. spaces? Nit-pick! Braces on same line or new line? Nit-pick!!!

In fact, programmers are so passionately nit-picky we invented a process to force our nit-pickyness onto others when they contribute code to our open source projects: code reviews! We even prefix some of our comments with “Nit:” for emphasis! (Do understand I am using hyperbole here. Code reviews are a good thing and I am grateful for them.)

Lately I have been reading the book RailsSpace (1st edition website) to expose myself to the Ruby programming language, Ruby on Rails, and MVC. I am not actually running any of the code, simply reading the book, code and all. It has been rather interesting and I may have to write a post on the experience when I finish it.

Continue reading “A programmer’s nit-picks”

Advertisements

Experiencing technical debt

In many metrics, I am young. I am 21 years old and fresh out of technical college with my A.A.S in website development. I am young in world and workplace experience as well as wisdom. I physically look young. I am told I look, on average, approximately two years younger than my current age (this has been going on for at least four years now). I am a young programmer, having only been a part of the world of code for three years. My coding style, abilities, and knowledge is limited. I am young.

However, though I may be young, in many ways I am not young. I have coding knowledge that earned me the nickname of a reference guide among my internet friends. I have coding abilities that, even as a one year programmer, impressed a then-four year programmer.

I have also seen with my young eyes sights often only experienced developers speak about. I have experienced within my limited experiences events only programmers of age understand. I have knowledge of things I probably did not need to know and sometimes wish I did not learn until later.

One of those things is technical debt.

Technical debt, in layman’s terms, is simply junk that exists in a system that should be cleaned up because it is a mess, is getting out of hand, and is giving you a headache but has yet to be dealt with. It may lie in the build pipeline, in code, in graphic creation, in documentation, in tools and workflow. Wherever it is, it is something that is not good and should be corrected to meet modern standards, guidelines, or ideals. Yet nobody has done anything about it for so long (for a variety of reasons) that the debt has become part of “it is just how things work around here.”

Continue reading “Experiencing technical debt”

JS – Avoid duplicating addEventListener()

I see this mistake way more often than I should. Someone adds an event listener with an anonymous function callback to an element (like a button) then puts it in a a function that may get called multiple times. While this very common setup may seem harmless, it can create some serious issues.

The problem is this setup will add multiple listeners to the element, a new one each time the function is called, meaning three calls will add three listeners, then when the event is triggered the callback will be run three times. This JSFiddle demo clearly shows the scenario in action.

Continue reading “JS – Avoid duplicating addEventListener()”

Possible move from WordPress.com?

There is something I have been thinking about lately, and I would love it if you, my readers, would express your opinion on the matter. 🙂

As you may know, I recently celebrated four years on WordPress. This blog was some of my first real exposure to the Web. Though at times it has been hard for me to publish anything, I have blogged long enough that I feel guilty if I do not publish something on a consistent basis. I enjoy blogging and only wish I had more time to write out all my thoughts, observations, and experiences as primarily related to programming and website development.

Continue reading “Possible move from WordPress.com?”

Notepad.exe in HTML5 and JavaScript

On the morning of 10 October, I tired of working on my capstone and had finished contributing a patch to an open-source project, I decided I needed a small, fun, project to quickly create as a change of pace. A few minutes later, either inspirational or pure randomness stuck: recreate Windows Notepad.

Continue reading “Notepad.exe in HTML5 and JavaScript”

JS – Smooth scrolling without jQuery

You know what link anchors are, correct? They are used to jump between different sections of the same page. Quite often when a link anchor is clicked, the page smoothly scrolls to the desired location. However, smooth scrolling is not the native behavior. No, the native behavior for link anchors is to instantly jump between sections, which can be jarring and unpleasant. That is why many developers smooth it out using jQuery scripts like this one.

I too enjoy it when anchor links smoothly scroll, but for the last few months I have on a “jQuery fast” and it has severely limited my smooth scrolling options. Smooth scrolling is impossible to recreate with CSS transitions, I have had limited success using requestAnimationFrame, and fun scroll-to-top buttons like Elevator.js are not appropriate. I have really been in the dark on filling the hole left by removing jQuery.

Continue reading “JS – Smooth scrolling without jQuery”