Sunday, November 30, 2014

Post-MakerSquare, Week Two: Keeping your code sharp--and, oh yeah, about that job search

How do I not have just a plain jane "Coding" tag? Anyway, welcome to the tag family, "Coding"!

And I want a "Coding" tag here because I want to talk about a website that I have fallen in love with recently: exercism.io.

It is very much like those other websites where you get coding challenges, e.g., CodeWars, Project Euler, etc. (which I also like). That is, the goal of Exercism.io isn't to build any project (which I still maintain is the best way to really get into the nitty-gritty of a language), but merely to play around with a few challenges.

I especially like how Exercism.io keeps everything real clean and focused. Rather than running a test online (and oh, how online tests have given me heartache), you run the tests on your computer--as you would normally. Exercism.io also has a nice breakdown of various languages, so that you can try only the Ruby challenges or the Clojure challenges; and after you submit one solution, you can fetch the other. (The interface is not unlike Github, which is another reason I like it.)

And then, best of all, you get some commentary and feedback on your code. Because, sure, my DNA/RNA transcription agent worked, but the real benefit of using this is I have now discovered a new method--String#tr--that I never used before and wouldn't have used if I hadn't seen someone else use it.

So, if you want to practice a new language or keep an old language sharp, I recommend at least looking at Exercism.io

***

And about that job search, I've been offered and accepted a junior developer position. So I'm off the market for now; and very excited about starting in early December. I will say more about the job and the company--after I reread my NDA and figure out what I can say.

For now, my new challenge--both for fun and for work--is to learn functional coding. Come on, O'Reilly books, don't fail me now!

Sunday, November 23, 2014

Post-MakerSquare, Week One: Don't be so apologetic on the job search (plus bonus FizzBuzz)

"So, one note for you," said a mentor, after I went through a mock technical interview, "is: Stop being so apologetic."

Which really might be the centerpiece of why I don't love interviewing. I mean: I love talking to people, I love asking questions, I love answering questions. God help me, I even love coding challenges. Ask me to do FizzBuzz in one line, please!
Sidebar: How to do FizzBuzz in one line:

(1..100).each {|num| num % 3 == 0 && num % 5 == 0 ? (puts "FizzBuzz") : num % 3 == 0 ? (puts "Fizz") : num % 5 == 0 ? (puts "Buzz") : (puts num) } 
It's not pretty--or really all that maintainable--but it works in one line. (Note: tested on repl.it; and inspired by a Paul Irish post.)
Let's break it down:
  • 1..100 -- standard Ruby for an inclusive range
  • each -- loop over each element in the array/range and slip it into the following block
  • followed by a cascade of ternary conditionals
    • if it's divisible by 3 and 5, put "FizzBuzz", and if not, then
    • run through the next case (divisible by 3) and if that doesn't work,
    • run the next case (divisible by 5), and if that doesn't work
    • just put the number already
But I don't love selling myself. When I'm discussing my projects and my web dev foundation, it's pretty tempting for me to pick at the issues or the lessons (i.e., the mistakes that I made). Largely that's because of where I am in my career--just beginning, with plenty to learn and a big hunger to learn it. I mean, I really liked the early hackathon project we did, but weeks later, I can see some of the holes there.

Looking at those holes can be very educational and even rewarding. ("Look, ma, I'm learning!") But they don't always make the best interview discussion.

So, dear mentor, I'm going to try to be less apologetic during interviews.

And wouldn't we all rather talk about FizzBuzz anyway?

P.S. For actual information about my job search--well, I'm not going to get into details. Suffice it to say, I'm concentrating on Austin right now, with an eye cast on Chicago; I'm looking primarily for, let's say, middle-end to back-end--anything below HTML/CSS, which I can do, but don't enjoy as much. I've got some leads and had some positive interviews, so I feel OK. But I'll be 100% honest with you: I'd much rather be coding than searching for a job.

Saturday, November 15, 2014

MakerSquare Day 58: And so it begins... or ends... or ends and begins. Or maybe just goes on (12/5)

