The idea of this comic is that it's not worth spending dozens of hours (say, over a year) customizing your work environment in order to save just a few hours during that same time period.
There are other factors at play besides the wall clock time. It should be easier to maintain focus and stay in the zone. I like having a shortcut for everything I do on a daily basis so that it can become muscle memory.
Also, consider that sometimes your behavior will change in response to the optimization, for example you may run your tests a lot more often if they complete quickly.
Finally, not all of your time has equal worth. I find that I do most of my work flow tweaking during my downtime.
I think "rezoning time" is the same thing as wasted time. If I have to "zone up" for a task, and that part takes me 30 mins, while once in the task it takes me 15 mins, I figure I've wasted 30 mins.
As for different types of time, I fully agree. If I'm in a half hour between meetings for instance, and I can do some tweaking to simplify actions, I can claim I spent 30 mins on that, but, I can't claim I traded 30 mins of "productive" time for it. So if that 30 mins of work allows me to have a less disruptive action in a workflow, the amount of time that workflow actually saves is hard to measure, and may overall be well less than 30 mins, but who cares? Life is smoother, and it would have been 30 wasted minutes otherwise.
The "hit refresh to see CSS changes" is a big crime I've noticed on my (and my dev friends') time. My logic with my recent project is simple:
-You have a computer
-Computers automate tasks
-Automate all your repetitive tasks
There's obviously no one-size-fits-all here, but think outside of the box for your workflow. Add macros to your editor, use something like LiveReload or Brolink.vim (shameless plug) to reload pages, streamline your build process, heck, even use AutoKey if necessary. Point is, you're the brain, and the computer is your slave. You don't need to be doing petty work that your computer can do for you.
I run a local Ubuntu VM for dev, the terminal you are seeing is gnome-terminal running tumx. I have a cygwin X Server running on my Windows box (startx). I then ssh -Y into my Ubuntu machine to get a proper terminal allowing my to fire off gvim and other X apps.
On my mac laptop its a simpler setup, but same thing works I 'ssh -Y' into my ubuntu vm. Effectively giving me 3 monitors.
Thanks! Very interesting. Are you running the VM only on the Workstation and ssh into it from the macbook or do you somehow sync it to be able to work from home as well ?
I work from home so I am cheating :) Stuff lives on the VM but I have a second identical setup on the Mac just in case I decide to take it out somewhere.
While at home I ssh from the Mac to my Ubuntu VM. A huge advantage of Linux is that mvim will not run over ssh -Y but gvim will.
Cool, will play around with that on the weekend ;) Could the ubuntu VM run anywhere in the cloud or do you get latency issues with x11 forwarding over the net ?
I could also run the VM from the laptop and ssh -Y from the workstation or laptop locally to have a portable setup. But my Macbook Air is rather slow compared to the pc.
edit looks like latency is a major issue with X11 forwarding so i see why you do it this way...I guess for my purposes its easier to just use a complete Ubuntu VM to develop in and sync that between machines.
A really good read, however one of the points of waiting for an editor to load doesn't really make sense to me given the fact I use Sublime Text Editor and it loads instantly, I've never had to wait for it to load even when there are 30 tabs for it re-open. The liveReload plugin for Sublime eliminates the need of hitting F5 to refresh a page because as you make changes and save using this plugin the page refreshes: https://github.com/dz0ny/LiveReload-sublimetext2
Unless you're an old school Vim user, I see it as somewhat pointless to learn it in 2013 as a new user, considering Sublime can be just as powerful (support for shortcuts, mapping to compilers and script generators) we've got a better array of fast and feature-packed editors that offer Vim like power without requiring a read of a user manual just to edit some files and compile them to save a few mouse clicks. I can see why people who know Vim would never leave, it's a powerful and besides the self-satisfaction of mastering a highly complicated editor, those I know of who use it can code like the wind. It's amazing seeing them racing about the keyboard doing things I do in mouse clicks with sometimes long keyboard shortcuts they just know off of the top of their heads.
The bane of my existence used to be documentation, but through a few simple self-disciplined changes I ensure that I document every variable, class and function so I can automatically generate documentation (well most of it) without wasting hours documenting hundreds of lines of code and files.
The article raises some very good points though. The smaller things like waiting for a project to compile, waiting for your browser to open, compiling your LESS stylesheets, refreshing your browser and heck even leaving your desk to make tea and coffee all add up when you tally the time up times a 5 day work week and are things we really don't focus on.
Even coming from .NET/VS, I don't see why opening an editor was a big deal. You do it once day/week when using a big IDE. Having a quickly opening text editor matters more when editing one-off files. And a .NET workflow doesn't involve opening single files. You work on multiple projects in a Solution that you waiting for 20 seconds to open when you started your work week/day.
Ah, of course. Well in that case, I can see why Vim is a massive upgrade compared to what he was used too. Sort of reminds me of a time when I used Eclipse for a while, horribly slow editor that tonnes of people used to use (still used widely for Java development, specifically Android).
VS is really neat if you're doing C# dev, but yeah slow as heck to startup. It takes nearly a minute from a cold start on my windows dev machine, and 30s on warm start (has recently been closed). And this machine is a beast.
Its a fair point, sublime is an awesome editor, in fact I use it sometimes when I need to search through the project cause I very much like its search feature.
I can't put my finger on exactly what, but when I was using sublime even in vintage mode it just did not "feel" like vim, that and the missing plugins, rails.vim is a masterpiece as are most of Tim Pope's plugins.
> waiting for an editor to load doesn't really make sense to me given the fact I use Sublime Text Editor and it loads instantly
I just timed it here on Windows; 5 seconds to load with 2 unsaved tabs open. That startup time of Sublime Text Editor is the bane of my life, a long time when trying to hold a thought in my head I want to jot down.
I wonder if maybe your plugins are slowing you down? 5 seconds is an awful lot, mine comes up in under 2 seconds with 7+ tabs on a pretty weak corp Windows box
It seems like these trivial inconveniences could largely be avoided in non trivial broader ways. For example what is the need for having so many javascript and css assets when in Rails we are meant to use the asset pipeline by default? In this case it seems like it would make the most sense to utilize the asset pipeline, more so than most applications. Merge all those together, serving up 80 separate assets is insane. Isn't it?
I don't understand mapping the keyboard shortcut in Vim to reloading all browsers. Does that reload all tabs in all open browsers? What if I have a paused youtube video, or am saving my place in a large article that I am scrolled most of the way down the page. Doesn't that all take longer to fix than just going to the browser and hitting the keyboard shortcut in the browser? Since you're going to the browser anyway or else the reloading would have been meaningless?
The most obvious time sink that I can see from this article is that the tests are poorly optimised. But that isn't a trivial inconvenience. Having to wait 3 minutes, twice, every time you make a change in the code is a significant inconvenience. That should give plenty of time to do things such as reload a page. Designed properly tests are not meant to depend on one another just to run. Use minitest, use fixtures and fabricators. Test individual classes, test controllers, avoid full stack tests unless there is something that can't be tested about it at a lower level.
As others have said also Vim is a powerful tool but there isn't really very much it can do that a modern graphical text editor like Sublime Text 2 cannot... I'm sorry I am just having trouble making this article resonate with me. Is it something wrong with me or am I right?
> Merge all those together, serving up 80 separate assets is insane. Isn't it?
That's what happens by default when using the asset pipeline when in the "development" environment, it's supposed to ease debugging and works well when only including a few JS files. In "production" all the files would be merged into 1.
There is a flag "config.assets.debug = true" in the "development.rb" file, switching that to "false" will output just one file.
Which, sadly, we've had to do in development as something has been introduced into Rails or sprockets that makes our development environment so slow it's unbearable with asset debugging enabled.
It really hurts not having the ability to dive into the separate files.
"serving up 80 separate assets is insane." in production it certainly is, we minify, concatenate and use a CDN. In dev if you concatenate and do not use source maps you compromise your debugging experience.
The "refresh all browsers" is only refreshing browsers pointed at my local dev Discourse instance, youtube is safe. I run a multiple monitor setup, I press a key and see right away the effect of my change.
We use fixtures and fabricators, we test individual classes, we mock and all that jazz. I am totally open to PRs that simplify and streamline our test suite, the point though is that now I am never blocked on my test suite in dev despite a full run taking 3 minutes.
"Vim is tough editor to pick up, especially late in your career. It is notoriously difficult to master."
Bull. I started using emacs when I was 18 and switched to vi at the age of 40.
The reason I switched was the I found many difficulties when I was using emacs on one hand and mouse-based editors on the other. One problem is that you can't easily cut-and-paste out of an emacs window because of the continuation characters. Another one is that if you use emacs and Windows editors, you'll end up confusing ^X^S with ^S and wind up typing the wrong thing into the wrong window.
You can get started with vi if you know the arrow keys, switching in and out of INSERT mode, as well as :wq and :q!. If you're using putty, visual cut-and-paste works great.
Learn how to use / and you're cooking with gas. I keep an old Unicos vi reference card around so I can gradually learn "dd", "G" and other useful keystrokes. But I was productive within 10 minutes of switching to vi.
He mentions switching to Share Mouse, after struggling with Synergy. I've been using Synergy with Mac, Win, and Linux for years. It just stopped working for me and I've been struggling to make it work. Over the years, it's broken every around once per year, and clipboard support has often been flakey in some directions. Anyone have experience with Share Mouse?
Excellent article and nice answers to queries, Sam!
I have one question. How were you able to manage a 23.5 ms time in the mini profiler over Internet? Were there no database queries involved while rendering that page?
Your website does load fast, no doubt about that.. :)
First paint is 380ms in which is not too bad considering my ping time to the Linode is 250ms (even though http keepalive is helping me cheat in this screenshot)
I follow, however, I really want to run all the tests when I kick off the test suite or recover a failed test. It is critical I have the ability to interrupt these huge runs at will (and resume the big testing when my urgent testing is done)
Any concern with running Ruby 2 in development and 1.9 (presumably) in production? I'm doing it now for the startup time boost in both console and thin but worried I'll inevitably introduce some code that will not play nice.
This issn't Sublime specific, but will work with any text editor on OS X: http://livereload.com/. It works really well. I used to use it before moving onto PyCharm/WebStorm, which has the feature built in.
Obligatory XKCD on this topic.