hackerschool Log (?)

In June 2013 I started my three months at hackerschool. This is where I'll keep a log of what I'm working on/thinking/experiencing/etc. I'm envisioning something kind of like twitter, but less ephemeral. It'll be similarly stream-of-conscience. When I write longer-form posts that pertain to HS I'll link to it both here and on the homepage.

»»»«««

Thurs 8/22 - Last Day

»»»«««

Tues 8/20 - An overdue update

  • There haven't been many updates because there hasn't been much to update. I'm in the thick of the job search now which is equal parts stress and opportunity.
  • Whiteboarding is an interesting exercise. I don't hate it because I actually don't find it significantly more difficult than coding on a computer. I mean, it's true that there's no google or old code to look back on for reference but whiteboard problems are ideally self-contained/straight-forward enough that those aren't needed. I think the more intimidating part about whiteboarding is that it's something of a power play. It's like being called on in class, with every character you write (or lack thereof) scrutinized. The spotlight is on you and the only other person in the room knows if you're 100% right or 100% wrong.
  • Went to hear Nicholas Zakas speak tonight at Etsy about Scalable JavaScript Application Architecture. I really love that I live in a city where these types of opportunities are available. And the topics of today's talk served as a nice benchmark to show how much my understanding of JS has grown since before HS. I'm grateful for HS's emphasis on diving deep.
  • There are some really hard client-side problems being solved at really large scale. It's an exciting time to be a front-end dev. I'm looking forward to one day tackling some of these problems myself.
  • JavaScript is awesome.
»»»«««

Tues 8/13 - JSONP

  • More interview prep.
  • Dug into some of the "what's actually happening" behind JSONP today. It creates a new script tag directed at the endpoint, which is then executed like any other script tag (e.g. linking to jQuery on Google's CDN). So you can either have a function in the global scope to mirror the name of the executing script (thereby processing the json) or you can have jQuery bind it to the success callback for you via specifying the jsonpCallback parameter of $.ajax.
  • In conclusion, JSONP is such a freaking hack! I mean, I always knew it was a hack, but I didn't know it was this hacky.
»»»«««

Mon 8/12 - Interview prep

  • Interview prep. It has begun.
»»»«««

Fri 8/09 - Static Boilerplate

  • I was able to give a full day to the grunt-driven static site boilerplate idea, including a 3-hr trip back to DC on the train (cafe car FTW). And here it is! I'm pretty pleased with it.
  • As I worked through this I began to think that a grunt-driven jekyll would be much more awesome, mostly because of jekyll's ability to include html snippets. Or maybe a HAML-driven static site generator. Jekyll supports markdown on purpose; its focus is writing. But why can't great writing be combined with great markup/interactivity/aesthetics? Huh. That's an idea.
  • All I know is that one frustration I've had with this blog (which is in Jekyll) is that I'm forced to write a bunch of HTML in most of my posts to get the aesthetic I want.
»»»«««

Thurs 8/08 - Withdrawal

  • Had some stomach issues yesterday so I did without caffeine this morning. I'm pretty sure that singlehandedly destroyed any hopes of productivity today. Also had a killer headache.
  • Juniper Networks hosted us at the NYSE this evening. That was cool. We didn't get on the trading floor (we were usurped by a much higher net-worth group) but it was still good times.
»»»«««

Weds 8/07 - Quicksort

  • Finished quicksort.
  • I'm increasingly enamored with what grunt is capable of. I'm working on creating a project boilerplate that I can use for all static projects I work on, similar to yeoman but without the uber bloat that comes with creating a boilerplate potentially applicable to every use case under the sun.
  • The jobs talk was good with a lot of insight/tips for the search/interviewing/negotiation. No matter how cynically outsiders may view the intentions of hackerschool, the more I interact with the cofounders the more I believe in the sincerity of what they're trying to do. They truly do perform recruiting to keep running hackerschool and not the other way around.
  • Jobs, jobs, jobs. As fair warning, it might be jobs from here on out.
»»»«««

Tues 8/06 - Korean Burritos

  • Not a lot of commits today but it was more of a social day than a technical one. Talking to people about their projects is another reminder that the people here are curious, creative and smart. Talked about a JavaScript music-creation tool and a web server built in Scala. Sat in on a mini-intro to Angular. Ate an amazing burrito* for lunch (my favorite food truck).
  • * My korilla order: burrito with sticky rice, bulgogi, I skip the cheese/salsa, all the pickled toppings (kimchi, radish, etc.) and korilla sauce. You will not be disappointed.
  • Latter part of the day was more algorithms, with an hour of Quicksort lecture and some time afterwards implementing it. It works but there is some nuance to the homework problems that I'm still having issues with. Still digging it though.
  • Starting to think a lot about jobs. Definitely looking forward to the jobs talk tomorrow.
»»»«««

Mon 8/05 - Three Weeks Left

  • Merge sort and merge sort while counting inversions. Spent two hours trying to figure out why my code wouldn't produce the right answer until I realized there was an extra trailing line in the input file. Yup.
  • I'm starting to feel much more comfortable with recursive programming. That's cool. The content of the lectures isn't always very exciting but coding the algorithms themselves is great.
»»»«««

Thurs 8/01 - August

  • Spent the bulk of the day working on a code review for a friend.
  • Read through some more of the dataviz ebook and played some more with vizualizing data from a .csv or .json file.
  • The ebook emphasizes that d3 is more of an explanatory tool than an exploratory one. While I think there's legitimacy to that I don't think the distinction is a clear one, especially in massive datasets. I think the challenge when it comes to data-viz isn't so much the technical aspects of the viz itself (although they can get complicated), but picking the correct dataset in the first place and selecting an effective model for presenting it.
  • There's definitely an artistic component also. As with everything else tech, all else being equal it's always preferable to have an end product that looks nice.
»»»«««

Weds 7/31 - Karatsuba

  • Pretty much all algorithms today at a relatively slow pace. Implemented the Karatsuba algorithm, which is a recursive algorithm used to calculate n-digit numbers.
  • I think some people are born with the ability to completely understand recursion, but I think most mortals only really get it via practice. I didn't encounter many recursive problems as I worked full-time (at least I didn't notice them at the time) so this algorithms course is a nice (and at times difficult) change of pace. I'm digging it.