So, today was our last official day at MakerSquare, and after some teary-eyed goodbyes, it became clear that a lot of people will probably be around on Monday.

Because even though we're done with one step--the immersive, 12-week course--we've got a lot more to do, both in terms of our development as web developers and in terms of our job search.

That said, I think it's important to take a moment to appreciate how far we've come, both individually and as a group. I remember back to our first day--well, I don't have to remember it, I can just point to my blog post about it here. Back then, we were told to parse a list and the class largely responded with "what a what now?" We were told to model a recipe and I thought about striking a model pose.

Well, OK, maybe we weren't that clueless, but we were pretty close.

And now, after 12 weeks of constant and steady work, all of us had several projects that we could show off pretty successfully. Many of us have already posted about our projects (on reddit and elsewhere) or posted our projects online for everyone to use (more or less). We have portfolios.

Some of us even have interviews and contacts; and all of us have pretty good prospects for the future.

So, I have a bunch more to do today and beyond, and I fully plan to keep up with my blogging. On a more limited scale of course. As we move away from the daily blog, with me memorializing my time at MakerSquare (for potential and actual students to check), I hope to transition more into helpful bits of code I've discovered or made; and a record of projects that I'm working on.

I hope the last 12 weeks of blogging have been helpful or interesting. The last 12 weeks have been both for me.

Also, one last comment about our last day: a week ago, a classmate of mine said that we should have a high-five graduation ceremony, where everyone got to play one song and go around the room high-fiving everyone. At first, I wasn't sure about this idea: is that really how we wanted to go out?

So let me offer this advice for you: if someone asks you if you want to play a song that's meaningful to you and high-five everyone after working really hard for 12 weeks--you say yes.

(For those interested, the songs ranged from triumphant for finishing the course; to hopeful for how we're going to get better at this; to joyful. I can't help but jump to Icona Pop's "I Love It," which was one of the songs on repeat during my finals weeks.)

Friday, November 14, 2014

MakerSquare Day 57: Open House: The real short version (12/4)


And a good time was had by all. I'll have more to say when I've collected my thoughts, but the slightly longer version of the real short version is--I talked to some people. Everyone was nice. People seemed to like my projects.

And now, time to get some rest.

Just kidding: now I want to read a book about Scala and functional programming.

Thursday, November 13, 2014

MakerSquare Day 56: The short version (12/3)

For those of you who aren't going to make it to the open house tomorrow, I wanted to present a short, bullet-pointed version of things I may talk about. (It's OK, it's supposed to be terribly cold tomorrow, I get it if you can't make it.)

OK, so maybe this is just 15 minutes of me trying to articulate this stuff that I've been working on for a while. Starting with...

