Bloat.
Bloat
At least two lunchtimes this week, I have found myself in staunch debate with two of my work colleagues about a certain topic. I was reading the comment discussion on Hacker news on the Favourite Programming Poll and this again re-echoed a lot of the arguments with which I had vehemently disagreed with. The issue is IDE vs no IDE. Its age old, its open to all forms of flame war and trolling, indeed from both sides if not particularly from the no-IDE side.
The deafening sentiment of the majority on the comments which I have linked above chose C# as their favourite language. My problem is not with C sharp, its clearly a very good language, and although I have my problems with some aspects of it, mostly the lack of cross-platform native support. What I found most astounding that failing only a few who complemented its style and how it worked for them, the majority of people cited Visual Studio as the reason they love C#.
This brings me squarely onto the debate. I want to have on record why I work the way I work. We hear a lot of analogies about a workman and his tools, for me I think a programmers tools importance can not be understated and should be something they are proud and most of all happy to work with. With the correct tool, a problem can become trivial, but the same problem faced with the wrong tooling can become a nightmare. We see it very easily with certain algorithms that one algorithm will not terminate within ones lifetime, while the others can finish before we can even say the first letter of the algorithms name. For this reason, I think its important to be passionate about what you use, and have clear reasons in your mind why you use what you use.
My environment
Firstly, I'll discuss my preferences, what I like, what I would like and hopefully through this you can see some merits in the way I work. I am a programmer by trade, I deal with code almost all my working day. Right now, my job has me working with predominately python development, but my work-flow since I have had a job has been largely the same. In the back of my head, I can hear the comments that a different language should require different tooling. I disagree.
My work station is predominantly Linux, to the point (rather foolishly maybe) where I don't have access to Windows on any of my own machines. I have been using Linux as my main desktop for around 4 years now, and 6 months previous to that I played around with some other distributions on virtual machines. Damn Small Linux as far as I recall, because my Internet speeds weren't fast enough to download any bigger distribution.
Linux has its faults, my days as a zealot who denied these are beyond me, I now am enraged when I plug in a VGA/HDMI and it doesn't at least try to show something on the external screen. I don't like that multiple desktops can still cause a problem, and its also not a full solution for normal computer users who I find more and more rely on things like iPhones actually being able to sync without issue.
There is simply no substitute for Linux for me, Windows does the same things, but it doesn't feel the same. It feels laboured, it feels tacked on. I cannot work, or even leisurely use my computer without it. I would put forward to any developer that unless you are programming Microsoft specific code, you should be using Linux as some part of your working life. Whether it be on the server side, desktop or even buy yourself a cloud instance on amazon(first 12 months is free) and play around. There is plenty of Linux propaganda for you to read online, so I will not dwell on it, but it is the main component of my development environment, and the control which it gives me over my environment is next to none in my opinion.
As a programmer, my next obvious tooling is my editor. It is something which I am inappropriately passionate about. I use VIM. I use it a lot. I use it for everything (by this I mean for everything edit-based).
The only other real weapon I use is the command line and its assorted utilities. I love ssh, I love screen. Both of which I use every single day.If you are a programmer, how often do you use the command line? I was shocked to read someone in the same Hacker News comments gets through 90% of the time without it. Maybe it is a part of Linux development, but without the command line, I feel bare and completely powerless. There are a small number of areas where perhaps a GUI makes more sense, in terms of user interface, but for most things developer based, having a program as close to the command line as possible is usually a plus. Having something able to run from the command line offers up so many opportunities. Automating regular tasks with little to no extra coding (cron).
Perhaps you have very good reasons, or perhaps you are just new to it, and are not seeing all the excellent configurable power which awaits. If what you say when you see the command line is that it is an outdated piece of computing history which has been replaced by the GUI systems, please dive in, please get your hands dirty with some shell scripting, write some utility scripts. Become a unix hacker for a little while and delight piping ls' into greps into sorts into tr's. Dizzy yourself with page long one liners wrapped up in aliases.
That is it. That is my work environment. Simple, but nail-bitingly powerful.
Let me give you an example of why I love my above configuration. The flexibility is incredible. In work, I have around 3-4 VM's which I regularly have to ssh into and do some coding or administration work. I have a github folder which houses my configuration files. In less than five minutes I have set up my environment (bash and VIM). It is mine, it is how I like it, it has the quirks and the little bits and pieces which aid me every day. Everything is set up, bash behaves like it always does, vim has numbers on automatically as well as all my favourite plugins mapped to the same configuration. Thats from zero to setup in under five minutes on any UNIX machine. And that is just setup advantages.
But why don't I use eclipse for my main development, Am I any worse off? One thing I concede to the IDE is that in order to get VIM to a stage where it does nice things like generate tag lists for you, it can take a while. It takes reading or knowing someone who uses VIM. Having invested that time, to initially set it up, you get it on every machine you want, and also you get it personalised to you, the way you like it. A lot of articles cite this long learning phase which is involved with VIM, but for the most part I don't think this is an issue. For basic editing, you only need to know about modal editing and how to enter and exit insert mode. Remember this is the means by which you accomplish your work, if it means some time investment for a better experience that is worth it.
Another major win for me is that I have a lot of the "intelligent" aspects IDE's such as eclipse offer without the bloat. Vim starts up in an incomprehensible time. Eclipse last week started up in over a minute for me (That was the best, not the average start up time), It then tried to load a "project" for me, subsequently crashed my computer and had to restart. Many people think this is a non-issue as they leave eclipse open, let me say why I think having an editor which can open files in the blink of an eye is a good thing. Lately, I wanted to open all the files in a directory which contained a certain word or phrase.
vim -p `grep -rl "<some phrase>" ./`
Simple, but I would say quite elegant. I would like to note also that this is as much the zen of grep as it is of VIM, but the idea of UNIX as the IDE coming to the fore. There is an excellent series on this very topic can be found here.
Moving swiftly onto my next issue with IDE's, Code generation. With the exception of language to language compilation code generation, my views on mass code generation are largely negative. I watched a video about removing unnecessary classes recently which can be found here. In the video, the point is made that if we want to be sure about the external libraries which we use, we need to have read and understood their code. Although perhaps this is not practical, I think it definitely stands through for the case of code that is supposed to be apart of your code bundle. If you must generate code, read it, understand it, make sure its not doing anything evil.
IDE's encourage code generation for everything. They will happily spit boilerplate code at you until the cows come home. This leads to badly understood code by its own developers and developers who have effectively just patched loads of boilerplate together. While not always true, this technique will cause far less efficient performance. Many peoples arguments to this would be that this cuts development time drastically. I agree, in the short-term yes, What about when that development move on to "better" things, and some poor developers are left to maintain this structure. With hundreds of lines of code, the ability of a developer to understand fully even one particular section is highly unlikely. VIM discourages code generation, although I have used template plugins for generating HTML boilerplate or even some small things in certain files, hash bangs in python.
This week, I discovered there are GUI's for rest web api's where you point and click what you want and its all just generated. PLEASE NO. Write your own api's, use Ruby on Rails, Django, NodeJS & Express, use raw sockets for all I care, but please do not generate the majority of the workings of your api. You are a programmer, write your own code.
The other thing I hear constantly when this debate rages, Vim cannot autocomplete anything. This is wrong. By default, Vim (From version 7 onwards) offers autocompletition on words in the buffer, It also offers line auto-completion. These are incredible and a thing I use not only hourly when I'm developing but minutely. It is possible to get some form of "IntelliSense" which seems to be the key highlight for so many IDE's but again I have huge problems with this. If you are in the position where you are scrolling through options and auto-completing away your program, you are in the wrong place.
I think IDE's which feature such autocompletion actively encourage poor programming and poor style. If you are scrolling through object methods looking for one which "fits", you are doing something wrong, sit back, get a coffee and work out the best solution. In the comments that I mentioned above, someone put it beautifully, "I rue the day when you could say I built this project from a blank file". Vim encourages this, IDE's go out of their way to discourage this. This sort of mentality, although not fully possible for some projects, in my opinion, encourages good coding.
Written from vim, using markdown.