»»»«««

Tues 7/30 - Data viz

  • More algorithms today but not as much as I intended. You can only do so much algorithms.
  • A much deeper dive into data viz today with d3. The tutorials on the web are numerous but relatively shallow, so I was spinning my wheels a bit until I came across this: Interactive Data Visualization for the Web. It's an O'Reilly book that has a free online equivalent. It's great so far, and short enough that I can probably get through it in a couple days.
  • The sum of my efforts today resulted in this: http://labs.danielna.com/d3. Randomly positioned circles, with random colors, and random hover effects. Nothing to write home about but still amazingly simple to pull off with a relatively short learning period. D3 definitely has a "wow" factor to it.
  • I want to work towards visualizing something legitimate and I wish I had a dataset that I actually cared about. I'm leaning towards exploring some type of sports-related statistical data, like visualizing the historical mediocrity of the Washington Wizards relative to the rest of the NBA. Sigh.
»»»«««

Mon 7/29 - T-minus 4 weeks

  • Some more algorithms coursera course today, going into Big O, Big Omega and Big Theta notation with some descriptions. I'm liking it so far. I've developed an appreciation for the math/theory behind CS that I never had before, particularly in school.
  • Coded some basic n^2 algorithms: insertion sort, bubble sort, selection sort. I'll do merge sort tomorrow.
  • Started exploring d3.js. There are a lot of tutorials on the web but none of them seem to be the canonical "best place to start." The syntax so far reminds me a lot of jQuery. It'll be a good introduction to SVG, which is cool.
  • I have an idea for a JavaScript library that will (a) solve a real problem I've encountered and (b) serve as an introduction to canvas. I'll start that later this week.
»»»«««

Fri 7/26 - Code reviews

  • The first Friday I've come in so far and I think I'll do my best to continue the trend. Working on some personal, unrelated-to-hs things today.
  • I've been giving advice to a few friends for the past several months who want to transition to dev so I've spent the morning working on a pull request. It's different and nice to be on the giving end of this for a change, not only because it helps a friend of mine grow as a programmer but also because it forces me to know what I'm talking about. There's an implicit critique of my own understanding.
  • I'm beginning to realize that some of the most important lessons I'm learning from hackerschool don't have much to do about programming. There is a wealth of lessons about learning, teaching, being a good person and the themes behind open source software.
»»»«««

Thurs 7/25 - C is painful

  • C is not fun.
  • Presented marky today. That was cool.
  • I've determined a new workflow for my remaining days here: (1) Spend 1 hr watching as many coursera algorithms lectures that fit within that time period; (2) Spend an hour with C; (3) Interesting things.
  • Potential items right now for (3) include d3.js, svg/canvas, and python.
  • (2) is subject to change. Very subject to change.
»»»«««

Weds 7/24 - Some closure

  • Marky.js is as completed as I want it to be. Success!
  • Merged a pull request for the first time ever today for my arithmetic parser, which was all kinds of awesome. Mary's edits were great, with a particular focus on code modularity. I think I have a tendency to save too much state on my objects whereas I could benefit from approaching things more functionally. I didn't even know what functional programming was when I entered hackerschool. I'm starting to understand the appeal.
  • With a month left at this point I'm not sure how to best spend the remainder of my time here. I still consider algorithms a priority, so I'm leaning towards circling back towards that coursera course. And I may try to finish up the foodmap. Decisions!
»»»«««

Tues 7/23 - Say hi to your mother for me, alright?

  • Marky.js works! Kind of. There are todo's remaining, including the fact that it saves "marks" that are specific to a domain and not a page on a domain. Whoops. But you can add/edit/delete/select with a minimalist UI.
  • I have a newfound appreciation for John Resig.
  • Is this the first javascript library created in homage to Mark Wahlberg? The chances are probably pretty good. And no Mark Wahlberg-related talk would be complete without a reference to this: Mark Wahlberg Talks to Animals.
  • I'm really enjoying integrating grunt into my workflow. Grunt is amazing.
»»»«««

Mon 7/22 - I'm glad I live in a post-jQuery world

  • More bookmarklet. Coffeescript and jQuery-less DOM manipulation. It's been very good practice, but I miss the $.
  • Today was an off day. Not super productive nor engaged. Just happens once in a while.
»»»«««

Thurs 7/18 - Root Canals and Good Vibrations

  • Learning C is like going to the dentist.
  • A problem I keep encountering on single-page mammoth programming tutorials is that a simple bookmark doesn't keep my place within the document. I'd like to create a bookmarklet, using coffeescript, to save my vertical position on a page in LocalStorage. Good vibrations will be had by all.
