Sunday, June 4, 2017

Martin Fowler Breaks Down Event Driven Architecture

A few weeks ago, I wrote an article on this year's GOTO Conference videos. I recommended checking out a few presentations. Following my own advice, I ran across this gem from Martin Fowler.  If you're new to design patterns, or interested in event-driven architecture, take a look. He does a great job of breaking down a pretty broad concept.

It's like "service-oriented architecture."  This concept gets thrown-around a lot, but what does it really mean?  Microservices is technically service-oriented, but it's very different from building a monolithic, single-server API.  The concept of event-driven architecture suffers from the same ambiguity.  So is my app "event-driven" because I rely heavily on DOM events, or is it a problem that I sometimes call an object's method directly, rather than triggering an event?

Fowler doesn't attempt to answer these questions directly, or create a concrete definition.  Instead, he distills the concept down to four main paradigms: event notification, event-carried state transfer, event sourcing, and CQRS (Command Query Responsibility Segregation).  For the details, you can check out the video; he does a much better job explaining than I ever could.  It's a 50-minute presentation, so he only touches the surface, but it's sufficient.

I walked away with the ability to communicate my architecture choices more clearly.  When using Backbone, for example, I'm creating an event-driven app, but only in the sense that it's dependent on event notification.  I'm not using event sourcing for state management, or CQRS for IO.  This means better documentation, less confusion with other developers, and better questions.

Monday, May 29, 2017

Remote Work... Denied.

I recently tweeted an article regarding Microsoft's curtailing of remote work - a terrible decision.  Employment trends should move the exact opposite direction.

This is especially true in web development (Microsoft targeted software developers).  I could go on for days... We typically work alone; pushing and pulling code requires open source tools, which can be downloaded to practically any computer; development files are typically small, so slow/shaky connections are fine; working from home minimizes meetings and distractions, which are nightmares for focused developers.  It should be a no-brainer - better for everyone.

Even the planet - I'm a tree-hugger, so that matters to me.  We reduce gas consumption and emissions, buy less clothes, eat out less - there are plenty of examples, I'm sure.  The point is that we need to be moving towards "green" solutions.

I try to keep these posts relatively short, but bear with me a moment.  I'd like to reference a book I read this weekend - The 4-Hour Workweek, by Tim Ferriss. It's considered a must-read by a few people I follow and respect.  If you're reading this, I assume you care.  Ferriss spends quite a bit of time imploring employees to seek remote-work arrangements - even quitting, if the boss won't budge.

I hope Microsoft and others reconsider this move away from remote work.

If you're interested in my thoughts on The 4-Hour Workweek; it lives up to the hype.  Tim definitely includes more stories and "resources" than I deem necessary, but he articulates his arguments well, and a lot of what he says aligns with my personal philosophies.  If you're into refining your priorities and living an "effective" life, it's worth reading.  I even finished the book quicker, by following his speed reading tips.

Saturday, May 20, 2017

Check Out GOTO Chicago 2017

Interested in a good, "free" developers conference? GOTO Chicago has posted videos from this year's conference.  I'm a big fan of conferences.  I think they are a great way to stay abreast of emerging technologies and trends.

I attended GOTO last year, and had a great time - nice venue, great speakers, great content - worth the time.  I even met a cool developer there (shout out to Bill Brown at ColorfulSoftware.com - great guy).  I hoped to make it again, this year, but things just didn't work out, so I'm glad to see the presentations online.

It's interesting to think about the future of conferences.  Presenters and patrons want presentations posted online, but that pretty much defeats the purpose of attending.  I know... I know... the networking - I'll get there.  Lets just assume people quit attending.  Revenue drops (ads, vendors, registration fees, etc.) - making it difficult to afford spacious venues and "flash."  This, in turn, makes attending even less desirable.  Makes me wonder...

As for the networking - it's way less effective than social media, or local meetups.  For the time, effort, and energy you invest, I argue it's more useful to stay active on a popular social platform (Twitter, for example), and to maintain a blog.  Meetups are more frequent, and attendees are typically there for networking, as well.  They're more to-the-point, in my opinion.

