Not Development related, but I just wanted to draw attention to something that’s important to me in my little corner of the Interwebs…
August 19 was Earth Overshoot Day. It’s a day every year where our demand for natural resources outpaces the Earth’s ability to renew them.
Here’s an article that does a better job of explaining how scientists collect this data and what it means.
In the past couple of months I have rekindled an activity that has been a part of my life for as long as I can remember. I have always loved to write. When I was eight or nine, I had started a Road Hockey league with my friends. Being one of the only kids on my street with a Computer and a Printer, I did what any kid my age would do. I started a Newsletter for my Road Hockey league.
My Newsletter had a circulation of about twelve people, a third of that number being family. My Newsletter got me a gig as a “journalist” for my School’s Newspaper. I would go to the School’s Sports Games and I would take pictures and write about the games. I found this to be incredibly fun and reward.
The years crept by and although I would occasionally get some very low paying or pro bono writing gigs, this skill and vocation fell by the wayside.
These days, I read A LOT. A disgusting amount of books and blogs and articles, etc. For fiction, I read a lot of Sci-Fi and thought it would be fun to try to write a Short Story. What I was the most surprised about was how competent and natural it felt. For many years I have attempted to build “fun” projects. Mostly, things like Mobile Games and Websites. But I have always found that my ideas would meet the inevitable “friction” of actually being something I could release to the World or even have it be useful. For example, with Mobile Games, I would run into obscure issues with the library I was using or my code wouldn’t be compatible with a new update, on and on ad infinitum. The bottom line is that my vision felt compromised by whatever technology I tried to use. Combine this with a day job that is also doing Development and you get burnout and frustration. With writing, there was no friction. My ideas just went from my head to the computer screen with no friction or compromise. It was an amazing feeling!
If you are feeling burnout or fatigue, if you’re feeling like you’ve read wayyyyy too much TechCrunch and HackerNews, I highly recommend just doing ANYTHING that isn’t Development in your off time. No Hackathons, no learning another language, nothing. At least . You will feel so much better and you’ll be surprised by just how much more productive you actually become as a Developer.
Although I’m somewhat late to the game on this, David Heinemeier Hansson (DHH) set the interwebs ablaze when he stated that Test Driven Development is dead. In fact, that was the name of his post. Whether I agree or disagree (I disagree for the record) is irrelevant. What I found odd was that this is still a headline that we still use. Indeed, in our industry many technologies or ideas die and are quickly replaced by new ones for better or for worse. My assertion is that something does not need to be declared as “dead”. Declaring a technology or idea as dead does not actually do anything, and in the days of Hacker News and somewhat “link-bait” headlines, actually has the opposite effect.
Ideas die or are replaced on their own. They have a lifespan and they are often stepping stones for the next idea. For example, the work of Sigmund Freud is pretty much obsolete in the world of Psychology. A professional Psychologist knows this and derides anyone who should happen to quote him. However, at the time his ideas pushed the profession forward. Although his ideas were largely incorrect, the question becomes: would the field of Psychology be what it is today without him? I’m not sure either way. However, to my knowledge, no one in the field officially declared his work as “dead” on a Psychology blog somewhere. It was PROVEN to be dead, and then later ACCEPTED to be dead. No formal declaration required.
My hope is that the industry of Software Development can move past this sensationalism and get back to a more scientific foundation in this regard. One of ideas proven through work, with a preponderance of evidence to support it.
For those of you in the know, you can specify the autoLoad property of a Sencha Touch 2 Store to true, false or an object. What this means is that when you create an instance of this Store, it will automatically call the load method and bring in your data. However, this seemingly simple feature can lead to some tricky bugs that can be hard to track down or cause your app to not work the way you want it to.
Here’s something that I found when going through the Sencha Touch 2 (2.3.0 to be more specific) source when debugging a particular issue. So there’s a method that you can use called Ext.getStore(). In the documentation, it simply reads that it will return an Ext.data.Store object. No fuss no muss…or is there!?! This method is actually a shortcut to Ext.data.StoreManager.lookup()! Now, you may be thinking “great work Sherlock! It says that right in the docs!”. To this I say, dig deeper…
This method will actually create a new Store if the supplied ID (passed as a string) turns up nothing in the way of an existing store. So where does this come into play? Well, don’t get me wrong, Sencha Touch and Ext are great libraries. I came across this as merely a weird situation where it could be a combination of inexperience with Sencha Touch 2 along with just a weird edge case. I found that I ended up with multiple “loadings” of a single store on several occasions due to the handling (or mishandling) of the autoLoad feature combined with Ext.getStore().
My alternative/workaround was to use Ext.data.StoreManager.get(). In fact, if you look closely at the Ext.data.StoreManager.lookup method, you’ll find that when it is passed a string, it will just return the results of calling Ext.data.StoreManager.get!
Now, I want to reiterate that this was just something I found to work in the somewhat verbose situations and edge cases I found myself in on what I would called a complex project. I would be welcome to feedback or war stories regarding anything you have come across with this.
Oh, I didn’t see you come in… Welcome!
Today is the third and final instalment of my chronicles in switching to Vim. In the past few days, I think that if it wasn’t going to work out for me then it would have been evident. I was able to use it in every situation in both my day job and side projects. I won’t give a recap of every point I could come up with in regards to why I think it’s a great fit for me, but I will just give a couple of highlights that I think you’ll really like.
I can’t tell you how much time this feature alone saved me! I found in many occasions I was editing both a view and a controller and it was infinitely handy to have both in front of me as well as the web app I was working on. Combine this with LiveReload and I was jetting through bug fixes to say the least. The just of it is that you use the :vsplit (vertical) or :hsplit (horizontal) and you get another “window” within Vim. From here you can open a file which is business as usual!
Overall, I would definitely recommend you at least try out Vim and see if it’s a good fit for your workflow.
Wow! I’m killing it with Vim! With my new workflow (I will detail in another post) I definitely feel very productive. On the surface, it doesn’t seem like much of a time savings in terms of switching back and forth between your editor and the browser, but when you are doing repeatedly through out the day, it really adds up. On top of this, I feel that I get distracted less such that when I see a bug or a problem with the code, I can just make the change right in the browser be able to use the Debugger in Chrome Dev Tools. The Terminal Chrome Extension also adds a tab in Chrome Dev Tools next to the ‘Console’ tab. So I have been coding in Vim as well as watching the Console for errors, etc. IT IS GLORIOUS!!!
I thought searching would be a little trickier than it turned out to be, but it’s just the ‘/’ followed by whatever you are looking for. Another handy-dandy thing I found was the go to line number command. Just type in the colon followed by the line number and you’re right there!
Now, if you’re a Vim veteran you’re probably laughing at my n00bishness (officially a word now). But laugh not! This is such a rad setup and Vim isn’t that hard to get used to. So for anyone who comes across this, if I can pick it up, so can you!
Sweet! Armed with the Terminal Emulator Chrome Extension and Vim, I was able to write the Intro article to this series in it! I didn’t crash and burn as I expected to. I definitely thought it would be harder than it is so far. I’ve even been able to use it as my primary code editor! This is exciting! Granted, I haven’t had to actually search for anything in a file, nor have I made use of any of the advanced features it offers.
As with trying anything new, it felt pretty awkward at first. I kept hitting ‘:w’ without hitting ‘esc’ first for example. However, I got up to speed pretty quicky so far and have moved on to using commands like ‘yy’ for copying a whole line for example. This is not painful in the least! So far I’m leaning towards making it a permanent switch from Sublime Text 2 but I will keep going for a few more days. Oh and I have LiveReload running too, so Chrome automatically refreshes on saving a file.
Now, if only I could find a Pink Princess theme for Vim I would be over the moon…
Why am I switching to Vim? I mean, I’ve been an avid user of Sublime Text for a couple of years and I really love it! Well, it has to do with this obsession of mine to be able to do my work exclusively in a browser. I have tried coding and what not through Chrome Dev Tools but found that it had certain limitations especially with saving files. I was discouraged that I might not be able to live out my dream of being a baddass ninja Front End Dev and coding in the browser until…wham! A sweet new Chrome Extension dropped which allows you to use your terminal right in your browser. Perfect! Except that doesn’t help my code editing woes. Until I remembered that I watched a video course on something called Vim, which is derived from vi. For those of you who don’t know what vi is, it’s basically an editor that runs in your Terminal. Or I like to describe it as SysAdmin p0rn.
So. Vim. Bam! Except, I have almost no experience with it aside from watching a course about it on TutsPlus. I have used emacs a little, but I’m told there is an epic, nuclear war between vi and emacs, so something I try not to take sides on. But I soooooooo want to do all of my coding in the browser and try to fulfill my twisted dream of being the Neo of Front End coding.
Thusly, I give you an inside look on my transition to Vim from Sublime Text 2! I will be using it for work and personal projects so hopefully it doesn’t severely drop my productivity such that I am canned 😉