»»»«««

Weds 7/17 - Coffeescript

  • Spent the day learning Coffeescript. Used the docs here and a little bit of this free ebook. It's something I've been wanting to explore for a while, mostly because I know some big-time dev shops (see: github) have moved to writing all new js in cs.
  • After reading through docs for way too long I refactored the core javascript from daniseating to coffeescript. It's nice to have these old, small-scope projects in my back pocket that I can augment to learn new things.
  • Coffeescript could probably be subtitled "JavaScript: the Good Parts", blatant copyright infringement aside. Jeremy Ashkenas removed a lot of the pitfalls that drive js devs crazy, including scoping, closures, type comparisons, etc. The commands are more idiomatic. I can see its appeal and the practicality of using it, but I can also see the dangers of syntactic sugar that removes a lot of core programmatic understanding.
  • I don't think I prefer cs to js but it's still early. The syntax is definitely much less verbose and it's amazing how robust the parsing is. I'm glad I knew enough js to understand the compiled code (esp wrt closures and scoping) before I started using cs, which unfortunately I don't think will be universally true. It's "easier" and more "idiomatic", but it's still magic. And magic is not understanding.
  • Conclusion: I'm glad I know how to read a coffeescript file and have a basis for picking it up further if I need to, and while I might use it someday, I probably won't for the rest of the summer.
»»»«««

Tues 7/16 - C Instruction in a Difficult Manner

  • Working through Learn C The Hard Way, which people have had varying levels of success with. The section on pointers was really interesting, mostly because pointers have been this black box of computer science lore for someone whose experience is solely in higher-level languages. I particularly liked this: "That leads to a certain realization: C thinks your whole computer is one massive array of bytes." Cool stuff.
»»»«««

Mon 7/15 - Sick

  • Turned out that the cold I was dealing with over the weekend was still potent enough to render today pretty useless. Tried to focus but couldn't, so after watching a couple js conference presentations I left early. I think I'm on the upswing though.
»»»«««

Sun 7/14 - 50%

  • Hackerschool is officially half over. It's time to buckle down and really start seizing this time to the fullest, which probably means going in on Fridays/Saturdays. It feels like I've had to leave NYC almost every weekend for one reason or another but luckily I should be clear from here on out.
  • As for a remaining intinerary -- it's intentionally nebulous. Anything that makes me a better programmer. Try to pair more. Have more conversations, pick more brains, and further open my horizons as to what the realms of possibility even are in programming.
»»»«««

Thurs 7/11 - Arithmetic

  • It works! Could probably use a code review though.
»»»«««

Weds 7/10 - moar JS Assessment

  • More js-assessment. It really is a fantastic way to really learn the full capabilities of a language, and I learned that similar projects exist in ruby and python. I've completed roughly 45 of the tests with five remaining unsolved. The reasons for the five lingering tests range between: I don't know how to do it (1), I know I can do it but it'll be annoyingly tedious (2), and the instructions are horrible (2). I'll finish them all eventually, but I'll take my time completing the rest.
  • It's pretty crazy how much I've learned about JavaScript in the last 48 hours. I'm psyched about how much my JS knowledge is really being solidified here. I'm also looking forward to checking out the book I ordered (which is supposed to be awesome!). I also think I'm at a point where re-reading JavaScript: The Good Parts will do me some good.
  • I signed up for an NYC public rec center for $75/6 months, and the facility is conveniently located 2 blocks from hackerschool. Being able to lift for 30-45 mins in the middle of the day has done wonders to help clear my head from mental fatigue.
  • More algorithmic fun with my arithmetic parser, which *almost* works with my recursive algorithm. But no cigar. Turns out the Shunting-Yard algorithm is the way to go for this type of problem, which in turn requires knowledge of Reverse Polish Notation. Needless to say a big WTF was had by all.
  • I want to figure out how to do things recursively so I might hold off on Shunting-Yard for a bit. I feel like the solution is on the tip of my... brain?
»»»«««

Tues 7/09 - JS Assessment

  • I spent the entire day working on this: js-assessment. I don't think I've encountered a better resource for really solidifying js understanding. If I worked at a company I'd give this to all of my devs as a mandatory exercise. Most of the tests are written so you can figure out what to do given the context the doc provides, but some are horribly, horribly documented. counter.js is laughably unintuitive. If you can't figure out what to do make sure to look at the code for the tests being run to get a better idea of the expected output.
  • The project is also nice because it gives me an opportunity to poke around its unit test implementation.
»»»«««

Mon 7/08 - July 8

  • Started the day reading through Talks To Help You Become a Better Front-end Engineer in 2013, which led me to A Baseline for Front-End Developers (excellent) and in turn Fixing these jQuery (also excellent). I also watched 10 Things I Learned from the jQuery Source but it was pretty long (1hr) and more interesting than important.
  • We split up HS between the original Varick Street location and some space in the offices of TheLadders down the street. The workspace at TheLadders is sweet -- open concept, clean, and huge with ample break-out space.
  • Had a real one-on-one with Mary, which was arguably the most helpful conversation I've had all summer. I voiced a lot of my concerns -- generally related to repeated existential programming crises -- and I have indeed decided to treat my backbone app as a second-class citizen. The challenge of the BB app now is not so much programmatic as it is a function of time and resources. To finish it I just need to put in the man-hours, but I've completed the bulk of the heavy lifting for now. It's not much benefit to me now to spend time spinning up a snappy UI because it's work I already know how to do. I'll work on it when I'm bored, but not on HS-time.
  • Instead I will focus on really understanding the core of JS, which is accomplished less directly by using libraries like BB/underscore/etc and more by working on algorithmically complex problems. My first project is to write an arithmetic parser; meaning I feed it "6/2+3*4/2+7-2*6" and it returns the correct answer, considering things like the order of operations and parentheses. I'll split my time by spending several hours a week on C, and several hours on algorithms. I'm looking forward to really rounding out my foundational CS concepts for the next month, and as an artificial deadline hope to have the bulk of this done by the start of August.
  • I'm also going to screw around with Coffeescript for a day or so I can tell whether or not I hate it.
