Thursday, March 27, 2014

Please Open Source people: Use /usr/bin/env!


A new pet peeve of mine is people assuming that bash is either in /bin or /usr/bin in their shell scripts. Please folks, change your shebang to
#!/usr/bin/env bash
And stop hardcoding where you think my bash is.
Not just bash either:
http://stackoverflow.com/questions/11889892/shell-script-shebang-for-unknown-path

Wednesday, January 1, 2014

Rebooting my Mission



Eyes on the prize, reboot the mission
I've lost the sight, but not the vision
Eyes on the prize, reboot the mission
I lost the sight, but not the vision
- The Wallflowers Reboot the Mission

Ah it is finally 2014. After a long and hard year it is time to turn the page on a new one. This song off of The Wallflowers' new album was rattling around in my head when I woke up today and it encapsulates what I want 2014 to be. In order to do that though, I need to own up to the things that I did not accomplish in 2013. Where I lost my sight.

Personally 2013 was a roller coaster. I started off Jan 1 with a neck spasm so that should have been my clue that things were going to be "fun". Shortly there after my wife had a major set back with her knee recovery and was in a lot of pain. On a positive note we got to spend a very restorative week on vacation, our first real one in two years. I also got to go back home for an awesome football game that served as another mini-vacation for me.

Work-wise, while things were stressful at times, it was a pretty good year. I got to go to PyCon again, expanded my knowledge of SQLAlchemy, drank a gallon of AngularJS Kool-Aid(and yes I still like it), and started learning about GIS with PostGIS. The highlight of the year for me had to be our at work hackathon. I pitched the idea to have us get away from the project grind for a couple days. While my own project that day was a bit of a miss, the way the team was so enthusiastic about it and got so much out of it made me feel awesome.


On the side-project front, it is hard to find much positive. The first half of the year I spent trying to learn more and more about healthcare and a way to make my vision a reality. Mentally I took the summer off, so that was not a total waste. August was huge though. August was when I started to dip my toes into the startup waters and pitch my ideas and get feedback. While it was brutal at times, it was also incredibly valuable and helped me focus on how I want to start the project. I guess why I feel like things were so terrible is that I lost the momentum I gained during that time. Stressed ramped up and I could not fit in time to work on it and it was terribly frustrating. The positive take away was that I was able to let myself give up for a little while. It sounds terrible, I know, but at this stage, doing it totally on my own, I needed to give myself permission to walk away. Without that my work and my personal life would have suffered even more than they already had.

Ok, now that the dreary recap is over, what about am I going to do with this new year. You know some people hate resolutions or think that they are a load of bull however I love them. There is something about looking at the year ahead with dreams and hope that helps give me perspective. For my resolutions this year I am going to try a little different approach. In business and organizations there is a concept of a Moon Shot or a Big Hairy Audacious Goal. The idea is to set a grand overarching goal that will shape the rest of your goals and decisions. What is forgotten when setting these big goals is that, even if the larger goal is not accomplished, striving for it should cause improvement. 
So, without further ado, here is my BHAG for 2014: 
I want to launch an alpha version of my healthcare app by June 2014. 
To make this happen, without driving myself insane, I am not going to commit to it being perfect or successful, just that it is out there.
To help ensure success here are some of my supporting resolutions:
1. Blog, once a week, about the process. It could be an emotional brain dump like this, it could be tech related, whatever, but I need to express what the progress is. I think it will help with perspective.
2. Set aside about one hour a week to assess the previous week and look toward the week ahead. I guess I want to treat my life like a status meeting. Oh and store it in Evernote to keep track of it all.
3. Workout and do my PT exercises. It will be really hard to do what I want if my body falls apart.

So there you have it. I may have lost sight of a lot of things and of the path I want to be on in 2013 but I never forgot my vision. This year it is time to make the vision a reality!

Wednesday, July 24, 2013

Angular Part 2

So, two months ago I started my Angular Journey. One of my co-workers today asked if I still liked it and I have to say: yes!



Not everyone in my organization loves it though.

The Criticisms
"It is too magical", "The docs kinda suck", "What a weird style", "It hides too much", "It does too much". These are the things that I have heard after introducing it to my fellow coders. These are all people I respect and are all what I consider programmers first. They are generally used to either jQuery or YUI and much more comfortable than I with the innards of Javascript. As a JS n00b and a pragmatist at heart I suppose I don't have the same perception on how things have been done nor should be done in JS. I merely wanted to get things done, period.

To be fair there, Angular can be pretty hard to wrap your brain around: the rendering pipeline and stages are starting to become more obvious in docs and talks but can be pretty strange; data sharing outside nested controllers is not readily apparent; the docs in general need some updating and improving. The underlying architecture is a complicated and crazy beast with timings and event handlers  and is still non-obvious. I have seen the question for how to do something after the directive renders a lot for example.

Part of the problem is also angular-ui(at least for my co-workers). They have built some CRAZY awesome directives and tools that do some very advanced things with not a lot of code. On the flips side, trying to explain the innards of angular-ui to these folks(looking at you $dialog) along with 'resolve' and the rest of it was a major challenge and I don't think I completely succeeded. I have to give the UI folks credit though. It is still a young project that was going through a significant restructure during the course of my project.

