Why REST


Warning: file_get_contents(https://bitbucket.org/danielclouse/why-rest/raw/5139a934576196a20b34d522340ce7490c36a4d5/sailsAPI/assets/js/main.js?at=master?at=master): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /home/public/wp-content/plugins/wp-git-embed/wp-git-embed.php on line 99

Warning: file_get_contents(https://bitbucket.org/danielclouse/why-rest/raw/5139a934576196a20b34d522340ce7490c36a4d5/sailsAPI/assets/js/main.js?at=master?at=master): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /home/public/wp-content/plugins/wp-git-embed/wp-git-embed.php on line 99

Warning: file_get_contents(https://bitbucket.org/danielclouse/why-rest/raw/5139a934576196a20b34d522340ce7490c36a4d5/sailsAPI/assets/js/main.js?at=master?at=master): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /home/public/wp-content/plugins/wp-git-embed/wp-git-embed.php on line 99
This is the second in a multipart series about REST APIs. Learning to REST Why REST Node.js and REST (coming soon!) Even Microsoft Takes a REST (coming soon!) Getting REST with Angular (coming soon!) CORS and REST Across Domains In the first blog post I talked a little about REST conventions and hinted at some implications for how REST APIs can and should be used.  In this post I’ll talk about why. Learn It, Love It, Live It Most REST APIs “speak” JavaScript, or more specifically JSON (JavaScript Object Notation), so let’s get something out of the way: even if you don’t particularly like JavaScript, it’s good to learn The Good Parts.  Back-end programmers, I’m talking to you.  Writing good front end logic is hard because users are unpredictable.  Don’t make writing the front end harder by imposing a complicated API pattern.  REST APIs are supposed to make it slightly less complicated by providing a uniform and pattern-driven way to read and write data from the front end.  That makes a front-end engineer’s life a bit easier.  On the other hand, a poorly designed or implemented REST API can make for more work. Even if you never ever do front-end work, and never touch the browser, remember that somebody else does.  A little bit of time and consideration on your part can make someone else’s life much much easier. Lifting Sails There’s a really elegant little framework for Node.js which makes REST patterns painfully obvious, and it’s called Sails.js.  If you’re not familiar with Node, I recommend taking 15 minutes to download and install it.  There’s a lot of cool stuff going on...

Tech Work is Still Human Work

Back in the 2000s the web was a wild new place; a place with new rules, or no rules at all.  It was a place where brave entrepreneurs could make millions, or even billions, just on the strength of their ideas, tech chops, and resolve. That’s how the story goes anyway.  It’s not all true, it’s not all good, and it certainly isn’t all pretty.  There are still a few hold-overs from those heady days that on the surface seem innocuous, but really hold us back. In short… Words Matter I started working as a programmer and web developer in 1999, and over the years I’ve seen job descriptions and job titles change.  In the very early days, companies didn’t know what to ask for; job searches were a blind grab for tech talent.  But as the industry matured, those roles have become better defined, better understood, and the whole software development life cycle (SDLC) has gone from arcane magic to well-worn path.  Now we can expect a “Senior Web UI Programmer” to have a certain set of skills and a certain longevity. Job descriptions and job titles are an area where the tech industry needs to take a moment to reflect.  If you’re job hunting, or if you are a company looking to recruit, try to remember that the dotcom bubble burst, and with it went all of the “new economy” daydreams, like calling yourself, “Chief Cookie Monster” on a resume.  So a job title of “Rockstar Coder” or “JavaScript Ninja” is a dead giveaway that reflection hasn’t happened. If your company is really competent, and you can reliably...

That One Time that Flying Didn’t Suck

I look forward to flying about as much as I look forward to sitting on a tack.  Now that I think of it, I’d rather the tack. I’m the proud owner of a 1998 Toyota Camry with 276,000 miles.  That high mileage is due in large part to the active role of airlines in making people miserable.  By people, I mean me.  Miserable enough that I’d rather drive to NY than fly. Now, I can make a rational case for driving over flying.  I work in NY, so when I get up there with a car, I HAVE A CAR.  And buying gas for a Camry isn’t too traumatic, especially compared to a plane ticket, parking fees, cab rides…  But let’s not kid ourselves here.  We all know what I’m really talking about. I’m talking about misery. And powerlessness.  When you go to the airport, you have to accept that you are a leaf on the wind.  You might be a leaf wearing expensive loafers and a $200 haircut, but you’re on the same flight as everyone else.  And yours is just as likely to get cancelled as anyone else’s.  I will never pay that kind of money for a haircut. So I’d rather drive 9 hours than fly 3.  Because it’s never 3.  The cost of that trip is not dollars or hours, it’s failed expectations as well.  3 hours of flying involves 3 hours of air time, plus an extra 3 hours of layovers and TSA molestation.  And you never know how long any of it will take.  At least with driving you can make yourself believe...