»»»«««

Weds 7/03 - July 4th Break

  • Got some feedback and edits from fellow hackerschoolers on my blog post. I'm pleased with how it turned out. It captures exactly what I have to say on the topic -- which sounds obvious, but when writing long-form that doesn't necessarily become the reality.
  • The BB app is starting to really come together now. I don't plan to "ship" with that many features -- basically create maps, create listings, view them, and have public (but probably cryptic) URLs. I'm looking forward to shipping and keeping the project as a continuous work in progress for the time post-hackerschool. It's been a very good project to learn from.
  • Ate $1 pizza with Peter Norvig today for lunch. That was cool.
  • Mary (a resident here) had an interesting seminar about writing unit tests in JavaScript today. I have no experience with testing code programmatically so it's something I'd like to explore in much more depth. One of the ironies about testing is that a key to testing is writing really modular code, which you probably don't know how to do until you're a better programmer.
  • Heading out of town to celebrate independence but I hope to get *some* work done at some point this weekend. Might be tough. Never graduate.
»»»«««

Tues 7/02 - Lies. And a new blog post.

  • I spent the majority of the morning finishing up a blog post entitled "Getting a job as a Front-End Web Developer." I've wanted to write something like it for a while, and it turned out to be longer than I expected it to be. I've sent it to a few people for feedback so it will likely undergo some changes.
  • The primary motive is to address a question that I am asked with surprising frequency: "where do I start?". I wanted to centralize my advice in a comprehensive post with a focus on practicality. Hopefully it helps.
  • I had a few enlightening discussions today with some facilitators/other hackerschoolers about what I've been working on. The node/backbone project, while cool, bothers me in that it's so insular. Not many people have experience with backbone or node so it's something I largely work on alone.
  • So I decided to pivot by learning algorithms/data structures in C. It's a massive pivot (at least for me), but it's something I've always wanted to do and I know it'll be challenging. It'll be completely new and is more of a "holistically good for my programming chops"-thing than explicitly applied-thing. And I know it's something other people here have experience with, so there will be opportunity to pair.
  • I was doing that for a bit when a friend came to talk through my Backbone structure, at which point I had a massive epiphany about what I was doing wrong. Which in turn motivated me to start another big refactor. Which got me back on the node project.
  • The ebb and flow (and indecisiveness) of hackerschool. Never a dull moment.
  • Todo: Be productive.
»»»«««

Mon 7/01 - Month Two

  • Forgot to log today but worked more on the node app.
  • I'm leaning towards pivoting away from this project. It kills me to leave projects unresolved but I feel like it's at a state where I can pick it up at a later time to work on it. And I don't think it's leveraging the best use of the people at hackerschool to keep banging away at this, as there aren't as many people here with nodejs/backbone/mongo experience.
  • Todo: Resolve 98th existential crisis of the summer.
»»»«««

Thurs 6/27 - Breakthrough

  • LOCAL AUTH IS FUNCTIONAL. I ended up using Passport after all, which still has some degree of "magic." Learned some new information about sessions in the process. Did I mention how local auth is functional?
  • If you're using passport and running into user session issues, don't forget to check your passport.serializeUser() and passport.deserializeUser() methods. I had an issue with "id" not being "_id" in mongodb that drove me crazy.
  • Also remember that sometimes backbone has a specific way it does "obvious" things. Like, let's say you want to initialize a new View and feed it the id of a model you want to query. You can't use new View(model_id), because views don't accept parameters in that way. You're forced to pass in an object (mapped to view.options), i.e. new View({model_id: id}).
  • Real progress on the app is very refreshing. The DB is in place, my API is (generally) working, and I can (generally) put my head down and see fruits to my labor. It was a super frustrating going for a while there but I knew a breakthrough would happen eventually. This project is fun again.
  • Every Thursday hackerschool hosts presentations where people can sign up for 3-5 minute slots to present whatever they feel like sharing. It's often projects but sometimes it's a mini-lecture on a math/computing/meta concept that they find useful. Every week the presentations just reaffirm the fact that hackerschool is an amazing learning environment. It's rare to find a place where intellectual curiosity is explored and celebrated so fervently, and the diversity of technical interests here is really amazing. No matter the opportunity costs of coming here it was absolutely the right decision.
  • Todo: PROGRESS.
»»»«««

