Wednesday, October 22, 2014

Dead To Me! DomNomNom

DomNomNom was a toy templating tool for front-end web applications I built during a long ride in the passenger seat. The idea was to build a templating system that required minimal, and in many cases, no template at all. I wanted to see if it was possible to map data directly into markup structures based purely on semantics.

For example, instead of some mark up that rendered a title into the page like {{ title }} we might just map the <h1> tag to the title in the data binding.

$(“body”).domnomnom({
“h1”: “This is the title”,
})

And it was really easy to get this basic setup in place quickly. I began to take it further. I allowed mapping lists of data, which would clone an element instead of simply inserting the text contents into it. Suddenly I could render tables and lists with ease.

“ul”: {
“li”: [“one”, “two”, “three”]
}

And the markup’s original <li> would function as a template to clone for this content. It was very clean to write templates for, because they were just mark-up with dummy data and content in them. This meant a designer could build the templates with whatever tools they wanted and the data could just get pumped into it.

DomNomNom in its final state supports mapping syntax that can handle attributes and properties, so you can map into form fields and the like. There are also controls capable of changing the order cloned elements are inserted and allowing the clone templates to be controlled better. If I removed the empty lines for formatting, the whole thing would come in under 100 lines of Javascript.

I built this on jQuery, but if I re-did this based on modern browsers with querySelector it probably wouldn’t grow by more than a dozen lines, and would be a lot faster.

Check it out, if just to see.

Monday, October 20, 2014

The Problem with Coders' Technology Focus

Coders focus on code. Coders focus on toolchains and development practices. Coders focus on commits and line counts. Coders focus on code, but we don’t focus as well on people.

We need to take a step back and remember why we write code, or possibly re-evaluate why we write code. Many of us might be doing it for the wrong reasons. Maybe you don’t think there can be a wrong reason, and I’m not entirely sure. What I am certain of is that some reasons to code lend themselves to certain attitudes and weights about the code and other motivations might mandate that you take yourself more or less seriously.

We’re taking the wrong motivations seriously and we’re not giving enough attention and weight to the reasons for code that we should.

The most valid and important reason we can code is not what hackers think it is. A good hack isn’t good for its own sake. No programming language or tool is inherently better than another. The technical merits of the approach or of the individual are not the most important factors to consider.

Our impact on people is the only thing that truly matters.

Twitter isn’t great because they developed amazing distributed services internally to support the load requirements of their service, but because they connect millions of voices across the globe.

RSS isn’t great because it encapsulates content in an easily parseable format for client software to consume, but because it connects writers to the readers who care most about their thoughts and feelings and ideas.

The amazing rendering tools built in-house by the likes of Disney aren’t amazing because of their attention to physical based light simulations and the effort required to coordinate the massive render farms churning out frames for new big budget films, but for their ability to tell wonderful stories that touch people.

The next time you find yourself on a forum chastising someone for writing their website in PHP, pause and ask yourself why that was the more important question to ask them than “Does this fulfill something important to you or your users?”

When you are reviewing code and want to stop a merge because you disagree with a technical approach, take a step back and ask yourself if the changes have a positive impact on the people your product serves.

Every time you find yourself valuing the technical contributions of team mates and community members, make sure those contributions translate into enriching and fulfilling the lives of that community and your workplace, before the technical needs.

Nothing that is important can be so without being important for people first.

Sunday, October 19, 2014

Farewell to XMLHttpRequest; Long live window.fetch!

The days of XMLHttpRequest and weird choices for capitalization are numbered. WhatWG has a spec ready for some time now to replace it: window.fetch. Just look at how easy it is.



Just look at how nicer that is all with soon-to-be native APIs. But you don't have to wait, because there is a polyfill available. Start using the Fetch Polyfill in your projects today.

Thursday, October 16, 2014

I Want to Write More Often

I want to write more often. I’ve been writing more lately and I hope to continue that, and I think expressing why this is important to me is valuable so here is that post.

I want to explore my thoughts more concretely and have a record of how I came to my stands on the positions I believe in, and I want to keep track of the ideas for stories I have. Rather than have some bothering me constantly, I want to feel safe that I can forget things.