Thursday, May 11, 2017

97 Things Every Programmer Should Know

I recently finished 97 Things Every Programmer Should Know.  It's a little dated, but principles stand the test of time, right?  I think so.  I gave it a shot.  

It's a little long (200+ pages for essentially anectdotes), and I'm not quite sure how the authors' intended for readers to consume the book.  The chapters are too long for a daily psalm-like reading, but too short for any real analysis or depth.  In the end, it felt like a collection of short stories.  

Some concepts were really useful.  The "Coding With Reason" chapter, for example, was great - short, but loaded with reminders that helped me immediately.  "If you need a nested section, make it a function," for example - brilliant.  I forced myself to apply this principle for a few days, even when it seemed ridiculous, and I actually found my code was simpler, and fixing bugs, or changing functionality was a breeze.  

The "Make Interfaces Easy to Use Correctly and Hard to Use Incorrectly" chapter came at the perfect time.  I was working on a project where there was conflict over the application's behavior under certain conditions.  We found that simply removing features (buttons), was actually a better solution than developing execution paths.  

I'll assume an exhaustive report, of every harvested jewel from this dusty classic, is unnecessary.  Overall, I give it a 7 (out of 10 whatever's...).  There were quite a few "confirmations" and interesting concepts that left me pondering, which is the book's biggest strength.  It's not a place for answers to technical questions.

I've made it a personal goal to read at least a book a month, so hopefully these posts will come more often.  Feel free to leave a recommendation.

Sunday, April 30, 2017

Destroying Jobs Is A Good Thing

I just read an article, in the Seattle Times, about harvesting apples with robots.  In short, Washington is experiencing a shortage of farm-workers to harvest its fruit orchards.  Consequently, companies are racing to get contracts and sell machines.

Okay... so what?  Just another example of how technology is destroying jobs, and making it impossible to survive in this economy.  That's the narrative we consistently hear.  I mean, it's even directly in the article:
"The eventual loss of jobs for humans will be huge, said Erik Nicholson of Seattle, an official with the United Farm Workers union."
That's not good for innovation and progress.

This is where I think we, as IT professionals, have to frame the story.  We're not taking jobs.  We're changing the work people do.  I look at examples like this as one step closer to feeding everyone.  The purpose of technology is to improve lives, efficiency, and productivity.  If we can solve a problem, like world hunger, using robots, then shouldn't we do it?  The point of work isn't to be busy; it's to achieve something meaningful for humanity - to solve a problem.  If our food supply isn't an issue, which I think is a pretty good reality, then let us feed everyone, and focus on another problem - like scarce drinking water.  There aren't many things we need to survive, by the way - food, water, shelter, clothing, and protection.

The two gaping holes in my position seem to be: 1 - people "have to have jobs;" 2 - the argument that "my grandfather grew apples, my dad grew apples, and damnit, I should be able to make a living growing apples."  I'm not quite sure what to do about those types of concerns.  I think jobs should solve a problem, and as we solve those problems, we address new ones.  Don't support that neighborhood video store, when Netflix is better.

Saturday, April 15, 2017

React or Aurelia?

After finally feeling pretty comfortable with Backbone, I've decided to move away from it. I recently attended a developer's meetup where we looked at Aurelia.IO. I like what I saw.  Further, technology is all about embracing the new.  Moving on to the popular new tool is just pretty much part of the IT spirit.  I was being resistant and holding on to what I knew most - terrible mindset for a dev.

So I was really impressed with Aurelia, but I know React is the popular kid, so I'm at a crossroads - which to choose.  At this point, the learning curve really doesn't matter; I've accepted it as part of the profession.  I'm more concerned about market value.  Aurelia could turn out to be the new cool kid, but maybe not.  That's a big concern for me.  I'd prefer to learn and build experience with an in-demand technology.  Right now I use Slim (long story) as a backend PHP framework, and it drives me crazy because everyone wants a Laravel developer - meaning my market value would be higher if I had built the same experience, just with a different framework.