Weds 6/26 - Refactor, contd.

  • A lot more refactoring today, and a lot of tinkering around with various mongo commands. My relational database world/mindset makes the transition to mongo a bit more jarring than I expected it to be. "What do you mean 'store it in the document?' DON'T normalize the data?! What if something changes? What if we need to update a field?! FOR THE LOVE OF GOD, WILL SOMEBODY THINK OF THE DATA?!" Or in other words, a slight exaggeration of my thoughts circa 1pm this afternoon.
  • But the progress is still there in a way that it wasn't before. I'm still running into some undesirable js loading issues with backbone/SPA-ness but I'm not foreseeing a resolution to that anytime soon. Whatever. People are mostly on broadband, right?
  • What? You mean there's internet on phones now?!
  • Todo: drink iced tea from dunkin donuts and suppress the impulse to spend the day playing Candy Crush on my phone. And code if there's time left over.
»»»«««

Tues 6/25 - Git Workshop and Back to Node

  • Spent the morning at an "advanced git workshop" at Jane Street Capital in the Financial District. It's cool that hackerschool sponsors things like this, and the guy who led the workshop knew what he was talking about. It's hard to internalize stuff like git commands unless they're really needed (i.e. you're working on distributed projects), but I did pick up a few new tips and it was nice to sure up some holes from my git experience at work.
  • Strangely the most interesting thing I took away from the git workshop was admiring the leader's bash prompt, which led me through the dotfile blogosphere to customizing my own .bash_profile. I more or less copied it from Paul Irish. Having the git status in the prompt is a game changer.
  • Decided to get back into the node foodmap app, so I created a branch and started changing things. Authentication remains a big question mark so I'm just going to skip it and keep trudging along. I'm still not entirely sold on Single Page Apps but I'm not sure what a suitable workaround is. Again, keep trudging along.
  • The subway ride home tonight was 75 blocks of face-to-summer-armpit. Ah, NYC, you sly devil.
  • Todo: Anticipating a good workday tomorrow. It's nice to be getting back into the groove of things.
»»»«««

Mon 6/24 - JS Design Patterns

  • Had a good talk with a friend/old coworker last night about a lot of things, including some concerns I had about what to focus on here. While there is a social pressure here not to focus explicitly on job-related skills, I think that's a luxury that's only really affordable to those who don't worry about their imminent employability (or those who aren't entering the workforce). That isn't to say I don't think I'll find a job (I do), but I think it's un/realistic/pragmatic to fill three months of unemployment with non-directed whimsy. I've decided to optimize my time by solidifying my understanding of javascript as much as possible, because I'm already far enough along with js that I know I like it and can work with it professionally. While I still want to explore python/backend work, I know it won't be a core competency after two-three months of experience. Would I rather be hired as a junior python dev or a mid/senior js dev? The answer is obvious.
  • Started reading, finally.
  • Notes:
    • I don't typically use object.prototype in JS because I think creating new instances of function declarations (with their embedded methods) is easier. I figured prototype made sense when you had a lot of inheritance going on between objects but I've never actually encountered that use case. Turns out that there's a general performance reason to go the object.prototype route -- when you create new instances of the same object, its functions all refer back to the prototype, rather than being created over again for no reason. Mind blown.
    • Module pattern makes sense, and I've been using the "Revealing Module Pattern" without knowing what it was called.
    • The singleton pattern is interesting but I've never used it in practice and it appears to come with some controversy (too many singletons can be symptomatic of poor design). Seems to suffer from similar design issues as having a program with a lot of globals.
    • Observer/pubsub pattern will be really helpful, especially for de-coupling ajax callbacks. The mediator pattern seems to be redundant at first, but it's a lot easier to pub/sub against a single global medium than pub/sub objects individually. Remember: mediator.js
    • The factory pattern will be one of those things that I doubt I'll use but it's valuable to know of.
    • After some minor discussions with other folks, I have a better understanding of binding `this` with .call() and .apply(), as it's used pretty frequently throughout the examples.
    • Really began to lose steam here. Moving onto something new for now.
  • Todo: Back to the node app. I'm thinking I'll forego auth right now and worry about it at the end. I'll develop everything in the meantime as a super-admin.
»»»«««

Thurs 6/20 - meh.

  • This will likely be the shortest update I have so far, but I've been feeling a bit burned out/sick of node so I took a break for a day. Today was spent tying up some loose ends on some older projects that have nothing to do with hackerschool. Nothing super notable to speak of here, but a lot of time was spent practicing skills related to general web design, responsive design, and media queries.
  • Todo: Back to reality.
»»»«««

Weds 6/19 - REST done, Auth is not

  • Finished the full REST API today, in addition to refactoring the location of some code in various views to make the code more MVC-ish. I have this weird variation of MVC going on where the Views (which have a lot of logic in them, but that's because controllers don't actually exist in Backbone) are not necessarily created equal. Composite views (made up of several sub-views) handle more responsibility/functionality than their components. I'm not sure if there's a canonical way of philosophically structuring code and functionality between Routers and Views in bb, but based on a lot of reading and discussions there doesn't seem to be one "right" way. I'm starting to think that the most important thing is to do it consistently.
  • I'm getting a better understanding of how to use events between the router/views to handle application flow.
  • Started to look into user auth with Passport.js, but found the guide largely unhelpful. There's a lot of text/code but not a lot of reasoning, which ultimately results in a lot of magic. The tutorials I've seen on the web so far suffer from similar issues.
  • Todo: I'm starting to run low of my headdesk tolerance so I'm thinking of doing some general js enrichment and reading more about how Connect/Express work before I dive back into actually coding.
»»»«««