Writing ideas can also get them out of your mind. The act of writing about it can often free your mind from the burden of so many thoughts. You can be more confident in an idea, or let it go out of your mind now that you’ve written it somewhere safe and permanent.

I like the idea of turning my thoughts into essays. A thought is ill-defined. A thought is hard to grasp, even inside your own head. Thoughts are connections between so many points in your mind, but a well written essay is a single coherent position. It is a statement at a time and place that expresses a piece of yourself succinctly and I really appreciate that about writing.

Writing makes creative endeavours more accessible and helps keep my brain active and healthy. This practice of expressing thoughts in writing also gives you the practice in patterns of thinking that are better structured. The more of your thoughts find their way onto paper (literally or virtually) the easier they’ll come because your mind will learn to organize them better.

I’ve begun the practice of Morning Pages again after years of allowing the habit to lapse.

Morning Pages are three pages of longhand, stream of consciousness writing done first thing in the morning. *There is no wrong way to do Morning Pages*– they are not high art. They are not even “writing.” They are about anything and everything that crosses your mind– and they are for your eyes only. Morning Pages provoke, clarify, comfort, cajole, prioritize and synchronize the day at hand. Do not over-think Morning Pages: just put three pages of anything on the page…and then do three more pages tomorrow.

I use a version of morning pages called 750words.com which is a fantastic tool that helps you write every day by tracking your words (750 words is roughly three pages) and each month provides a challenge to fill every day with these words.

It has helped a lot. I start every day writing between 750 and 1000 words with as little pausing as I can. In this time I get lots of stressful and worried thoughts out of my mind, or get a chance to think harder about them and settle on decisions that have been bothering me. I begin each day by clearing from my head many of the distractions that would keep me from the things I enjoy and the things I need to focus on.

My work and my happiness have both improved as a result, I believe. I find myself focusing on work easier and I find myself able to enjoy my relaxing and hobby times, as well.

What is most interesting, perhaps, is how much more I have written in this same time. On top of writing every morning, I find myself feeling drawn every day to sit down and write even more and I do. I’ve written, roughly, 20,000 words in the last two weeks. And other creative interests have become easier, as well. I’ve been drawing and (digitally) painting more for the first time in years, and I cannot express how happy that makes me.

monsters.jpgmonsters_jpg___166___color_fill_4_copy__layer_mask_8___-copy.png

I hope that I do not let up on these changes any time soon.

Top Articles

Along the side of my blog, for many years. I've had a section called "Top Articles". I don't remember when I put it there, but I know that it included all of the most popular posts I had written at the time and I wanted to make them more prominent. They were obviously popular topics people wanted to find. These were the things I was writing about that people found most interesting or useful.

I haven't thought a lot about this list for a few years, until I just noticed it today. Top Articles is a time capsule. This was a snapshot of my interests and knowledge from a previous version of myself. It doesn't reflect me as well today. I'm equally interested in the things that no longer worth keeping on that list as I am of the things that are still very important to me.

I'll make a point to clean things up around here. What was on that list so long ago?


Of no surprise, I had a number of posts about Python which still draw a lot of new readers to this day.

And at that time I was spending a lot of time helping people on programming forums, especially IRC. I tried to help explain how people can better reach out for the help they need.

I was also starting to focus a little more broadly on how people learn to code and what we can do better.


I was starting to write less about programming itself and more about managing the world of building projects. My focus was also starting to broaden from just syntax and code to what we're delivering to the user and what they're going to do with it. Signs of the holistic approach to building software that I try to take these days already forming so long ago.


This blog was started in January of 2007. That's over seven and a half years ago, nearly as old as my son, who is a third grader. I'm sure the focus and breadth of my writing has changed since then, as have my opinions and focus. I'm sure over the next seven years they'll continue to do so, and I hope over that time I'll continue to write about it all.
I write here about programming, how to program better, things I think are neat and are related to programming. I might write other things at my personal website.

I am happily employed by the excellent Caktus Group, located in beautiful and friendly Carrboro, NC, where I work with Python, Django, and Javascript.

Blog Archive