If you're wondering why Angular isn't on this list, it's because I feel like it's the new Backbone/jQuery.  It's been around for a while, a lot of people/organizations use it, but I think devs will start moving on soon.  That's just my opinion.  I could be wrong, but you've got to make your own decisions in life.  Still, if you disagree, I would love to hear your thoughts.  I'm not stubborn.

So which should I choose?  Let me know what you think.

Saturday, April 1, 2017

Why Write?

Unless you're a writer at heart, blogging is a pain.  It's not likely you're going to get rich, it can be hard to come up with content, and no one wants another "job" - at least I don't.  Yet, I'm back at this for the third time.  Why?

I do this to share and network.  I find it invaluable as a developer.  We have so much going on - tools and processes constantly change (Javascript... need I say more?), this is a really competitive industry, and most projects tend to be pretty demanding.  It's just really hard keeping up with everything.

"Social networking" (blogging, tweeting, Facebook posts, etc.), can help curate some of the information coming at us.  For example, a gentleman just reached out to me, this morning, about a CMS  platform his team is building.  I'm not in the market for a CMS, and I'm not even really a big fan of them, but he read one of my previous articles, and thought I might find it interesting.

It's not for me at the moment, but "my readers" are likely devs, with similar interests.  Some of you may be in the market for a CMS, and so I shall share this gentleman's product with you - Composr CMS.  Keep in mind that I've never used it, and only intend to try it the next time I need a CMS.  I'm not confirming that it's great, or terrible; it's just a platform that I've been recently discovered.  Let me know what you think, if you decide to give it a try.  Maybe it's a good alternative for all of you disgruntled Drupal users.  What a mess, right now...

Sunday, March 26, 2017

Pretty Good, Quick Read

I’ve decided to shorten these posts tremendously lol. I realize: one - no one wants to read all of that, two, it takes way too long to hit a “word count,” and three, I don’t have that much to say. So with that, on to the point...

 I just finished Code Simplicity by Max Kanat-Alexander - good read. It’s only 84 pages, so it’s something you can finish in a day, and it does a really good job of covering the basics of solid app design - not necessarily the mechanics (languages, tools, etc. - not even SOLID principles), but more so what to look for in your system.

 I wouldn’t say it’s something for someone completely new to the field. You won’t have the experience to really understand what he’s saying. On the surface, his concepts may seem simplistic, but if you relate to the experience, it holds a totally different meaning. For example, I recently went through an example of a problem mentioned in the book. Without going into details, I intuitively knew something was wrong with the assignment, but I couldn't articulate my concerns, at that time.  I had a real “I knew it!” moment when I got to that part of the book. It felt great. As a relatively new developer, knowing that it's "not me" helps.

Given the length of the book (it’s really a quick read), I even recommend it for seasoned developers. Experience doesn’t necessarily translate to great design. A really skilled developer can quickly create an aesthetically beautiful, bug-free, body of code that is not maintainable, or open to change. Even if you’ve moved on to a lead role, with less development, realizing some of the challenges your team faces at the start of a project, can help manage expectation.

Sunday, March 12, 2017

No More Drupal For Me

Let me start by saying this article refers to Drupal 7.  I have no experience with 8.  I’ve read that it may address some of the concerns I outline below, but I haven’t investigated.  By the end of this article, I hope you understand why.  

I’m not new to Drupal.  Over the past 4 or 5 years, I’ve consistently found myself involved in a project using it, and I’ve done a bit - from custom module and template development, to aliasing drush commands.  I even went to the first DrupalCon Conference in Chicago.  I know not to hack the core, how to update, what a distribution is, and much of what I think most devs would consider the basics.  I’m far from an expert, but I know enough to get a project off the ground.