Tues 6/18 - Memory Leak Purgatory

  • A pretty frustrating day overall but full of necessary growing pains. Once I wired everything into a single page app (SPA) I started to see some really strange behavior -- like trying to fire a PUT would simultaneously send off 2-3-4 POST calls, depending on the number of screens I clicked through in order to get there. That was weird. But after a lot (note: a LOT) more research/googling/blogposts/pair discussions, I realized it was because my views/bindings weren't being removed from memory as I navigated through the app. So my "click #submit" was being bound to views that I had removed from the DOM (but not destroyed), which would in turn fire off multiple submissions when I submitted a form a lot farther down the line.
  • My solution was to keep track of the current view within the router. I added a .close() function to the relevant views to unbind all of its own events and to remove the events/dom elements for its children (which I now store in an array on each view). When I'm about to instantiate a new view within the router, I .close() the old view and instantiate the new one.
  • tl;dr: Before rendering a new view, I remove the old view from the DOM and unbind all of its events (and those of its sub-views).
  • I don't know if I'm crazy about the SPA idea in general. It introduces a lot of weird variability -- SEO, managing state between routes, what to route and what not to route -- that I'm not sure are worth the benefits of a sexy user experience. I like Backbone though, and I see the utility in having a bunch of mini-SPAs throughout one application, or using Backbone MVC concepts without the routing. Regardless as an exercise I will continue to develop the foodmap as a full SPA.
  • PUT works now. So GET, PUT and POST are functioning. Progress -- slow, frustrating progress.
  • Todo: DELETE and begin authentication. If I need a break (likely) I might start reading more about JavaScript Design Patterns.
»»»«««

Mon 6/17 - Routing

  • Moment of enlightenment this morning: I needed to start using routers. While I've known about single page apps for a while, I didn't connect the dots between storing markup in templates and the hashed URLs until now. The sole html file in the since-refactored codebase is an index.html with a div.app-container. As you navigate to different routes (i.e. '/', '/#/admin', '/#/admin/id') the contents of app-container changes via javascript, not via redirects to other .html pages. I'm not sure why this wasn't clear to me earlier, but that was a good refactor.
  • Ran into a race condition today with attempting to load my google maps-related js (which loads asynchrously) and my map overlay library (infobox.js) which depends on gmaps. With some googling I was able to discover the async plugin for requireJS, which facilitates the loading of asynchronous scripts. This would still sometimes break infobox (which is a good sign of a race condition) until I found a stackoverflow answer somewhere that talked about specifying script dependencies in requireJS. That fixed things nicely.
  • Spent the next several hours getting nowhere with POST/PUT of the foodmap listings, although the application routing was finally set up properly. Took a break for our tech talk at Ebay and to commute back uptown, and logging back in later in the evening for a few hours was productive enough to get the GET/POST/PUT operations working properly. There are some weird bugs that are showing up related to some under-the-hood backbone stuff, but I've marked them as Todos for tomorrow.
  • I have a feeling that I'm not doing the form processing in the way that backbone was designed for it to be done. It's very manual right now -- I'm manually extracting/injecting model values into the form with hard-coded selectors. I think there's a better way to do things but I'm having trouble finding non-trivial examples of backbone/node REST code in the wild. I don't need to look at another todo app with a single view.
  • As much as I'd like to participate in this algorithms class in parallel to everything else I'm working on (and my batchmates), I'm having trouble finding the time to devote to the weekly lectures/problem sets. I may have to de-prioritize it for now for my own sanity. That isn't to say it's still not a priority for me, but I'd rather focus on one significant thing at a time and do it well than multiple things that suffer in quality/devotion.
  • <HEADDESK> JAVASCRIPT IS ASYNCHRONOUS </HEADDESK>
  • Todos: Fix the backbone bugs, get DELETE working, begin setting up user accounts and authentication. Longer term: make things pretty.
»»»«««

Sat 6/15 - Thoughts on pacing

  • Took the boltbus down to DC today for Father's Day weekend. The 1030am bus arrived into DC at 5pm (orig scheduled 2:45pm), and major onboard-computing malfunctions led to us being on the side of the highway four times. So that was fun.
  • It's 3am on Friday night (Saturday) and I'm starting to think about pacing. I have three months here that I definitely want to maximize so I want to remain diligent about the amount of time I'm allocating to whatever it is I'm working on. I had several major goals: (1) python, (2) javascript MVC, (3) algorithms and (3) objective-c. Over the next two weeks I'd like to continue with (2) and (3), with an end state being a functional backbone/node.js app, served on EC2, with working user accounts and the ability to create/edit/delete maps. It won't be as fleshed out/UX-optimized as I'd ultimately like it to be but it'll serve nicely as a future work-in-progress pet project. I'd also like to be caught up on all of the algorithms lectures/problem sets, which will have to be completed in javascript.
  • Similarly to any real-world project, effective HS time management boils down to scope creep. As much as I'd love to compare/contrast js mvc frameworks like Angular and Ember, they'll have to be left as "nice to haves." But once I get up to speed with python/flask in month two I'll likely be building more webapps, so that may or may not open the door nicely for some deviations from backbone.
  • Things I'm also super intrigued by: websockets, d3/processing/data viz, test driven development. It'd be great to include some of that in whatever I work on too.
  • ... scope creep might be a harder problem to manage than I thought. And I'll need to start being more diligent about putting time in on Fridays/weekends.
  • Todo: Still PUT/DELETE and user accounts.
»»»«««

