< prev 23 Jan 2015 to 21 Jan 2015 next >

Posts tagged 'lessons'

  • Never have I been so happy to get a blank screen before

    Holy crap. I wasn't sure if I could do it, but I've got my app rendering a blank screen.

    Some elaboration is required.

    I set out today to get the basic infrastructure of Marionette working, with a modal login screen, and a router before action that properly redirects after sign-in.

    At 9:30 tonight, I checked in the last code that was necessary to get this to happen.

    I am so happy. I thought, when we were first learning Backbone, that it was pretty opinionated, but it turns out that it's flexible, and requires more configuration than convention. Sure, there are things that backbone-on-rails tries to enforce, but that's not Backbone per se.

    Marionette, on the other hand, has some strong opinions, but the documentation is sparse enough that it can be hard to discern what those opinions are. Nevertheless, it desires certain things, and after a lot of secondary reading, I have figured out a lot of what those things are. For instance, Marionette wants you to modularize everything, but the Marionette.Module object is pretty ghetto and is slated for deprecation.

    In the meantime, then, one can use standard JavaScript modules and so forth to add in modular portions of an app, or (as I have) simply expand on the backbone-on-rails opinions by adding a folder for (e.g.) controllers and inserting it at the correct point in app startup. It works for now, but I may have to refactor later.

    And what a statement that is! Every single line I wrote in Backbone felt like it needed serious refactoring, but everything in Marionette is so DRY. Sure, there's a bit more "needless" code to pass messages, but that is in keeping with the spirit of loose coupling.

    Case in point: I spent a good deal of time learning about JQuery Deferreds, which are a means of handling promises in JQ. They're similar in behavior to Arel queries—they don't do anything until you resolve() them, and until then you can keep modifying them by tacking on further attributes. Pretty cool, if you ask me, although a bit of a trip to wrap your mind around. When reading Essential JavaScript and coming across the section on promises, I didn't quite understand them, only really understanding that they help cut down on callback hell… but I saw the reason for them. Now I think I can consider them a part of my toolbox.

    What did I do today, then?

    • Marionette is starting up
    • I have created regions
    • I can attach subviews to the correct region
    • Calls to routes that require login are properly intercepted
    • Once login succeeds, the original route is triggered
    • Login is actually working :)

    What did I learn?

    • Reading the docs, while essential, can only get you so far
    • At some point (earlier than you [ed: meaning 'I'] think) you need to sit down and just break things
    • Initially, at least, you're not going to have a damned clue what you're doing, so you have to just get the gist and then try things.
    • Act more than plan. (This is personal, and in reference to my current state.)
  • Hangups.

    I never quite accomplish what I wish to. There is a long list of stuff in my head that I can never seem to get out. I know this doesn't make me unique in any way, but so much of my identity is tied up in the belief that I have a lot to offer the world, and I just need to get it out, so it's frustrating to constantly hit the wall.

    A core problem seems to hit when I regress. I start down what should be a productive train of thought, and find myself thinking about bigger and bigger ideas, or at least more and more abstract ones, until I get to a point that I'm trying to solve all the problems of the world at once.

    People don't really care about big ideas if they can't see a solution. The same reaction I give students when they tell me they know the material, but they just can't solve the exercises, is what others rightfully give me. In the meantime, I recognize that doing is more important to me than thinking, at least from an emotional perspective, but I also find myself questioning the merit of the things I do when I simply act. When actions don't fit into a larger context, they don't seem to make me better or lead to anything. This is how I believe people waste their lives.

< prev 23 Jan 2015 to 21 Jan 2015 next >