Tom Ryder on shell prompts:
You can tell a lot about a shell user by looking at their prompt. Most shell users will use whatever the system’s default prompt is for their entire career.
Should we be asking job candidates for their dot files?
Tom Ryder on shell prompts:
You can tell a lot about a shell user by looking at their prompt. Most shell users will use whatever the system’s default prompt is for their entire career.
Should we be asking job candidates for their dot files?
Nelson Minar has a nice, short writeup of the Linux kernel bug that caused servers to spin out of control yesterday. Most initial write-ups blamed Java, but that was incorrect. Interestingly, Java not only accounts for leap seconds, but also mentions them prominently in the documentation for the java.util.Date class:
Although the Date class is intended to reflect coordinated universal time (UTC), it may not do so exactly, depending on the host environment of the Java Virtual Machine. Nearly all modern operating systems assume that 1 day = 24 × 60 × 60 = 86400 seconds in all cases. In UTC, however, about once every year or two there is an extra second, called a “leap second.” The leap second is always added as the last second of the day, and always on December 31 or June 30. For example, the last minute of the year 1995 was 61 seconds long, thanks to an added leap second. Most computer clocks are not accurate enough to be able to reflect the leap-second distinction.
As Nelson notes, time is complicated. Further evidence of this fact is provided in Noah Sussman’s post Falsehoods programmers believe about time and his followup.
I enjoyed this coding manual prepared by University of Chicago economics professors Matthew Gentzkow and Jesse M. Shapiro for their research assistants. It’s a great short manual on how to code for clarity and performance. Considering the vast amount of really bad code that is produced in academia, it’s nice to see a focus on this sort of thing from professors. I especially enjoyed the parts where they give professional software developers too much credit. For example, here’s an assertion:
Real programmers write “unit tests” for every piece of code they write.
Would that that were true.
When Twitter launched “new Twitter” in 2010, a lot of people decried it as a bad idea. The big change was sending every request to the site to one URL, which hosted a JavaScript application that requested the appropriate data and then converted it to HTML within the browser. Here’s Tim Bray explaining exactly why Twitter’s approach was wrongheaded.
About a year ago, Twitter platform engineer Dan Webb wrote an article rejecting hash-bang as well, which made it pretty clear that Twitter would be moving away from this architecture.
Today, Dan Webb has posted an official announcement that Twitter is dumping the “render everything in JavaScript” approach for performance reasons:
Looking at the components that make up this measurement, we discovered that the raw parsing and execution of JavaScript caused massive outliers in perceived rendering speed. In our fully client-side architecture, you don’t see anything until our JavaScript is downloaded and executed. The problem is further exacerbated if you do not have a high-specification machine or if you’re running an older browser. The bottom line is that a client-side architecture leads to slower performance because most of the code is being executed on our user’s machines rather than our own.
It feels good to see terrible ideas die, even when it takes awhile.
Last week Noah Sussman gave a talk and said that developers should ideally program in an environment that resembles as closely as possible the environment they’d use if they were programming just for themselves, because that’s most likely to be the most productive approach.
Usually, I start with something at least a little bit new every time I build a new application, because there’s something I want to learn. So I’ll try a new framework, or a new language, or a new something, just so that I can pick up some new skills in the process of building something.
Noah referred to this approach as naturalistic programming (I think). It made me think of what naturalistic programming is for me. Right now if I’m building an application from scratch, I use Ruby, Sinatra, Bootstrap, and jQuery. For the view layer, I use plain old ERB. For the database, I use SQLite as long as I can, migrating to MySQL if necessary to scale. If using an ORM will save time, my choice is DataMapper.
Any or all of those choices may change next week, but that’s what hits the sweet spot between getting up and running fast and having the flexibility to scale up for me right now.
And interestingly, I think I would make the same choices even if I were starting a new company tomorrow. When you build an application that is going to scale to a large number of users, you’re going to wind up rewriting all of it in phases no matter what. You might as well start out focusing on maximizing productivity and replacing components as they break down.
One of my favorite technology trends of the past few years has been the emergence of engineering blogs. They are, mostly, a recruiting tool, but that doesn’t mean that you can’t learn a lot about how companies operating at varying levels of maturity and scale go about their business. Here are the engineering blogs I’m following right now:
What sorts of things are companies publishing on engineering blogs? Here are a few examples of particularly good engineering blog posts I’ve read over the years:
This is just a small sample of the great stuff that companies are posting to their engineering blogs these days.
If you know of any good engineering blogs that I’m missing, please post links in the comments.
Update: Added a few additional blogs suggested by @mrtazz.
Update (March 6, 2013): Added the NPR News Apps Blog.
Update (May 10, 2013): Added Kickstarter’s Backing & Hacking blog.
The most awesome story I read yesterday was trial coverage from Oracle’s lawsuit against Google over Java and Google’s reimplementation of Java for Android. Here’s the judge explaining to Oracle’s attorney (famed litigator David Boies) why Google had no incentive to copy the code they were alleged to have copied:
I have done, and still do, a significant amount of programming in other languages. I’ve written blocks of code like rangeCheck a hundred times before. I could do it, you could do it. The idea that someone would copy that when they could do it themselves just as fast, it was an accident. There’s no way you could say that was speeding them along to the marketplace. You’re one of the best lawyers in America, how could you even make that kind of argument?
As folks like Ray Cromwell and Mike Loukides point out, this is the best refutation I’ve seen for the argument that people shouldn’t learn to code.
As a software developer, I’m thrilled that Judge William Alsup learned to code at some point, and that he’s doing some programming to help evaluate the evidence being presented in court. It’s common to see people making policy decisions, legal decisions, and business decisions that wind up being terrible because the decision makers lack the technical knowledge to even solicit good advice.
As I said yesterday, I welcome anyone who wants to dive into programming.
Jeff Atwood wrote a provocative blog post entitled Please Don’t Learn to Code that I wasn’t going to respond to because it looked a lot like trolling to me. What I think, though, is that Jeff is conflating the suggestion that people learn to program with the suggestion that everyone should be a software developer. In the end, though, the post is just a mess.
I’m not for falsely equating programming with essential life skills like reading, writing, and math, or with the things Jeff suggests people spend time on instead — learning how things work at a “basic level” or becoming better communicators. That said, I would encourage people to learn to program for a number of reasons.
The first is that much of the world is run by computers. Learning to program involves learning how computers work at a more basic level. Even just knowing how the Web works at a technical level is helpful, if only to know if something is broken on a site you’re using or on your local computer.
In some ways, the relevant analogy is to auto repair. Knowing how your car works and how to fix some things doesn’t make you a mechanic, but it does make it less likely that you’ll be stuck on the side of the road with no recourse other than roadside service, and also helps to ensure that you won’t be exploited when you have to deal with a mechanic.
There are many people out there who work with software developers who are not themselves software developers. Understanding how to program makes it easier to communicate with them.
The second thing is that learning a little programming can make you better at your job if your work involves using a computer at all. Here’s my favorite programming story of all time. I used to work with a software developer who started her career at a chicken processing plant in Arkansas. She started not as a programmer but as an administrative assistant. Back then, they didn’t do word processing, they typed on typewriters.
Even though she had no formal training as a programmer, she figured out that the electric typewriters they used were programmable, and learned how to program them to complete various forms rather than typing them in by hand. Her boss noticed her good work and had her learn how to program another computer they had in the office. Eventually, he encouraged her to quit and go back to school to become a professional software developer.
Had she not been a smart and curious person who figured out that programming would make her job easier, she may still be working in that chicken plant. Today programming is now a more fundamental tool of automation than it has ever been. How many people could eliminate redundant work if they knew how to write scripts to collect data for them and schedule them to run nightly? How many people struggle with terrible Web applications that could be improved with user-created style sheets or Greasemonkey scripts? Programming empowers you to remove annoyances from your daily life.
The third reason is that learning to program teaches you a different method of problem solving than most people are familiar with. Learning to program teaches you how to break down problems into familiar components and then meld those components together to create a solution. Programming is not the only way to learn those skills, but it’s a good way to learn them, and that skill is widely applicable to every day life.
I wouldn’t make the argument that we make programming courses mandatory in school, or that everyone should learn to program, but I would encourage anyone who has the slightest interest in programming to pursue that interest.
There’s a lesson for software developers in this paragraph:
I did all my email work in that one “legacy” tab, marveling at how much I preferred it to the new-look Gmail that was the only option in any newly opened tab. I carefully “slept” the machine at night rather than shutting it down. I cancelled any software update that required a system reboot. I worried about what would happen if I unthinkingly closed the tab. It was my living connection to happier days.
That’s James Fallows, explaining how he attempted to keep using Gmail through the old interface.
For a long time, I was shocked by blogs like Etsy’s engineering blog, Code as Craft. I had a sort of old-school “information is power” mentality that led me to believe that letting competitors know about your technology stack would put a company at a disadvantage. Building scalable systems is hard, and I thought it was foolish to give away your secrets. I also prided myself on being able to sleuth the details of a company’s technology stack using URLs, HTTP headers, and page source.
I have long since come around to the opposite point of view, but general attitudes about this stuff hasn’t changed much once you get past the most progressive organizations. Stephen O’Grady explains to the recalcitrant why hiding your technology stack is a bad idea.
The other day I said on Twitter that all problems are user experience problems, except for scaling. And the solutions to those problems are generally so complex and so specific to a company’s product, staff, customers, and existing code base that slavishly copying one’s competitors at meaningful levels isn’t really possible. At most, what you usually get is an idea of what to try next, or issues you may run into down the road.
The advantages of sharing are real, and the disadvantages are an illusion. Go forth and start an engineering blog.