Thu 6/13 - End of Week 2

  • Some refactoring within both backbone and node today. I don't have a lot of commits to show, but the majority of my time was spent figuring out how to do things in mongo. Successfully imported/exported json from the db. GET/POST-ing to the node API works so I'm successfully able to add new restaurants to the map. The next step is to fill out the "rest" (... wat) of the API functionality.
  • I think I'll host this on EC2 when it's time to go live. A lot of people go the heroku route (especially with node) but I think EC2 is more representative of what I'd actually do for a real-world application. And I hear Heroku is supposed to get stupid expensive very quickly.
  • Todo: PUT/DELETE and user accounts. User accounts are pandora's box though -- security, sessions, oauth?, etc.
»»»«««

Wed 6/12 - wat

  • First, the best conference talk ever, introduced to me by a fellow hackerschooler:
  • Started the node/mongo integration of my foodmap, and finally having a multi-page app (now with an admin console) gives some real-world utility to using RequireJS and Backbone. It's awesome to be able to use the same model/collection with different views and have all of the dependencies managed in js rather than through some tedious declaration in an html file.
  • I'm using Express and Mongoose (for node and mongo respectively) to run things, and I'm not sure how I feel about it. I'm not informed enough to know whether these are good or bad things (although a lot of people seem to use Express) or if it'd be better for me to go the more native node and mongo routes. Whatever. For now I'll just keep going in whichever direction keeps me productive.
  • Been watching some algorithms coursera lectures on the train and I'm hoping that this is the time that I actually follow through with learning this stuff. Admittedly I haven't hit a lot of times in the course of real work where I've explicitly felt the need for algorithm knowledge, but it has happened. Regardless it'll just help round out my programming ability in a holistic sense.
  • Todo: Keep node/mongo-ing, keep algorithm-ing, keep wat-ing.
»»»«««

Tues 6/11 - RequireJS

  • Started off the day pairing and learning how to work within the node javascript REPL, which is essentially the Javascript console in the Chrome/Firefox dev tools. People seem to really be into REPLs here. I've worked in devtools before and I didn't really see the utlity of using a REPL for dev purposes, but the ability to include modules via npm has really changed my understanding of how they'd speed up development. It's instant feedback with tab-completion. It's random stuff like this that really hammers home how important it is to be part of a tech community.
  • I derailed my node/mongo plans temporarily to get a better understanding of (1) RequireJS and (2) event management in backbone, and also explore things like Marionette.js. AMD/dependency management is something I definitely want to understand (and a problem we ran into on my project at my most recent job), and the event aggregator/mediator patterns are the keys to really solidifying my backbone understanding. Well, outside of routing. And data-binding. I think I'll end up tabling Marionette until I appreciate what it provides, similar to the transition from vanilla js -> backbone.
  • Finished wrapping the foodmap in RequireJS. The good: I wrapped everything in require and it works. The bad: The foodmap at its current state is a horrible use case for something like this because I'm essentially loading all the dependencies on page load anyway. Once the site becomes more fleshed out/interactive with different screens Require will have more utility, but for now it was practically pointless. Which doesn't mean it wasn't a good learning exercise (it was). Hopefully it'll help facilitate future implementations of the library.
  • People are doing some really cool things here. I'm super intrigued by socket.io and saw a simple prototype someone wrote that featured concurrent drawing between different users on a single js canvas. If I keep talking about different javascript libraries/technologies I might end up never moving onto python. Unsure right now if that's a horrible thing; three months of dedicated js could churn out some really interesting projects.
  • Todo: Catch up on lectures for the coursera Algorithms discussion group I'm in, start node/mongo for real. A fellow hackerschooler showed me some minor node functionality today and I'll say it again: a server in one file of js blows my freaking mind.
»»»«««

Mon 6/10 - Backbone!

  • My flight from LA landed last night at 1:30am in Newark. I was freaking tired this morning. Also, it costs $100 (including tolls) for a cab from Newark to Manhattan.
  • I've successfully backbone-ified my foodmap! It only took a week and a lot of frustration, but it feels good to have worked through the roadblocks. It only goes to reaffirm the fact that head-to-desk time is the best way to learn things. Tutorials, even excellent ones, are only so effective at conveying understanding.
  • At a glance the foodmap in backbone is identical to the non-backbone version, but I'm feeling really good about the imposed structure and I can definitely see how it would streamline large-scale js development. It was "easier" for me to write everything with vanilla JS, but it was devolving into a spaghetti code base of events and jQuery selectors. MVC just feels right.
  • I mentioned it earlier but Backbone isn't very beginner friendly, mostly because if you don't understand concepts like context, scoping and closures you're going to have a bad time. In the grand scheme of things I don't consider myself very proficient at JS, but it was nice to discover that I know enough of the fundamentals to make sense of things like backbone. And because of the nature of backbone contexts refactoring the foodmap had the ancillary benefit of teaching me more about context in general.
  • All of this commentary needs the massive caveat that I have yet to bind my code to a backend, since everything is still running off of a static json file. I've heard people complain about backbone data-binding in the past so I'll have to see how I feel about all of this once that's completed. I am glad that I decided to go the static json route, since I should generally just be able to plug-in an API endpoint and go. I almost sound like I believe that it'll be that easy.
  • Todo: It's webapp time. Node.js and mongoDB! Many more head/desk moments to follow.
»»»«««

