My Journey writing a Laravel Book

It all started 2 years ago, when I found this post on Forrst (archived.org) by Taylor Otwell announcing the release of Laravel 2.  I downloaded and tried it.  As I was using Codeigniter at the time, I found it quite nice and refreshingly different. However, my job only had PHP 5.2 on its server, so I only tried it locally and didn’t go much further. Then a few months later, he announced version 3 and I gave it more time.  When version 3.1 was released, I ended up using it for some personal projects and read through the source code pretty extensively. At that point, I considered myself fairly ‘expert’ in Laravel.

In August of 2012, I was contacted by Packt Publishing to be a ‘technical reviewer’ for Shawn McCool‘s Laravel Starter book. It was a fairly easy thing, and payment was basically just a hard copy of the book and my name/bio in it. When it was released, I was pretty excited to see my name in print. This was my basic reaction.

Shortly thereafter, I was contacted again by Packt with the offer to write a Laravel book, specifically a ‘cookbook‘.  It seemed like a daunting task, but I figured it would be a great step in my career, so I agreed.  The money isn’t great, but since I’m fairly unknown and payment was guaranteed, I was pretty happy with the compensation.

Packt pumps out tons of niche tech books every month, so they have a solid system set in place.  The first step was an outline. I had to come up with chapters, and then ‘recipes’ for those chapters with an estimated page count.  At this point, I started to realize that page counts and recipe counts were a pretty big deal to them.  They wanted 11 – 12 chapters with 9 or 10 recipes in each.  They said it looks good to have ‘over 100 recipes’ on the cover.   I struggled a bit at first, since I had done absolutely nothing like this, ever.  Eventually, after reading forum posts and seeing IRC questions, I began to get an understanding of what people needed help with.  It made the outline process a bit easier.

With the outline complete and approved by Packt, I began working on the chapters.  It was actually a lot easier than I first thought.  The only real issue I had was how the whole thing was formatted.  You get a Word document template, and you’re supposed to format everything with their pre-made styles. Formatting is VERY important to them. Also, everything is supposed to be worded like “and then we do this” or “so our next step is” because I guess it makes the reader feel part of the book or something. Formatting was probably the most stressful part of the initial process.

Chapters 1 to 9 actually went fairly easily. At this point in January 2013, version 4 of Laravel had already been announced, and the beta release was on Laravel’s develop branch on GitHub.  Then someone who was doing a technical review asked if this was for version 3 or version 4.  Packt asked me about it, and I told them I was working on L3, since L4 was still in early beta.  But most people’s best guess was a summer release of L4, and it would be quite a bit different from L3.  Packt and I decided it would be best to wait, because the release date for the book would probably be around the time L4 was released… and thus would instantly be irrelevant.

Now, it’s the end of February and I go to Laracon in DC. It was a fun time and I got to meet some excellent people. We also find out that L4 would be released in May.  So now, all I needed to do was learn L4.  With work and family, it wasn’t very easy to dig that deep into version 4.  The source is pretty extensive and relies on a lot of 3rd party libraries.  Packt was pretty urgent about wanting the thing finished, so I decided to stick with the original outline, salvage what I could, and just update the syntax for L4.  A few chapters needed a major overhaul, like one I wrote about using and creating L3 Bundles or how to include and use Composer in an L3 app. There are some that are still in the book, and work, but are kind of silly to do when using L4… for example, installing L4 as a git submodule.  Unfortunately, there are also a couple of DGAF chapters, like 3 separate chapters on using Twitter/Facebook/Linkedin for auth/logging in.  I ended up just getting it done and turning it in, and trying to make it as good as it could be.  I fell short of the 100+ recipes by 10 or so, and the 300+ pages by about 50.  Oh well. By the end of October, the Laravel Application Development Cookbook was officially published.  I can now call myself an author.

Now that I’ve actually spent some time with L4 and competed some projects with it, I’m kind of sad that there are certain bits missing.  Things like using the Laravel workbench, or creating custom commands, or service providers. I would add, update, or replace a good 20% of the book if I were to re-do it today.