I also have to take a good chunk of the responsibility myself. I didn't really understand the framework, nor my audience really, before I tried to evangelize them. Angular is a full complex framework, but it is very well done and well led.

The Positives
The overall structure of the application, and encouraged by angular-generator, plus the clear separation of responsibilities and shear lack of code was a major hit. Also, while I am still learning it, the emphasis on testability was heartily hailed. We like tests here, and have several TDD zealots so I have a feeling that I need to spend more time learning that piece in general. One thing that seemed to calm concerns has been the awesome and active community. The fact that there is so much excitement by the wider community on top of the support from Google gives me confidence that it won't disappear like other frameworks.

My Final Take
After all of this I still really enjoy using this framework. The community, the improving docs, the design and coding standards all allow me to be very productive in not a lot of time. I do wish that the project leads were a little more transparent though. We got lots of fun information about 1.2 and lots of great code is in the unstable 1.1.x series but there has been no RC and no timeline released. I just simply prefer developing against stable branches than unstable ones but there are so many fixes and features in 1.1.x that it makes me impatient. All in all though, as I look back at this and also look at the code we have currently on the site and the lack of code that I had to write my thoughts settle on this:

I am sure glad the Angular people do!

Wednesday, May 1, 2013

The Destro Slacker learns AngularJS pt. 1

(I swear that gif should be my mascot)
Ok, yes I have slacked on my blog. Considering I only had one post, that is a pretty low bar that I managed to miss, but anyway. Today I will start describing my journey with AngularJS.

So, in the interest of full disclosure, I am a front end n00b. My programming background is primarily steeped in the nasty sections of data processing/operations and reporting(humans suck, and so does Microsoft Word). My Javascript and HTML experience at my current gig has been mercifully confined to constructing small widgets and minor template changes. That has changed on my curent project.

Project Setup
Obviously can't get into too much detail but basically the project is an internal tool that will accept a properly formatted CSV file and import it into the Database. The frontend has the responsibility of providing the current database state, displaying available custom pieces of data to paste into said CSV like image locations, and abilities to download the current state of the database into CSV form. The division of labor on this project is not necessarily optimal. The developer working on the background is much better, and much more comfortable, working on the frontend JS than I. She is perfectly capable of doing outstanding work on the backend, but normally that becomes my role because I am so comfortable, however you gotta grow! Now, you may say to yourself(in full Emeril Lagasse voice, though I maybe the only one who remembers him doing this), "Self! Why the f are you making a big production over such a simple app!?" Well, my primary reason is to learn as much as possible. Plus, I am a little "coo coo for cocoa puffs" over Angular. Thankfully my boss is giving me a bit of a leash.

For The Love of the Yeoman
I'll detail my crazy process that seems to occur when evaluating and learning new things later(more really for my own cathartic benefit) but let me just say first that I love Yeoman and Bower and the fun, yet weirdly named, Grunt. Since I am such a n00b these tools have made discoverability and use of web frameworks much nicer and close to backend dev. The only prereqs are Node and its package manager, NPM. One HUGE thing to be aware of, at least on OS X, is that there is a wee permissions issue. After you install Yeoman, check the .npm directory in your home dir. Mine was set to root as the owner and made the rest of the angular uses not work. Other than that Yeoman has provided a very sensible default layout, great support(via Bower) to add other js items easily, and great testing and running of code support via Grunt.

The Zen of Angular
My initial impression of Angular after reading the docs, the tutorial and the great book was that this finally fit my brain. Javascript has always seemed weird and somewhat ugly compared to the happy land of Python. This framework made everything make a lot more sense. However, I was still not prepared for the brain melt that can be Angular. It is a very powerful framework that relies heavily on Dependency Injection and custom HTML attributes and was very orthogonal to any examples that I could find in our codebase. Not to say that is easy to grok either. Our existing structure is, on a spectrum from horrid to nice, based on jQuery and all that entails. Callbacks, custom templates, and heavy heavy DOM manipulation, you get the drift. All on top of, what I feel, is an awkward straddling of server side and client side templates.

Angular on the other hand is a full MVC(or MVVM) framework that even separates itself from others, like EmberJS. It's primary focus seems to be on extending HTML through custom directives and the lovely secret sauce of data binding. The Zen of Angular is all about stopping yourself from pure jQuery style programming and really forcing you to separate DOM modifications(Directives) from view building and population(Controllers) and your base DATA(Models).


More Meat
I promise, seriously, to post more on my journey through Angular Land. Today was officially day 2 of being immersed in a real project for it so my impressions are all rather raw. On a side note, I would like to thank irc user michealw for talking me through some of the issues I was having fitting Angular into my brain. Not only does it seem like it is a great framework, but it has a good community behind it too.



Saturday, March 23, 2013

PyCon is chance to start anew


The 2013 PyCon in Santa Clara was my second ever and my first where I felt like a real programmer. The previous year my company had not released anything running Python yet(though it was working through deployment). Now I have helped pull two large projects through. So, in a way PyCon is my New Year, or a programmer's New Year. It is a time to learn, to celebrate, and to reconnect with the people behind the IRC nicknames. It is also a time to reflect on the past year and dream big dreams for the year ahead. My plan for this blog is to share my journey to realize one of my big dreams: start my own site. I'll share what technology decisions I make, why I make them and the overall journey from the idea and successes to the boneheaded mistakes. Should be fun!