Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free.

Sometimes we want to be more efficient and productive, what have you written to reach this?

share|improve this question

closed as too broad by MichaelT, Snowman, GlenH7, gnat, durron597 Aug 22 at 15:51

There are either too many possible answers, or good answers would be too long for this format. Please add details to narrow the answer set or to isolate an issue that can be answered in a few paragraphs. If this question can be reworded to fit the rules in the help center, please edit the question.

20 Answers 20

up vote 7 down vote accepted

First week of my new job (a couple years back) I wrote a utility to manage configuration settings in your local machine.config file. The config file is stored in source control, and you can select between different environments with a quick click. (local, dev, etc..)

I thought it was fairly shoddy when I wrote it, but it has needed almost no updates and several programmers at work still use it regularly.

I would say it made not only me, but also the whole team, more productive. :D

share|improve this answer

It barely counts as "writing", but having a large suite of email-management rules keeps me productive.

It also allows me to fearlessly sign up for a lot of notification by email, and to use my inbox as a todo list (because it's nearly always empty).

share|improve this answer

I often write launcher scripts that set me up to work on specific projects. For example, I have a part time PHP dev job that I work from home on my laptop, and I have a little script that will:

  1. Launch an isolated Apache/PHP stack (MAMP)
  2. Launch a bug tracker server (Fixx)
  3. Open a Firefox page to
    • The production version of the project
    • The staging version
    • The local version
  4. Open the code in TextMate

It doesn't seem like much, but I find myself much more inclined to work on it when it's only one icon-click away, and I find myself considerably more productive.

share|improve this answer

My company has a comment web client that we end up re-skinning for each of our clients. The re-skinning process took a very VERY long time.

I found a bog post about .less and how it could help with cleaning up the stylesheets we use. I spent a good amount of time cleaning up the web client and moving all our css files to use .less instead.

Now the re-skinning process takes one person about 2 hours to complete. It's pretty awesome. And it makes everything so much easier to maintain and support.

share|improve this answer

I can think of three that have been indispensable, I image most software team have something similar.

  1. Custom environment setup scripts. I primarily use cygwin as my development environment and we have multiple projects that sometimes require different environmental setups. We have s script that sets up the environment based on a project name.

  2. Build automation scripts. Fairly self explanatory, but we can build our entire product line. with one "click of a button".

  3. Daily build script. Builds our entire product line daily and organizes the builds by date. It also emails the results to all the of the developers.
share|improve this answer

Honestly, and most practically I seriously need to write something to solve the tracking notes as a developer problem.

If that doesn't make me more efficient, then nothing will.

Unfortunately, the one thing I DID write that not only made me more efficient, but every other employee for a large corporation is proprietary, so I cant even talk about it.. much less collect royalties.

share|improve this answer
You could hint what you did. Or is it that secret? –  user1249 Jan 7 '11 at 20:28

At my previous company we had embedded code that had to be loaded on SD cards to bootload the units. The files always had to have the exact same names and it was really easy to forget if you had the latest build on your SD card, so you'd always end up just rewriting the files before testing.

I wrote a simple program that used an MD5 hash and an XML dictionary of those hashes to correctly identify what was on your card and allowed you to hit a single button to update to the latest versions over the web. This turned out to be such a simple and effective program we beefed it up a little and then gave copies to our customers so they could update our units without having to pay a technician.

share|improve this answer

I wrote a SQL parser for use at work. It can be very helpful to write a program to find all stored procedures that insert into a certain table, and with the parser I can get a list of exact matches as opposed to using LIKE and filtering through the results.

share|improve this answer

I wrote a small python Tk utility for my couchdb work that allows you to ping a server and specify the server host, port, and url, and parses a simple homebrew markup language to send HTTP headers. It has a text box which shows the response, and if it receives an html response, renders it out using pythonWebkitGtk.

It's been amazingly useful for debugging my server code.

share|improve this answer

3 things, actually. The first 2 aren't actually the act of "writing" some piece of code, but more general tasks that have made me productive on jobs.

The third one is indeed something I wrote, but I consider the other ones more productive and think they brought more benefits.

So, here are 3 real-life examples...

Reusing Libraries

Apache Commons *, and Google Guava, for the most part, for Java Development.

I've quite often come across old code of mine or of my colleagues', and realized we could re-write hundreds of lines with a few carefully crafted lines. You feel like you're cheating at first, but with time you come to realize that clarity matters, and that less code means less bugs, and less bugs means less costs and less development, testing and support time and effort.

If you really need the performance, fine, re-implementing the thing exactly as you need it. Otherwise don't bother. But do pay attention to what it does in the background and benchmark it, read it up or look at its source code to make sure it doesn't do anything crazy.

The other nice thing with reducing your code footprint is that it then makes it easier to swap out implementations. Sometimes, the best productivity you get is by removing clutter and by just swapping an old implementation for a more modern and efficient one.

Revamping a Build System

Switching an ageing +8000-lines Ant build system for a Java that was written prior to Ant 1.6 (so using things that nowadays would be considered bad practice) to a fully-componentized Maven build.

Based on the checkout time (this project used to store dependencies on the SVN) and the compilation time for a full-build (sometimes over 35 minutes, and often necessary because of the bad modularization of the build), I estimated that I wasted 20 days (as in, 24 hour days!) in a year of work.

So we decided to do The Switch. It took a lot of effort and time, but it benefited the whole team:

  • building a separate component takes less than a minute,
  • building a full-system takes a most 15 minutes,
  • testing a full-system takes 1h (vs up to 3 before),
  • checking out takes only 1 to 2 minutes instead of up to 25 (and a local repository and a team repository alleviates the effort for Maven to download the dependencies after your first build),
  • plus the system now happily integrates with a bunch of quality tools we didn't have before, so not only did the whole team benefit in productivity, we also benefited in code quality on the long run.

Writing an SDK for the Team (and New Starters)

My idea was to reduce the time needed for a new starter between the first time they sit at their desk and the first time they can actually commit something. We wrote a development guide, but it was too big. So we wrote a new starter cheat-sheet, but it wasn't guiding enough and didn't cover all use-cases and scenarios the new starters may encounter, based on the projects they were supposed to start with.

So I wrote an application in C# (so I could compile it to a single executable and not need any dependency) that was supposed to act as our "development shell" or SDK. On its first execution, it would configure a bunch of environment variables allowing it to run, that would later be overriden by the user if necessary or desired. It would then download an XML file from our SCM (or a given URL) and use it do identify repositories to use as source to fetch and install packages. It was flexible enough that I made it possible to install a dev environment in one click: it would download the right version of eclipse, of emacs, of GnuWin32 and MinGW+MSYS, of Cygwin, of Maven, of Ant, of Groovy, of the JDK, etc... And you could extend it to add your own desired packages, and even to add new repositories.

The next step was to allow it to support different "one-click profiles": developer, tester, reviewer, etc... Originally I meant this to be used by the dev team, but then I realized our test team probably had a similar issue to get their new starters up and running, so I modified that so it would download a different set of packages based on the profile you wanted (of course you could ask for both).

This executable then acted as a master shell you could use for a bunch of things, either from the command line (something like sdk <options> [<command> ...]) or in interactive mode. You could ask it to fetch updates for the installed packages (not as well as I wanted though, I never got around to implement a backup system or and to move configuration files across 2 versions), to create a new "workspace" with brand new folders and a clean checkout of the trunk or a branch of a project, fetch the team's wiki to your local installation... I had started to make it interact with our JIRA issue tracker to create entries from the command line but never finished that either.

That was a fairly fun thing to play with, and it did make newcomers more productive. Me... maybe I spent more time than necessary on it, but I learned a lot from doing that :)

