So busy these days
It's been a long time since I've been doing this much. At least, for work. Today was my first day 'off' in almost two weeks, mostly because of the Midwest PHP conference and us being really busy at work. It's been nice, but hard to stay focused. Here's my take on the conference and some of what I'm thinking about moving forward.
There's a lot of really good information in this post, plus a bonus tip if you are looking to speed up your responsive web development!
Work, work, work
We've been doing a lot more big projects at work lately. Or maybe that's just my perception. It does seem like we are doing more intricate stuff, that takes a lot more thought and time to create. Nearly all of our new sites have been responsive lately, too. I'm liking it, it's good to have work and challenging projects.
It's leading to a lot more re-useable stuff, too. The new package per site process that I've used on the last two sites has been working out great, and I think that it's going to help out a whole lot more on sites going forward. I want to document it and make it available to everyone, but it's really hard to get the time to actually do that. But the fact of the matter is, when I used it on the second site, the actual dev time was about 2/3 of the prev site using it. That's a pretty big jump. Almost all the parts of it are also re-usable, as well. So site #3 will be faster still. By site 12? I have the feeling I might not be writing much code at all.
There are a couple things that I've figured out that aren't actually documented anywhere on the net, as far as I can tell. Not c5 specific, but responsive specific, and production specific.
Super Extra Awesome Bonus Tip :
The biggest time saver between the two packages/themes? Don't do your media query adjustments all in the same file. Put them all into different style sheets, starting with a 'base' and then moving up based on em breakpoints relative to 16px, named for the actual pixel dimension of the view port. So a bunch of @import calls. Even if I consolidate them all when I go live, having them in different files during production offers a lot of benefits.
I'm also breaking up the files into a bunch of commented regions. This means that when I go to move from desktop or phone (whichever is the base design) to other screen dimensions, I can keep the two files open side by side in my IDE. A ctrl+f can jump both documents to the same point. Then I can see exactly what styles I need to copy in order to do the overrides that I need to the new break point. There's no duplication if it's not needed. With prior sites, I kept everything in the same css file. So you would be jumping up and down several thousand lines in the file to get between the breakpoints. So if you copy styles for the navigation, you'd have every rule. Then you'd delete what you don't need, but to check you'd have to scroll back up, then down.
Really, it's horribly inefficient. And efficiency with repetitive tasks is what I'm really all about. It's also very prone to errors and bugs trying to diagnose things.
On the second site that I did with the package starting point, there were a lot more questions on the front end about the design. But in the end, it went faster. And it was also smoother, if that makes sense. I knew before I wrote a line of code exactly what I was going to write. That felt a bit off to start out, when I was unsure on some of the details about blocking. But I got the desktop version looking how it needed to be with the markup I though would work for all. Then when I went to adjust it, it all just slipped into the new views like butter. There was very little adjustment to the DOM from what I originally thought, and even the changes to the css were very minimal compared to the last one. I haven't counted, but I would guess that it was 3-5000 lines of css shorter to make a better, more solid theme. I think the final 'adjustment' css file only had 3 rules and 19 lines of code. It was a honing process, not a modification process.
It's pretty amazing how little things like that can end up saving you hours and hours. Sometimes I wonder a bit if I'm in the right place. I love my job and my shop, but a lot of my strongest analytical skills can't really be applied until they're working on a factor of 10 or 100 more than what I'm doing, for both devs and projects.
I'm working on changing my hours a bit, too. It should help a lot more for being able to take time and actually analyze what I'm doing instead of just banging out code. I'm doing 4 days a week now, with 2 in the office and 2 at home. The two at home I'm doing 10-11 hour days and then going 8.5 or so in the office. I'm still hitting the same billable (actually a bit higher, looking at the logs) but it gives me 3 days a week to work on my own stuff, to work on distilling things down to be more generic, and to get stuff done around the house, cooking, cleaning, etc.
Of course, that's not always how it works. Last week, I was supposed to be off Friday but it turned out that I'd missed a bunch of stuff on one section of a project, and still ended up spending most of the day working on it so they could go live. We've actually gone live with I think 3 news sites in the last 2 weeks, plus a couple mods to existing sites and other sites that we brought in for just hosting. Business seems to be going really well, which is great.
Learn Learn Learn
After ending up working most of Friday, I spent the rest of the weekend attending the Midwest PHP Conference with everyone else from work. It was really a pretty eye-opening experience. I haven't really done anything like it before, and it was great to get that much insight into things in such a short time. I probably should have brought a laptop, but instead I took about 42 pages of notes in a 6x9 notebook. I'll try to get a full review of what I learned up, but here are the classes I checked out:
- Getting Acquainted with MongoDB
- Beyond PHP
- Enterprise PHP Architecture
- Symfony2 and MongoDB
- Refactoring 101
- Don't get STUPID, Grasp SOLID
- Data Aggregation with MongoDB
- Caching and Tuning
- Building Testable PHP Applications
Yeah, that's a whole lot of information in not a whole lot of time.
Overall, the event was pretty awesome. It was in the same place as the Overnight Web Challenge a few years ago. This time I got there by bicycle, since I wasn't bringing a desktop with two 24 inch monitors.
IT WAS SO NICE TO BE ABLE TO RIDE WHERE I WANTED TO WHEN I WANTED TO WITHOUT PAIN !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Seriously, it was. Not far, only like 4.5 miles from home, but I did it. And then I went out after. It was 13-15 miles on Saturday! That was the longest I'd ridden in forever. So nice to not be relying on others for my own mobility.
Anyway, the biggest thing that I came away with from it was that I'm really on the right track in almost everything that I'm doing. From what I could tell of the numbers of hands raised on different questions, I'm not stuck with a lot of old problems that other devs are. I guess it's good to have only been using php for 6 years or so, rather than being totally tied into it for a long time. I don't have bad habits to unlearn.
There were a lot of things that they were saying were the 'right way' to do stuff that I found myself already doing. I wasn't quite as abstract as the enterprise architecture class would have wanted, but the overall ideas about how to approach the objects and inheritance I'm completely doing right. And the patterns described were things that I've already kind of been mapping out in my mind intuitively, so seeing it confirmed as not me just coming up with crazy ideas out of my ass was a great feeling.
Thoughts on the classes
But with the aggregation class, it's become clear that this is a technology I want to learn more about and try out. I might start making some crazy data mining apps just to make them. I don't know. There's just so much potential there, I really want to figure out how I can incorporate it into my own ideas. I think that another couple of years of dev and it's going to be a really popular platform.
Beyond PHP + Caching and Tuning
Learning to look at what might be making an app slow outside of php was pretty enlightening, too. It's totally possible to kill yourself trying to save yourself. You have to start looking at every component in the system to really fine tune everything. A lot of the Beyond PHP and Caching sessions were above my head, but it was still good to start thinking about it. I have the feeling that if we had some customers that were willing to pay to set up dedicated servers for them and actually analyze all the traffic to make it as fast and as scalable as possible, I'd know where to start looking and what to ask from our server admin.
Refactoring was very interesting. The whole idea of how to approach updating your code was very familiar to me. It's pretty much exactly how I've been working on the stuff I do at Hutman. There's a lot of code that gets re-used between projects. The designers that we work with will often do things like have 3 real estate clients or health care franchises or whatever at a time. So what works on one works on the others, and as far as the IA and UX goes, basically it's just a matter of changing some chrome. It means that our process for coming up with new versions is not a 'use it until it breaks, then overhaul it all' mentality, but one where it's like 'well, the last two did it this way, but now if we move x and y around, it will be much better for z when we do the next five.'
There were still a lot of good ideas for how to do things, especially when it's not your own code that you're fixing. We've started getting a lot of work lately where it's sites or turnkey apps that are really custom, heavily used, and not really written with good standards for concerete5. Honestly, I'm not sure if a lot of them are even good coding for standard PHP, I don't actually think so. But the way we've approached updating them, how we've worked through upgrades, etc? It was all pretty much right in line with the stuff that Adam Culp talked about. Little things, like don't refactor to make it faster. Refactor to make it cleaner, easier to read, easier to understand, easier to update. AFTER that you want to get into making it faster.
I also thought it was cool that he was an endurance athlete, a distance runner. By distance he means 100 miles or more. It reminded me of a bunch of my friends, I asked him between a few sessions if he rode a bike and he said no, I felt kind of bad that I didn't have any personal running experience to fall back on. That's something I should probably work on, I really do need to focus on actually being healthy in more ways than just being able to hop on a bike and ride it forever. There's more to health than that, and I need to start thinking that way.
STUPID vs SOLID
This was another one where it was more reinforcing that I might actually know what I'm talking about. You can get an overview of the thought process over on github. There are some things that I do that fall under stupid, but a lot more that's in the solid realm. I liked the idea of the "Rule of 3" - if you copy and paste something 3 times, it means that you should look at how to abstract and re-use that functionality. I spend a ton of time copying and pasting. Often it's more copying and pasting the same function calls, like for outputting a bunch of form fields based on page attribute objects. So I'm copying the function call, then replacing what elements are passed in. Couldn't I modify that to have an associative array that is looped over, then call the function with each of the elements in the array? Seems like it would be much cleaner and easier to maintain, update and read.
Another thing was children being able to replace the parent. But you have to make sure that you replace correctly. A child will take a wider range of inputs, and output a tighter object than the parent. Anthony Ferrara actually ended up showing me a better way to describe it after all the rest of the class had left. He was all "It's like a funnel, the parent is narrow at the top and wide at the bottom, the child gets wider at the top and narrower at the bottom, the grandchild gets more specific..." And then he drew a diagram on the whiteboard. I think it might be included in his next talk on it.
This was really informative as well. Chris Hartjes was really entertaining as a speaker, and it was pretty refreshing to actually hear a speaker swearing and not really caring too much. A lot of it was beyond my skills right now, but I think a lot of that is the fact that I'm using a CMS and not just building my own apps. So figuring out how to build scaffoldings and mocks and all of the other things that go into creating a proper application that can be tested are all really hard to do.
But it did give me a lot of ideas. I think there are ways that I could make a 'test' class that would simply process a test and then run it against other objects in concrete5 to make sure that they are working properly. And just the way you have to think about testing things influences how you build them. I think if it weren't for the fact that the rest of the CMS has to be loaded, I think that all of my functions can be tested properly. I mostly run through each of them with every parameter that I can think of before deploying, but (as was a common joke over the weekend) we all test in production. Especially with a shop as small as mine, it's somewhat unavoidable. You do your best to test everything and then send it back to the client, but there is very often something that doesn't quite work, or changing one thing will break another that you don't know about.
This is probably going to be a focus, once I have a solid framework for making production faster. Once we can cut some of the more time consuming elements through replication, figuring out how to run automated tests will be a very useful thing to bring into our production environment.
The Conference Overall
Like I said, I haven't really done much of anything like this. So it was pretty interesting overall for me. One thing that I really noticed was how much more attention that I should be paying to twitter. I tend to just chill on facebook and publish posts there to twitter, mostly out of laziness. And a few bad things about twitter from back in the bikelove days are probably to do with it, though honestly, I was hardwired from my brain directly into several sites back then. The real time stream was kind of like an attention sucking drug, I had to know every single thing that was happening everywhere at all times. It kind of sucked, but it was also really great for getting my brain to explode ideas.
But... I knew that most of my facebook friends would have absolutely no interest in the type of posts that I was going to be doing for those two days. So I used the #midwestphp hash tag and posted stuff I thought was interesting when I wasn't busy writing everything down longhand.
It was a really good idea to switch platforms. I ended up with a lot of new followers and also a lot of new people to follow after the weekend, and a lot of them were skilled local people. Several that I also met in real life as well as exchanging tweets. As a networking tool, it seemed like a really great thing. Really. If you know me at all, networking is probably my least developed skill set. If you're thinking about attending a conference like this, or sending an employee to one, it's one thing to think about that might help justify the cost. It was a couple of hundred dollars for the tickets, but it will more likely than not bring back rewards many times that. I found myself really wishing that I had business cards several times.
A lot of people were interested in concrete5, too, outside of twitter. Most that I ended up talking to about it for awhile had at least heard of it. Many had looked at it a couple years ago, and hadn't seen it recently. One person I talked to who took my email was a nearby dev but with no connections to others using it. Another had worked for some really large local companies and was doing his own thing now, but was really interested in hearing more about it.
I honestly felt a lot like I did back when I was doing bikelove. Going to a conference where I feel like I'm going to be way outmatched by everyone there, that I'm just an upstart. Because I have no real education besides what I've taught myself. Because _(1)_. Because _(2)_. Because _(n...)_. But when I look at what they were actually saying, I realized that I wasn't totally off base. I actually knew what I was talking about. I actually understood what was being talked about in very deep and insightful ways, beyond just comprehending it. The information was sparking the connections and the extrapolations that are the curse and the blessing of my bipolar.
And I was totally being an evangelist, trying to say why what I am using / doing was so much better than the other models. I'm not sure that I always got that across, but it was still the same internal feeling to myself, and that was very nice to have again. When I was doing bikelove, just meeting anyone on the street who was on a bike I'd talk about the site. I'd try to get them to check it out. I'd tell them about the features, and they'd offer doubts, then I'd be like "Well, do you ever ____? Do you like to _____?" And start trying to figure out what their needs were, and then tell them how my tool would help them achieve those goals.
Of course, it was exactly the same as it was back then. I wasn't trying to sell myself at all. I was trying to sell the idea.
There was even one moment where it really came home. I'd talked to someone I shared a table with for lunch about c5. Didn't really think much of it, but we were talking later after another conference and then I found out that he actually knew about mplsbikelove.com and even tweeted about it! I didnt' think that anyone would know any of the stuff that I'd done, and yeah, it is just Minneapolis and not like it was a conference in Amsterdam knowing about it, it was still pretty nice to have that recognition. And to know I was doing basically the same thing I did back then again, which means it has to work, right?
The interactions with people about concrete5 did make me feel pretty good about my future as a programmer. In this business, if you bet on the wrong thing and put all your eggs in that basket, you can really get screwed. Most of my eggs are in the c5 basket. But looking at it compared to other stuff, I feel like it's probably the best basket to be in. And I'm now learning that my front end and back end skills are both a lot better than I thought they were. Not just in knowing how to write the code, but in knowing how to maintain the code. In knowing how to push the code live. In knowing how to troubleshoot. My base of skills is really wide, too, even if it is just in one CMS/framework. It's not just working with databases, it's full front end skills, it's creating intricate editing interfaces for the front end display, it's figuring out what the best way to do things is and helping our clients to find the right solution the first time.
I'm not really sure. I know we're going to stay busy at work. There's pretty much no way that's going to change. We're already booked out through April, and there's a lot more that's going to be happening later on.
I need to get more time to ride. It has been so good to be able to again, but I have a lot of pounds and inches to lose. Start learning to actually do my programming on my laptop more often. Actually, writing this post on the laptop with mint has been very nice. The first time in probably two months where my left arm didn't hurt a LOT from typing.
That's honestly the biggest thing that's scaring me right now. My wrists and hands have been hurting me a lot, I'm getting way too focused on simply one activity. Coding and writing, using fingers to create text. That needs to change. I need more activities, or different ways to remind myself to break up the routine.
I really want to update the format on this website, too. It's honestly really hard to use it anymore. Sure, I'm updated to 22.214.171.124 or whatever, but still, it's an install based on 5.4 something. The first pages are from 2010. The ideas on how to make themes and store content are also horrible. Presentation and data hierarchy are not thought out at all...
So yeah, that's part of what's on the horizon. For the rest, I don't really know. I think I have a ton of marketplace ready ideas, just not time to create them. I've thought about maybe doing a kickstarter or something offering people licenses on what I develop in exchange for enough money to live for 6-8 months and bang out a really extensible, interconnected suite of addons that would make any concrete5 shop's life much, much nicer.
And yeah, I just realized it's like 12:40am now. So next steps for tonight seem to be brushing teeth and fluffing pillows. :)