Thurs 6/6 - First week complete

  • More head/desk sentiments brewing for the majority of the day, although progress was definitely made on the backbone.js front. Paired with someone at the very end of the day that helped clear up some roadblocks which was a definite relief. I have the foodmap rendering its initial state properly, and it's all still being driven by the contents of a static json file. But the core of backbone is managing events, so that'll be a nice challenge for next week. I'm slowly but surely getting there.
  • A massive roadblock I hit earlier had to do with the fact that I forgot to think about javascript asynchronously. I've run into similar issues before with code that "should work," specifically concerning manipulating an AJAX response. I think I let out an audible grown when I realized what the problem was. Specifically: when you fetch() a collection in backbone and attempt to render() it, remember that the fetch() is asynchronous. Listen for the "reset" event to call render() or else you might hit a race condition.
  • This article made the rounds on HN and twitter today. Lots of food for thought that I'm too mentally drained to expound on right now.
  • Todo: moar backbone. I think I'm relatively close to finishing the refactor.
»»»«««

Weds 6/5 - Head, meet desk

  • For all of the power and flexibility of a utility like nvm, installing/running node.js and avoiding obscure error messages is not as simple as it sounds. I've learned a valuable lesson: when all else fails (1) delete the 'node_modules' folder, (2) 'npm cache clean', and (3) 'npm install' again. Half the time that fixes things. Also use 'node -v' to check the current node version and 'nvm use' the most current one you have installed. For some reason the current version changes on a per-folder basis (?). More info about setting a default node version here.
  • Got Addy's node.js/mongoDB example working locally, which is just all kinds of exciting.
  • Attempting to backbone-ify my own code was less successful, but it's because I got caught up on some minute details that I shouldn't have worried about so much. Specifically setting up backbone models when you have nested attributes. Tomorrow morning I'm going to ignore the issue until I have something bigger-picture working and then come back to it, as opposed to spending another 4 hours wanting to slam my head into my desk.
  • That being said, I find the "slam-head-into-desk" period a pretty important part of any learning experience. I go through it every time I try to learn something new. You read StackOverflow Q&As, write horrible code, read more examples and sit on the cusp of giving up in frustration until suddenly, for seemingly no reason, you get it. But it's not actually "for no reason," but rather the superficially unproductive (but actually productive) time you spent wanting to slam your head into your desk. It's the time you spent eliminating stupid ideas from the realm of possibility. I'll sleep on things tonight and hopefully by the time I go in tomorrow my desk/head will be safe.
  • It blows my mind to be able to create a web server with a single .js file.
  • There's a regular pun competition in Brooklyn called "Punderdome." I've yet to go, but is that the greatest name for a pun competition or what?
  • Joined an algorithms/data structures study group that will go through a coursera course together. Take that, massive gaps in my academic CS knowledge.
  • Todo: backbone-ify the foodmap, and then node.js/mongo-ify the foodmap. It's a nice little project for the first couple weeks of hackerschool.
»»»«««

Tues 6/4 - Todo MVC

  • It's pretty remarkable to see how self directed everyone is. There's this unspoken pressure to focus or get "left behind." Not in the sense that anyone is judging you (or even cares), but more that the opportunity cost of goofing off is big. As Nick said yesterday, there aren't many programmers anywhere that get to focus solely on their craft for three months like this.
  • While the level of experience of people here varies a lot, it's easy to see why the powers that be at HS don't accept completely inexperienced beginners to the program. It's for their own benefit. Without the knowledge to self-educate and/or be self-directed, it’d be a waste of time to come here. There's so little formal structure that it definitely lends itself best to those who can sit down and work on things immediately, or at least function without the need to have their hand held. It's not beginner unfriendly, but you need to be a purposeful beginner.
  • You know that feeling when you're in a coffee shop working on something and there's enough ambient noise/activity that it keeps you awake but it's not distracting? It's like that. Except everyone is talking about programming. It's awesome.
  • I'm reading Outliers on the 18-stop subway ride to/from HS, and it seems oddly serendiptious. It wasn't intentional. But the notion of 10,000 hours to master something... it's appropriate. I'm about halfway through, and while I feel like Gladwell can be unnecessarily verbose/includes too many redundant anecdotes to make a point, the crux of what I've read so far is this: while outliers are absolutely affected by external circumstances and sheer, dumb luck, working harder/smarter than their peers was a (as in, one of several) defining charateristic of their success.
  • Todo: more backbone.js, which is really starting to come together mentally. Highly recommended so far for those who have js experience. A nice thing about this tutorial is that it'll serve as a very shallow introduction to node.js and mongoDB.
»»»«««

Mon 6/3 - First Day!

  • Everything kicked off with some networking and an inspiring introduction by Nick/David covering the ideology/atmosphere of hackerschool.
  • HS uses a pretty cool chat app that was built by some HS alumni.
  • Sadly the "nearby locations" for Yelp are all $$$-$$$$, but such is life in Soho (and NYC in general).
  • Decided to make this log, both for future nostalgia and a way to tangibly track my progress moving forward.
  • The diversity of the group is really amazing. Older, younger, management consultants, ex-Wall Streeters, college students, a high school student, people who have programmed for 10+ years and people who have programmed < 1 year, people who live overseas, across the country, etc. The diversity will be a tremendous asset for the batch. Come to think of it, it's unlikely that I'll ever be part of another community during the course of my adult life that has this kind of diversity of people and experiences.
  • Todo: backbone.js and Yeoman.
»»»«««