My main problem with Drupal has nothing to do with how it's built, maintained, or even how it performs (in terms of actual backend execution).  My main problem is that it doesn’t support single page app architecture, which I will refer to as service oriented architecture, from this point forward.  I’m a big fan of single page apps.  They’re faster for the user, easier to maintain, decoupled from the backend, and reusable.  I probably don’t need to spend much time touting the benefits of SOA.  Unless you’re a die-hard full stack developer, you’re probably with me.  

Drupal uses reusable templates (themes) for the UI, which could lead one to think “SOA,” but it’s completely different.  The front and backends are not separate; they are fused.  Each “page” requires a full trip to the server, and subsequent bootstrapping.  This is where performance and user experience crash.  It also opens the door to unnecessary errors (network failure, failed resource loading, etc.), and the inability to scale your app.  Drupal is a “backend” framework, just one ill-suited to service a decoupled front end.  It’s designed to generate renderable html, not manipulate headers, or return JSON.

This is where Drupal 8 supposedly comes into play.  I say “supposedly” because I’ve only read these things (headless Drupal and all of that), but for argument’s sake, let us assume it true: Drupal 8 is designed to service frontend applications.  Drupal 7 definitely is not.  Given its roots, and need to support porting from 7 to 8, I have a hard time seeing how completely different use-cases are easily implemented in a framework.  If this were done truly well, I’m sure there would be more of a buzz in the developer community.  

There’s also a serious learning curve.  Eight is completely different than 7, according to Dries Buytaert, the creator of Drupal, and I just don’t have time for that.  I might be more inclined to experiment if it were just a bunch of new functions, modules, or whatever.  Instead, it sounds like I need to invest time into learning an essentially new framework.  I already use a micro-framework (Slim), and the only new one I’m interested in learning is Laravel.  Consequently, I’ve decided to move away from Drupal.  

Sunday, March 5, 2017

Warming Up To Backbone.JS


I’m pretty new to Backbone.  I started using it in early 2016.  My first “large” app was really complex and hard to develop.  I made so many mistakes - using jQuery instead of methods, callbacks instead of events, business logic in the router - plenty of issues.  It was… unpleasant… but worth the pain: what I learned in event-based architecture and “object-oriented” JS was invaluable.  I’m currently working on my fourth app, and I feel like my code is much more flexible and solid.

A big turning-point for me was realizing that it’s just Underscore for objects.  This revelation has made all the difference.  Knowing that it’s possible to build a Backbone-like app without actually using the library, has helped me appreciate the work that it does.  It has also changed the way I think about solving problems.  Instead of focusing on the steps needed to update a UI (methods), for example, now I think about how I could single-out a dynamic element, and create an object and template for it.

I even see the point of making all dynamic elements views.  With just a little more work, you gain way more flexibility.  Handlers are much easier to use and organize, you can incorporate a model and its syncing methods (should you decide to start capturing data on that element) - the options seem endless. You could achieve these same ends with a vanilla JS object, but why do that when adding just a few more lines of code, adds tons of functionality to that same object?  It's an even more compelling case if you're already using Underscore. Snippets have been helpful here, by the way.  Again, more work up-front, but worth it in the long-run.

Of course I’ve found my share of issues.  The biggest one being the need for a build system, or some sort of dependency manager (RequireJS, SystemJS, etc.).  I’m over it now, but I really disliked this, at first; I felt like it just added more complexity to the app - making something like understanding a .gulpfile an added dev requirement.  That’s not cool.  It makes it harder for a new dev to learn.  After the build system is in place though, it’s painless.

I’ve read the articles and know a large portion of Backbone users love its flexibility.  I’m not in that camp, however; I’d prefer more rules around its use.  I designed my first app terribly.  Honestly, I still don’t know if I’ve found an “optimum” structure, but I just keep moving forward.  It would help guys like me to have a “right” way.

I still have a ton to learn with Backbone.  It’s fairly old, at this point, and taking a back seat to Angular and React, but I still find it very useful.  Plus, it’s used in plenty of legacy apps.  At some point, I plan to move on to more "in-demand" frameworks and libraries, but Backbone has been a good start.  My code is much more modular, with tighter cohesion and looser coupling.