About me:

  1. My career(s) and interests have taken some left and right turns, though you'll see a lot of themes running through--
  2. People: I like working with people, I like working out problems with people in discussion, my dissertation was going to be on groups of people working together. Heck, even improv is primarily around being a good teammate. (And, though this is my professional blog, let's add here that I moved from Chicago to San Angelo, TX because my girlfriend got a job there. That too is about my love of people--or at least my love of one particular person.)
  3. I like paying attention to detail--and I can tell you at length how close-reading in literature or paying attention to your improv team is a lot like double-checking your code before shipping it.
  4. I like innovation and experimentation and getting better all the time. And here's the part where I kind of have to slag on my grad school experience. Not that English departments don't like innovation in certain ways, but those ways are somewhat limited. (Though, again, I can go on about the digital humanities/big data in literature movements.) But in web development, everyone I talk to has some interesting side project or is learning a new language or BUILDING A NEW FRAMEWORK. In a weird way, web development combines my loves of creation and analysis.
About my Chrome extension:
  1. I knew it had to be a Chrome extension since it ran on the back of another site. (Which limits the applicability, but also made it easier to scope the project.)
  2. I spent several days of the development cycle home sick, trying to read up on the subject; but as with most things CS related, reading gives you maybe half of the info--it's usually more informative to just get your hands dirty.
  3. A Chrome extension is a lot like a regular website in terms of stuff in it--HTML, CSS, JavaScript. (You can even put Angular in! Though that didn't seem like a good way to go for my extension.)
  4. But the architecture is very much based on convention rather than configuration: there's a way that things are done and you just have to learn them. So, for instance, content scripts are the only way to affect the DOM, while background scripts are sort of a virtual space where you can pass info from content to the browser itself and the pop-up window.
  5. I played around with the omnibox before deciding on a pop-up interface.
  6. My biggest difficulty was figuring out how to get it to re-run when new tweets get loaded, until I found out about Mutation Observers, which are perfect and new-ish, since they are objects with special methods for watching for changes.
About my ShareCare app:
  1. The idea that I came with, inspired by my experience of sharing responsibility for a dog.
  2. (I even tried to set up and send out a survey inspired by my watching of the Coursera course on Human-Computer Interaction. I did not get a lot of responses.)
  3. My biggest (first) difficulty was exploring some options for tech stacks to use. For instance, I never used Foundation or Bootstrap before, so I wasn't sure which might be better for styling. (I went with Foundation, which I was moderately happy with, except for some bobbles trying to get Foundation and Rails to work nicely together.)
  4. Rails was a lot of fun to work with, in part because it's so smart. You want an AJAX request from a button? Just add "remote: true." You want to separate out your page into modular parts so you can handle each part individually? Let me introduce you to partials.
  5. The second difficulty was thinking about how to best design the database. Just a few days ago I realized I could drop one whole table (Claims) and make the same call by just paying attention to the Task table's "completed" and "user_id" columns. (The lesson, as always: Don't make things more complicated than necessary.)
  6. The greatest lesson of dealing with a big project like this is the modular approach: break it down, and fix one thing at a time.
  7. I probably learned more from this project--both the mistakes and the successes--than any other project.
  8. Also, I have a ton of ideas for how to expand and improve this project. Though as it stands, it fits the need I had of passing info between me and my girlfriend about whether the dog's been fed or not.
OK, so that took longer than 15 minutes, but it's going to be mighty cold tomorrow, so some Austinites might not make it out.

Wednesday, November 12, 2014

MakerSquare Day 55: "I have the skills." (12/2)

That's my takeaway quote from tonight's alumni panel discussing, well, what it's like to be an alumni of MakerSquare. "I have the skills" was the realization that the alumnus in question had when working out a problem at their job. Maybe they didn't have the knowledge, per se; but from their time at MakerSquare they had the skills to find the answer.

Though today's panel was only a few hours of the day, with that sort of positive message, it certainly left something of a influence. Or maybe that's just how it is when people share their horrible interview stories.

(Although, is it wrong that every time I hear an interview story involving a coding challenge--like "reverse a string in JavaScript"--my brain always stops for a moment while I work out how I would do that? I guess the lesson here is, if you need to distract me, give me a fun coding challenge.)

(Also, it's a lot easier to laugh at horrible interview stories when the people are not employed and happily so.)

But really, today was spent doing a rather large amount of tasks. Is there anything better than crossing tasks off your task list? I don't think so, which is probably why one of my final projects is all about creating tasks and then marking them as done.

I also realize that I've been talking very vaguely about my final projects and about things I've learned. Well, OK, I did write about how to make a Chrome extension, both in general and in particular.

But what about Rails, which is what my ShareCare app uses? What about Foundation and HTML and CSS and JavaScript? (OK, not I'm just listing my tech stack.)

I'm coming to the end of my allotted 15 minute writing time, so I won't be able to get into all of that today. But I will say this: one thing that I've learned through my weeks here is that documentation--even the littlest bit--can make a huge difference. When I go to find a Gem to do something and there are several out there (there's a lot of overlap among Gems), I tend to choose the one with the best documentation.

Which is why I spent so much time this week working on my Github README files and that's today's lesson: good documentation includes a clear README.

Tuesday, November 11, 2014

MakerSquare Day 54: Wherever you go, there you are. And your code is there too! (12/1)

We're coming down to the wire here. And as much as I want to look up where that phrase comes from--something about horse-racing, maybe related to a photo finish? or maybe something related to barbed wire and trench warfare in World War I?--I feel a little too busy.

I would love to slow down a bit and tell you all the stuff I'm learning and trying. "Learning" includes a lot of trial and error, so I'm learning a lot with my final projects.

Of course, one of the things I'm learning a lot about is me. (Also: Rails and Foundation.) Which reminds me that, a few weeks ago, while the full-time MakerSquare students were filing out and the part-time students were filing in, I made a joke of the form, "I thought I was learning about JavaScript, but I was really learning about myself."

(If I had had more time to think about it, I might have gone with a Russian reversal joke: "In America, you learn about JavaScript, but in Russia, JavaScript learns about you.")

Besides getting a laugh (which is the point of jokes, right?), it seems that I might have accidentally said something truthful there (which is the real point of jokes, right?).

I mean, working on final projects is a reminder of everything good and bad about yourself. I like working in teams or at least talking through ideas with other people. (Brainstorming for other people is one of my favorite things. What do you need? A title? An app idea? A villain for your superhero RPG? Whatever it is, I want to brainstorm with you about it.) So working on a project all by myself--not my ideal situation.

Similarly, I love doing research before attempting something; but, at least in this situation, I've learned a lot by just getting in there. As I learned as a kid, breaking something is one of the best ways to learn how it works and how to fix it (and how to run faster than my older brother). So that day that I spent reading the docs for Foundation wasn't any more helpful than the hours I've spent wrestling with putting that into practice.

Saturday, November 8, 2014

MakerSquare Day 53: Incremental (11/5)

I named this blog "Incremental Code" for the best reason of all: brand consistency. Either that or a lack of ideas.

See, my other blog--the one where I talk about movies and books (mostly)--is called Incremental Catastrophe. Which is a name I chose years ago to capture that feeling of sudden and irreversible upheaval happening very slowly.

So when I started this blog to focus on my MakerSquare time*, I went through a few ideas about what to name it before deciding that "Incremental Code" was, you know, good enough.

Which is how I've discovered that "Incremental Code" is the perfect name for a blog about coding for me.

MakerSquare's program is accelerated; and there have been times when my knowledge of these issues has gone up sharply. And there have been times when I've felt my knowledge increase barely. But if you were to draw a line of my learning, it would, overall, average out to a very reasonable, incremental increase.

Which is, coincidentally, how I would describe my coding process. Sure, there are times, usually in the shower or when falling asleep, when I am hit by sudden inspiration about how to solve some problem.**

But most of the time, I get the work done by sitting in a chair and doing the work. (That's a lesson I take into coding from my time working on fiction.) You move the code forward every day; and even an incremental process can result in a big step forward.

*Note to future MakerSquare students: writing every day may not be for everyone. But I would set yourself some schedule and stick to it. If you say, "I'll just write when I have something to say," you'll never write.

If you say, "I will write every week to summarize what I've learned," you'll find--magically--that you do have something to talk about every week. It's almost as if--as if!--putting your butt in the chair and getting to work can be productive and inspiring.

**Of course, that sudden inspiration only happens because I've been steadily working on that problem before the shower/sleep. Again: incremental.

Friday, November 7, 2014

MakerSquare Day 52: Ask and ye shall receive, time permitting (11/4)

I'm inspired by this recent week, when I really worked on my skills in one particular area: asking questions.

See, I've always been of the "let me try this for myself" bent. And I still am; but when it comes to web development, I've gotten better about setting myself a time limit. "Let me try this for myself--for a half hour."

And when that half-hour is up, I go find a peer or an instructor to talk through the issue. Thanks to that half-hour I spent, my questions are less  like "Help!" and more like "I'm trying to do X; I've already tried methods Y and Z and wrapped all the way around to A." So really, I'm glad that I try to do things myself.

But I'm also glad that I've gotten more comfortable asking questions about this.

I'm also glad that I've gotten more comfortable asking people for help. For instance, I reached out to someone who came to speak to us the other day, and he graciously offered to talk for an hour on the phone about some questions I had.

That's just one very concrete example of how, if you ask, sometimes you get what you need.

So, inspired by this last week, I wanted to ask you: do you have any questions?


Thursday, November 6, 2014

MakerSquare Day 51: "You don't know what you don't know." (11/3)

A very short blog post today--please, contain your disappointment!

I realize I didn't tell you my plan for this last week before our open house: having finished (for now) with my Chrome extension, I'm going back to my first project, Sharecare, which was really in not the best state.

Which is a shame for a few reasons: reason one, I would actually like something like ShareCare. (And yes, I'm inconsistent with my capitalizations because I haven't decided yet; tonight, I am leaning towards the camel case of "ShareCare.")

Reason two, the closer we get to our graduation, the more we're talking about the upcoming job search. For instance, today we had two lectures by outside consultants: a HR person and a VP of engineering. Which made for a very interesting day, if not totally coherent.

I mean, the HR person might be one of the first people to see our resumes: he's the guy who decides whether our resume goes forward after that first brief glance. (Note: Not him, exactly; he's pretty high-powered.) So he's looking for a certain set of skills on paper; and then, in a behavioral interview,  he's looking for a human being to fit a human-shaped hole in the company.

By contrast, the VP of Engineering might not see our resume at first; but he's not only going to be weighing in--and weighing heavily--on whether we've got the actual technical and human skills to fit in with the company on a day-to-day basis. Ultimately, if we get hired, we might not see the HR person, but we'll be working with the Engineering person.

So these two people come to the task of interviewing with a slightly different set of perspectives.

But--and here's my English grad school education to the rescue--I can see the patterns of similarity that run between these two widely disparate views. (If I were writing an English paper, I might call these "themes.") They may differ on some details, but the core advice is mostly what you hear about interviews: be the best version of yourself.

On top of that, both speakers hit the notion that informs today's title: at this stage in our career, we may have some ideas about what we want to do, either technology-wise (front- vs. back-end) or field-wise. But we don't know what we don't know, so we should also think about being flexible, not getting too tied down to any fantasy of what the right job would be for us. The right job might be something we don't even know about.

Wednesday, November 5, 2014

MakerSquare Day 50: How to Make a Chrome Extension, For Real This Time (11/2)


  1. the manifest.json: This is what makes the Google Chrome extension. This json file keeps track of everything you want to give this extension: all the permissions you give about what Chrome APIs it can access; all the files it has--background, popup, and content; and information about where the extension can run.
  2. a background file, either background.html or background.js: a background file is basically a pretend page--something the user never necessarily sees, but that helps organize all the other files; if you like visual metaphors, I think of the background as a highway interchange in my app: nothing happens there, but it's a useful nexus for talking between the other files (and also between Chrome itself--the background.js is what tells Chrome to show the little icon).
  3. your popup files, if you have any, often a standard mix of HTML, JavaScript, and CSS: many Chrome extensions have little icons and when you press that icon, you get this little popup window. That window is basically a little webpage: mine has HTML to tell what to show, some CSS to tell how to show it, and a lot of JavaScript to tell how it should behave.
  4. a content script: this is not necessary for all Chrome extensions, but is the only way you can have a Chrome extension directly affect the DOM of a particular webpage. So, I can make a new tab and go to a URL with a background file; but if I want to affect that page once I load it, I need a content script.
So if you have all these different parts, how do we get them to work together? Here's a few remarks on my Chrome extension (still available here):

Basic background: to pass messages between these elements, you need to use a pair of functions--a sendMessage and an onMessage function. So, for instance, when you go to Twitter, my content script runs--because that's what the manifest.json tells it to.

My content script includes this
  1. chrome.runtime.sendMessage({}, function(response) {
  2. storage.get('banned', function(blockedWords) {
  3. var tweets = $('li.js-stream-item');
  4. runBlockedWords(tweets, blockedWords.banned);
  5. });
  6. });
Line 2 here gets something from chrome.extension.storage.sync (which I aliased to the variable storage because I thought I might want to change it to chrome.extension.storage.local). And notice that the storage extension function here involves a callback--because almost every chrome.extension function involves a callback.

So we get an object from storage and we call that object blockedWords; but that object itself has a key named "banned"--which is why Line 4 involves blockedWords.banned, which is the value of "banned" inside blockedWords.

Also, note that this is the content script, so I can use jQuery to directly affect and access the DOM. In this case, I'm grabbing all the tweets that match li.js-stream-item--which is all the tweets currently visible.

Now, on the other side, in my background.js, I have
  1. chrome.extension.onMessage.addListener(function(request, sender, sendResponse) {
  2.   chrome.pageAction.show(sender.tab.id);
  3.   sendResponse();
  4. });
Line 3--as I understand it--sends a response message, which ends that message cycle. As you see, I don't have any actual message to send back, so I'm just sending an empty response.

Line 1 is the important part: it listens for a message. From where? From anywhere, I think. It just so happens that background.js will only hear a message when content.js sends a message--and that will only happen on Twitter.

That's important for Line 2, which is where I tell the browser to show the icon for the Chrome extension--but only on the page that sent the message (sender.tab.id).

And that's how I made (at least part of) my Chrome extension.

Tuesday, November 4, 2014

MakerSquare Day 49: How to Make a Chrome Extension (11/1)

This isn't step-by-step instructions for making a Chrome extension. It's not even step-by-step instructions for making the Chrome extension that I made this last week, a spoiler blocker for Twitter.

But yesterday I solved some final problems I had with my Chrome extension, Shush!, and I wanted to make a few notes about the whole process.

First, writing a Chrome extension is a lot like writing any code. You start with an idea.

Then, you realize that your idea is way too big.

There's no way you can, in the time given, make a program that will scrape data from the internet to find out what words are related to what other words, so that it'll know to avoid "#RedWedding" when you tell it you don't want "Game of Thrones" spoilers. It's doable--and I'm still excited by the idea--but it's not part of the week-long project to make a minimum viable product.

Other things that are the same when making a Chrome extension: your idea of what it should look like or how it should achieve its goal will change--be prepared to change it. Also, and as usual, every project consists of smaller tasks that are immediately solvable. The key to any project seems to be having that dual-minded approach: remembering the big picture, while focusing on the solvable modular bits.

And, as with writing web applications more generally, one of your biggest resources is things people have already done. There are a lot of Chrome extensions out there--and Google has a nice library of example extensions that just do one or two things; so when you know the specific task you have to solve, it's interesting to see how other people approached it.

Anyway, it's not finished finished. For one thing, my mentor just pointed out that I should include some contact information on it. But if you're here, that means you know how to contact me, so, if you want to see the rough but functional code, it's up on Github right now: https://github.com/benjaminjb/twitterblocker.

Saturday, November 1, 2014

MakerSquare Day 48: Second week of final projects wrap-up (10/5)

This post is going to be shorter than usual (and also a teensy bit late) because (a) my girlfriend and dog are visiting this weekend; and (b) my midweek sickness really knocked my schedule back. (Also, I am not well yet.)

But I wanted to record something about this last Friday, the last day of our second week, because (1) after a few days of not really being able to concentrate on learning this new technology/pattern/medium (it's hard to know what to call a Chrome extension), I was able to break down the big problem into very modular issues and solve them to my satisfaction. What a difference enough oxygen to your brain makes; and (2) though there was the typical office despair going around, I was really impressed with everyone's work and with the creativity that went into both coming up with a project and fiddling with the details.

I guess that means I have to make this Chrome extension really good. So I'm off to do that, while sitting with a puppy at my feet.