share|improve this answer

This is someting I wrote for my personal use, as opposed to use at work. I wrote a software that I can use to track my expenses. Nothing big, just a command line utiltity to print out a log my expenses into a simple text file.

Now i'm writing GUI to it: to analyse my expenses and generate reports like:

  • expense by week
  • expenses by tag (yep, i can tag my expenses)
  • GUI expense viewer in Qt with a variety of filters, and facility to write filter plugins in QtScript

And oh, my command line tool could also keep track of how much I have borrowed from people (friends) and (more importantly) how much people have borrowed from me. Writing a GUI for this too. Yep, Qt.

share|improve this answer

Not really programming, but on the team I was on before, I was one of only 2 people who knew anything about SQL and the database, and the other guy was my supervisor.

We had to enter in a bunch of stuff to the database, coming from other departments, and being put into a word doc by another coworker. I had to do the entry into the DB. Manually making SQL INSERT statements to do it.

I realized I could just copy & paste the Word tables into Excel, write some formulas (which I hadn't touched since grade 9, but quickly learned), do some dragging, and I could get everything entered in a few hours, compared to several days the other way. I say a few hours because it would be different stuff every time, and needed to be re-written from scratch.

share|improve this answer

I've written a few utility scripts at work; the one that saved us a lot of time for migrating ~33 websites to our site/CMS was a TextMate HTML-to-Textile conversion plugin. It used a Python library I found online that I made some modifications to for forcing certain classes that were used to become appropriate tags.

Saved us so many hours of extra unnecessary work.

share|improve this answer

I helped build our company's web application framework before such frameworks were commonplace. I'm continually adding features to improve our team's efficiency. I enjoy seeing even the smallest feature saving many hours of work across multiple projects.

I've also rewritten our server update script to handle various situations, so we manually log into servers less often.

share|improve this answer

I used to work at a large media content company and we had a system of templates that had to be duplicated and modified for each channel or important news that was added to our website. The process used to take at least one hour. A colleague of mine wrote a template generator that could be configured according to the new channel/event info and it would generate everything neatly. The work was reduced from 1 hour to 5 minutes.

share|improve this answer

I think I'm going to need to write a script which searches for certain keywords in MS Access queries and forms (to quickly find where a specific field is referenced, for example). I'm not looking forward to it though, because it's Acess 2002 and SQL SERVER 2000 on Windows XP..

share|improve this answer

We've got a homegrown ORM at work, since the program dates back to before ORMs got popular and lots of premade solutions were readily available. It's got classes that basically match the database schema and a bunch of plumbing to make the two speak to each other with a mininmum of effort. But every time you wrote a new class, you had to define it twice: once in the ORM and once in the DB table.

After a while I got fed up with this and wrote up a simple compiler that parses CREATE TABLE statements and outputs ORM class units. It makes extending our system a lot simpler now.

share|improve this answer

I wrote this SQL Construction Kit to use when I don't need the ridiculous kitchen sink that is Hibernate ( or any of the other heavy weight Java ORM libraries ).

It has served me well on some very highly scale public facing web applications that I have worked on over the years. Funny thing is this code was inspired by a version I wrote in Visual Basic 4 !

share|improve this answer

Every time I write a Perl Module, it seems I become more efficient. Why? Because, when writing a module, you always want to keep it fast, effective, and easy-to-use.

share|improve this answer

In Javaland, I actually don't write many util methods anymore since Apache Commons exists. They have (aging) libraries for various things that Java doesn't do compactly, like printing an array, managing exceptions, etc.

The most popular: Commons lang

share|improve this answer
@Jarrod Seriously? Are you sure you've used commons lang? In several SO and P.SE pools commons lang is the most upvoted. It always pains me when I see people reinventing the StringUtils class. While I agree that some of the stuff in Commons is bad (commons log anyone?), saying "almost all" is completely untrue –  TheLQ Aug 23 '11 at 2:44

Not the answer you're looking for? Browse other questions tagged or ask your own question.