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, no registration required.

Code needs to be written to file, on way or another. While all programmers should strive to write no more code than necessary, this "small" portion needs to be written nevertheless.

What tips do you have for improving the code writing effort? Usage of IDEs? Different keyboards or character layouts? Minimal usage of mouse? Code generation tools? What else can you think of?

share|improve this question
    
I'm always on the lookout for a better code writing environment. It's not easy finding one with everything you need or want. Still looking, myself. –  Fosco Sep 17 '10 at 19:36
    
@Fosco: Same here. I'd like an IDE which allows keyboard navigation like in Emacs. –  gablin Sep 18 '10 at 7:58

4 Answers 4

(Copying my answer from SO...)

As @Thomas-Mueller said back on SO, type less, not faster. In addition, try to follow DRY (Don't repeat yourself). I used to hear people raving about "cookie cutter code", where you could supposedly get a lot done quickly by cutting and pasting large amounts of code. The reason that's a problem is if there's a need to change the original code, now you have to change N copies.

Programmers are like noisy channels. If they have to make 10 changes to the code, if they're really good, they'll get 8 of them right. The ones they don't get right are new bugs.

That's why short code and DRY matter.

That's also why compiler languages are better than assembler, and why domain specific languages (DSL) are better yet, when they apply.

share|improve this answer

For me, an IDE with autocomplete is important. A programming language that requires less keystrokes would be nice (type less, read less) but keeping it understandable (unlike J).

Keyboard layout: I don't think it's a problem. I switched the layout a few times (US/CH, PC/Mac), and after some time the brain adjusted. Code generation: I avoid them, except to generate getters, setter, and implement an interface.

share|improve this answer
    
Maybe keyboard layouts are not a problem, per se, but I do find that they could be improved. On a Swedish keyboard, for instance, the {} and [] all require usage of ALT GR. Being able to type those using at most a combination involving SHIFT, I'd be better off since that limits akward key combinations. –  gablin Sep 18 '10 at 8:00

Getting as much of the crap out of the developers way is the way to go. Anything that makes me think of anything other than the task in hand is a waste of my clock cycles.

Unfortunately, what this actually is will differ from person to person. Some people touch the mouse as little as possible. Other people hate to have to remember keyboard shortcuts. Some people want silence, others like the hum of a working office.

Anything mechanical or repetitive should be automated. Code formatting tools, version control commit-hooks for lint checking, cruise control, etc, etc are good and fairly generally applicable.

Aside from that, give developers the choice to make their own decisions on what works for them. Some decisions have to be made at a department / company level (code style, build system, possibly even IDE, depending on your level of integration), but everything else should be left to the person who has to get that small amount of code into the file.

share|improve this answer
    
That said, if you want specific examples of what works for someone... Physical stuff: mechanically switched keyboard, natural light, a footrest. IDE stuff: Eclipse and plugins like log4e (log statement generation), Eclemma (unit code test coverage), checkstyle + company formatting template. PC stuff: Freedom to install what I need to get the job done (Cygwin, Notepad++, Winamp, IM), enough memory so my PC doesn't page too much. –  QWasson Sep 17 '10 at 19:47

Since I use SQL Server Management Studio a lot, I have a pretty good template library. Someone on this site recommended SSMS Tool Pack, so I'm checking that out.

The best is copy & paste. I'M JUST KIDDING!

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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