Having said that, I still think it’s worth the money you pay, especially for the hard copy. Even just the ebook is less $ than two of the more popular Laravel ebooks available at the moment, and I think the information contained is just as valid. And while some may not have a great opinion about Packt, I was overall fairly happy with them.  I think their focus on page counts and formatting makes the process a little less enjoyable, but they promised a certain payment at various points in the process, and they delivered in a timely manner.

I think Packt is great for an unknown with a decent amount of knowledge on a subject, especially if you’ve never written anything before. Just having a published book on Amazon has opened a few doors for me, and I’ve seen an uptick in blog readers and Twitter followers. Though, if you’re even remotely known for a particular subject, just go to LeanPub… where you would need to just sell 150 books at $20.

In closing… I got my name on a book, I got a nice printed dedication to my wife and kid, and I got a little money.  So I’m pretty happy with the experience.  I mean, I may never do it again… but I’m happy I did it once.

 

Great Read – On Being a Senior Engineer

This is an excellent rundown about what being a “senior” engineer is all about.  Being part of a well-oiled development team, I really try to live up to these standards.  I especially like the “Ten Commandments of Egoless Programming” that he posts:

  1. Understand and accept that you will make mistakes. The point is to find them early, before they make it into production. Fortunately, except for the few of us developing rocket guidance software at JPL, mistakes are rarely fatal in our industry. We can, and should, learn, laugh, and move on.
  2. You are not your code. Remember that the entire point of a review is to find problems, and problems will be found. Don’t take it personally when one is uncovered. (Allspaw note – related: see below, number #10, and the points Theo made above.)
  3. No matter how much “karate” you know, someone else will always know more. Such an individual can teach you some new moves if you ask. Seek and accept input from others, especially when you think it’s not needed.
  4. Don’t rewrite code without consultation. There’s a fine line between “fixing code” and “rewriting code.” Know the difference, and pursue stylistic changes within the framework of a code review, not as a lone enforcer.
  5. Treat people who know less than you with respect, deference, and patience. Non-technical people who deal with developers on a regular basis almost universally hold the opinion that we are prima donnas at best and crybabies at worst. Don’t reinforce this stereotype with anger and impatience.
  6. The only constant in the world is change. Be open to it and accept it with a smile. Look at each change to your requirements, platform, or tool as a new challenge, rather than some serious inconvenience to be fought.
  7. The only true authority stems from knowledge, not from position. Knowledge engenders authority, and authority engenders respect – so if you want respect in an egoless environment, cultivate knowledge.
  8. Fight for what you believe, but gracefully accept defeat. Understand that sometimes your ideas will be overruled. Even if you are right, don’t take revenge or say “I told you so.” Never make your dearly departed idea a martyr or rallying cry.
  9. Don’t be “the coder in the corner.” Don’t be the person in the dark office emerging only for soda. The coder in the corner is out of sight, out of touch, and out of control. This person has no voice in an open, collaborative environment. Get involved in conversations, and be a participant in your office community.
  10. Critique code instead of people – be kind to the coder, not to the code. As much as possible, make all of your comments positive and oriented to improving the code. Relate comments to local standards, program specs, increased performance, etc.

I like to think I live up to most of those, though I’m somewhat (sometimes very) guilty of #9.

On WordPress and Learning New Things

Went to Austin’s WordPress Meetup tonight (last night, by the time this is posted) and it was a nice time. I almost decided to not go because the traffic coming out of Spicewood into Bee Cave was horrible. Then Mo-pac… fuhgetaboutit. Thankfully, I kept going and an hour and a half after I left work I got to Cospace just after 7pm.

The first part was a talk from Alex Hill from BaileyHill Media about using WordPress for political campaigns, which is something I’ve toyed with in the past. It was interesting to see how other’s approached political WordPress design. Then a discussion of the new features in WordPress 3.1. Most of them I knew about, but I hadn’t downloaded the dev release to test it out, so it was nice seeing some of the features in practice.

The internal linking and the quickpress theme tag are things I most look forward to. I need to look closer into the quickpress hooks once it comes out, but I can see some really cool things… especially for community sites.  Like a nice modal box that is accessible from anywhere? From a dev standpoint, the advanced queries and custom post styles look pretty sweet for making a very robust CMS. The different post types that 3.0 included were a great step in that direction already…. this will only make it that much better.  Maybe we’re one step closer to putting Drupal and Joomla out of their misery?

On the WordPress topic, I set up my own WP test/dev site at CrazyMonkies.org. My goal is to use it to hack and re-hack and learn as much as I can about WordPress. So far I’ve tried installing BuddyPress and wasn’t all that impressed.  It’s got some great out-of-the-box features, but almost TOO many features. Also, trying to do some quick themeing was not an easy task. I was hoping for some simple community functionality, but there’s just WAY too much “stuff” on each page… and I’m a huge fan of minimalism in design.

Having said that, there are two plugins that are killer – the Welcome Pack and Achievements plugins. Those two things mean BuddyPress could help create a very cool social site. And while I only tested it out a short time, and only with Twitter, BuddyStream is another great plugin for integration with other social sites.  If I ever set aside some free time, I think I may hack into a BuddyPress theme and try to create a super elegant social site.

Right now, I’m playing around with the P2 theme on CrazyMonkies. I had seen the theme in use on the WP development site, but never thought to install it myself. The real-time aspects and the keyboard shortcuts are great. I’m not sure why anyone would use this on a public site, instead of Twitter, but for a private forum it would be quite useful.  Also, adding comments threaded under the status updates is a feature that Twitter really needs. One little feature that it doesn’t have is a way to “delete” the status/comment from the front page… it only allows editing, though I’m sure there’s a way to hack that on. Another feature that would make it more Twitter-like is a friend/follow plugin… like BuddyPress.

In fact, P2 just may be a catalyst for developing a more full-featured social site, like BuddyPress but simpler. Really, all it would take are a few custom plugins. That’s probably something I’ll be playing with more….

Rallies and Sanity

I spent Saturday, mid-day, watching Jon Stewart’s Rally To Restore Sanity on Comedy Central’s amazingly clear live stream. I had considered heading downtown for the Restore Sanity Austin rally, but instead decided to avoid the hassles and actually watch a good quality version of the DC event.

Most of my thoughts about the Rally are mirrored by much better writers, but here’s a brief  rundown:

  1. The Roots/John Legend intro was okay, but much of the music was so down-beat… it may not have been the best the instill excitement and/or fun.
  2. The bits with the other Daily Show correspondents should’ve either been expanded, so they could do solo/team bits in the crowd… or cut completely.  The back-and-forth they tried was a bit of a train-wreck.
  3. Yusef(Cat Stevens)/Ozzy was a fun bit and a highlight.  My one, personal, complaint was I would’ve liked to hear “Peace Train” in its entirety.
  4. The Colbert “media/pundit/fear” video montage was great.  There really should’ve more of that.  If anything, their efforts to be non-political through most of the rally really hindered things.
  5. Stewart’s closing speech was near perfect.

What’s most interesting about the rally was the post-rally analysis. Obviously, people  in the media are going to push back at being criticized, like David Carr:

His barrage against the news media Saturday stemmed from the fact that, on this day, attacking the message would have been bad manners, so he stuck with the messengers.

Of course, as others have said, he really misses the point.  The “message” isn’t the issue here. All American’s hold different beliefs and different “messages”, but it’s the messenger that tries to pit these people against each other, for the sake of ratings.

Similarly, George Will on This Week misses the point:

We have two parties for a reason. We have different political sensibilities. People tend to cluster. We call them parties, and we have arguments, and that’s called politics.

He is conflating “sanity” with “not having an opinion”. Stewart was actually pretty clear that this was NOT his point.  Huffington tried to clarify, and brought up the quote from Stewart, “we can have animus and not be enemies”.  The idea is that we can have totally different beliefs, and we can fight for those beliefs… but we don’t insult those with differing beliefs or call them Hitler. Or Socialists. Or Communists. Or Nazis. Or Idiots.

Sadly, I don’t think the rally will have much effect on the 24-hour News Channels.  They have sunk deep into the “reality TV” notion that conflict = ratings.  And they’re right.  Maybe, though, the rally will have enough effect that people start turning off CNN, MSNBC, and FOX, especially for shows that encourage arguments  for argument’s sake.

Thoughts and Ideas #1 – Putting Them “Out There”

I’m constantly thinking, and coming up with ideas for things.  Be they apps, blogs, movies, tv shows, business ideas, whatever.  Most of the time, I just forget about them and they’re lost to the ether. Other times, I’m interested in developing them… but someone’s already done it, and I don’t feel like reinventing the wheel.  And still other times, I take steps to move forward with the idea.  Here are a few of my random thoughts:

#1 Increasing CD sales

I actually first had this idea YEARS ago, around the time Napster was at the height of popularity.  Each music CD should have a unique code, and when that code is entered into the record company’s (or third party’s) website, the buyer gets a credit for 10-15 mp3 downloads… plus, they can buy more credits if they want.  They can then download any song, by any of the record company’s artists.  Of course, back in 2000-2001 when I thought of this, it could’ve have had a huge effect on the recording industry, and my idea of buying “credits” to download songs actually predated the iTunes store. I knew too that to be successful, the record company’s “store” needed to have an overwhelming number of songs available.

The problem is, I didn’t (don’t) know anyone in the recording industry… or know anyone who knew someone. And the idea of building a third-party platform myself never even entered my mind.  Right now, I think the idea would only have limited appeal, since online music stores are so ubiquitous.

#2 Demystifying Flight Costs

I thought this up after listening to an episode of  This Week In Google, when Jeff Jarvis talked of how airline ticket prices were such an unknown. My idea was to create a database of ticket prices, so each user would enter in their flight info and price… and after enough info was submitted, I would create an algorithm that could parse the info and try to re-create the airline’s yield management algorithms. Eventually, you could input the date and locations of your flights, and the site would calculate the best price you should be able to get.  Since the prices are so variable, this would allow the user some ammo when negotiating with the agent… or even when putting in the Name Your Own Price on Priceline.

I knew the algorithm would be no cakewalk, but I figured if I could at least start gathering the information, it would make it easier to get started.  Initially, as is my want, I had all these grand ideas of parsing flight data through APIs and Scraping, letting the user click on a Google Map where they were flying to/from, allowing them to Tweet/Facebook their flights, and much more.  Well, thinking like that becomes untenable and creates an overwhelming amount of work for myself… and thus work either stops, or never starts.  With that realization, I created MyFlightPrice just using freely available Google Tools.  It took just an hour to make, and is pretty simple. After I finished, I tweeted to Jeff Jarvis, he re-tweeted, some people entered in some information… and that was about it.

#3 Finding Quality Celebrity Twitterers

These days a lot of famous people are on Twitter. Some are really doing their own tweets, some have PR people, some are a mixture. To weed out the PR generated tweets, and the just really boring people, I thought there needed to be a way for people to rate the celebrity twitterers and leave a review. So I created TwRate.

It’s a pretty simple concept. You login with Twitter, choose a celebrity, rate/review them… and that’s it. Each celebrity’s page shows a bit about them, their last 5 tweets, and the reviews.  You can also Follow/Unfollow from their page. I had hoped it could be a fun, snarky place to make us “normals” feel better about not being rich and famous… by making fun of those who are.

I actually had pretty high hopes for this site, but it really hasn’t taken off.  In fact, I’m the only one who’s used it.  But to be fair, I haven’t promoted it much at all.

#4 Practical Relationship Advice and Tools for Husbands

I bought the domain wifehack.com thinking of creating a blog for husbands – offering tip, tools, and advice on how to help your relationship with your wife.  I was hoping to have less of a Dr. Phil angle, and gear more towards technology. As you can see, 3 and 1/2 years later and I haven’t done much more than set up a blogspot account.

#5 HTML 5 blog

So I also wanted to blog about my journey as I taught myself the ins-and-outs of HTML5. I bought Html5Pro.com and while I’ve teaching myself HTML5, I never bothered to blog about it.

#6 Web Development Podcast

This is a recent idea that I still hope to do one day.

One of the things I have yet to find in the podcast-o-sphere, is a decent Web Development News podcast. There are good shows like the Big Web Show and Boag World, but they don’t have the specific format that I prefer listening to. I prefer the news w/ commentary format of shows like Buzz Outloud and the TWIT shows. That format, but dedicated to Web Dev News, is something that I have yet to find… and a couple that come close are either very infrequent, or just sound lousy.

The goal is to have a weekly show, with a couple of “regulars”, and add in a third (or fourth) guest on a rotating basis.  We’d run down the latest web development news, discuss each story, and move on. Nothing ground-breaking, but as far as I can tell, it hasn’t been done in a consistent, quality way for this topic.

The one problem I’m having with this is that I’m new to Austin and haven’t ventured out to meet with other devs. Hopefully, once I get more social with the community, I can get this thing off the ground. I’ve considered doing it on my own, but that would get dull.  Maybe just starting with 5 minute mini-casts? I don’t know….

So those are just a few things rattling around in my head. In the past, I was always a bit scared to share things, thinking someone might take my idea and do it themselves. I’m over that now. With so many things in my head that never even get started, I figure they might as well be out in the world.

Motivations To Code

A few months back, I had an idea for a recommendation site for politicians/political candidates. The thought is, a user browses through a list of candidates that they can vote for, then clicks on an icon to “endorse” them.  I also wanted a way to not recommend a candidate by having a “reject” button. Then I would allow the candidates to include a script on their site that listed all their endorsements, ideally replacing/adding to the Endorsements page that many political candidates have on their site.

Basically, it’s a Facebook “Like” button, but with an option to “Not Like”… and all the candidates would be in one place.

The problem is, it’s just me doing all the coding and design, and being new to Austin, I don’t know anyone else that might be interested in helping out.  Add to that, the hours I spend at my  job, and having an 18-month old baby, and  going through a seemingly never-ending move… and it’s difficult to find the time, or the motivation to work on the project.

When I do find time, there will be brief spans of productivity and clarity.  Then eventually, I’ll hit a wall and a particular programming problem will stump me.  Instead of pushing through it with OCD abandon, I’d rather just stop and play with the baby.  This has been a circular pattern that has gone on for the past 9 months or so.

Tonight, I watched The Social Network movie, and the scene about the creation of FaceSmash made me long for the days when I would have an idea and stay up all night working on it.  Like when I bought a copy of “Creating Cool HTML 4 Web Pages” and spend all day and night reading every word, and creating “cool” web pages.  In those days, had I known PHP (or at least PERL), I would’ve had my endorsement site done in a week.  Of course, I didn’t have a full-time  job, a wife, or a baby at the time.

Then, I read the latest Email from Jason Calacanis and I’m not sure whether to be defiant or justified.  He basically argues that entrepreneurship is for single, young people… at least if it’s your first foray into creating something.  In the past, he’s also argued (essentially) that if you’re not working 18 hours a day, you’re not working hard enough. But I think 37 Signals shows that that isn’t always the case.

And no, I  don’t think my little idea would qualify me as an entrepreneur, but I think it is something that would have some appeal. I had also considered rolling it into another idea I’ve been working: creating nice-looking, dynamic web sites for candidates in local elections. In fact, I’ve got TONS of ideas… ideas constantly running through my head. Many times, I’ll spend a week or two on them, get them to a functional place, and stop.  And up until a year or so ago, I would immediately register a domain name to go along with it.

For example, TheMoviePunch.com was going to be a video blog where I reviewed movies, but only having viewed their trailer. Or ReindeerBlog.com was going to be one of Santa’s reindeer anonymously posting about the dark-side of working at the North Pole… and more recently, I was thinking about registering ReindeerLeaks, and then “leaking” documents about Santa, the elves, etc. And why do I own MrShoop.com?

So anyway, I’m now looking for the motivation to get back to coding, or more specifically finishing some coding.  My biggest motivation right now is just about learning new technologies and keeping my skills sharp.  But that doesn’t require a finished product… just a continual process. My hope is that I can blog more, and get these ideas I have out in the wild. At least that way they’re  not just filling up my brain space.

Updating My Site

I’m using a premade theme (boo), but I like some of the customization features it has.  Also, I don’t have the time right now to create a brand new, fancy WordPress theme.  I’d rather spend my free, web time working on getting things in order.  I’ve got so many files and images and documents from the past, I really want to organize it all and have my site work as a repository for all things me.  Though, isn’t that what most personal sites are for?

I also want this to be a place to peep my portfolio… because I’d like to start doing some more freelance work, and make some extra $$$.  And I want to start saying things like “peep my portfolio” WAY more often.

There’s also a dream of doing more “regular blogging” about web dev topics, and technology in general.  Because, from what I can tell, that is a TOTALLY untapped market.

One challenge I have is, what do I do with all the freaking’ sites I’ve posted other stuff too…. like Tumblr, Twitter, Facebook, Twitface, Faceumblr, and Linkedblritterbook?  Just pipe it in here I guess.

Logo redesign, Site Map part 1

This evening, I still like my color palette, and last night I played around with the logo a bit. Here’s what I think is going to be close to a finished logo: Matula Logo test2

I like the simplicity and typography.  Also, it can be scaled down quite a bit, and the T and M still make it identifiable: Matula Logo Test - small

Next up, I need to figure out exactly what I want on my site.  Here’s a quick list, basically just a brain-dump:

  • Portfolio page
  • Blog
  • About/ Bio
  • Contact page/ form
  • Maybe sub-portfolio pages… one for Web Design, Development, Print work, or whatever
  • An experiment page, where I can post code demos or designs that I’m experimenting with
  • Links, both to stuff I’ve worked on and to pages I like
  • Tutorials/ Tips? Walkthroughs? May just keep that as part of the blog…
  • Pictures/ Photos / Video
  • Podcast? On something?

That’s just off the top of my head.  And some of those probably don’t need their own page, they could live in the sidebar or footer or something.

Something else I need to think about is do I want to just categorize my Posts or use WordPress 3’s new Custom Post Types? As I think about it, it might be easier to use the Custom Types, because I know sometimes I will forget to categorize things the correct way. With a Custom Type, I know that “Experiments” posts will always go to the right place.

Next, I’ll probably start sketching out some layout ideas and get my sitemap nailed down.

Finding a Color Scheme

In the process of redesigning this site, I’m at a point where I’m not sure what I should be focusing on next.  There’s layout, wireframing, a site map, a logo, textures, stock photos, self-created images/ photos, and many many more things.  But after looking at some the sites I was inspired by, I saw a pattern that I really liked:

  • Crisp edges
  • muted, earthy tones
  • some texture
  • interesting typography

For the typography, I like the look of Frutiger LT, and created a simple text logo with that as the base.

Frutiger LT font logo

I tried out some different kerning, and even whether to add a space between “Terry” and “Matula”. The top one I kerned each letter so that it only left about a pixel between each character.  I’m not sure which one I like the best… and I played around with some colors and effects, so I might need to re-examine them later as a solid color.

Speaking of color, I went over to Kuler and checked out some different schemes.  Keeping with some of the colors from the sites I chose, I picked out the “2004” scheme, with  just very slight modifications:

portfolio color scheme

I’m pretty happy with that. Now I need to decide whether I want a dark-on-light or light-on-dark style.  And what do I want to include on the site and where…

Inspiration

Went through some sites with links to interestingly designed site.  Here are a few screenshots I captured.  Without thinking to much about them, I just grabbed ones that simply appealed to me. Next, I’ll try figure out why I like them…