17

Whenever I start a new software project I spend a good amount of time at the beginning drawing class diagrams and other flow charts to plan out how I see the application working. This part just takes a lot of thinking and testing. But at a certain point when everything is planed out I don't need to think about it so much anymore I just need to code it.

IntelliSense is definitely a godsend, as is being able to generate code from it automatically by hitting the TAB key. But now I'm wondering: what are some other techniques or tools people use to get the code in their head to the screen as fast as possible?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Eric Anastas
  • 21,675
  • 38
  • 142
  • 236
  • 16
    typ faster than lightning – Natrium Jan 26 '10 at 10:07
  • I understand that diagrams are a good thing, and a pervious thinking is a good way to start a project. But if you are sure of what you want and what you want to construct first... why don't you simple start coding without using the visual approach? I don't use VS a long time ago, but writing clases should be available from the very beginning :) – helios Jan 26 '10 at 10:10
  • Oh, another thing: a lot of times I see ways of adding quality to some old code. That changes leaves LESS code. The code is smaller, cleaner and more robust. So have in mind that maybe what you're thinking can be achieved using a more compact/simple approach and that means less code to write. Don't be greedy with your code, but try to recognize the patterns, the responsabilities, the commonalities. It helps to reduce the overall size and mess. – helios Jan 26 '10 at 10:16
  • Oh (the last comment): and if you need those diagrams for thinking your solution, use them. Productivity is not writing more lines of code. When comes the time you can have your diagram in your head (or a paper napkin) then maybe you can be confident enough to start writing and prototyping directly from your head to your code. That will be a signal that: a) you are fearless/careless; or (I hope) b) you have a good abstraction-capable-mind and you are a pretty-damn-good programmer. – helios Jan 26 '10 at 10:21
  • 11
    DONT copy more / past more: that's a signal you are programming bad. Copy/past oriented programming is BAD. And if you are faster by copy/pasting than writing and using IDE suggestions, then you are not fast enough nor programming enough code. – helios Jan 26 '10 at 10:23
  • @Developer Art, I hope for your clients' sake my sarcasm detector is on the blink... – Paolo Jan 26 '10 at 10:40
  • 6
    I'm just kidding, guys. Seriously. :) –  Jan 26 '10 at 10:48
  • Reminds me inheritance of abject-oriented-programming (http://typicalprogrammer.com/?p=8). – Arnis Lapsa Jan 26 '10 at 11:27
  • Fast is not necessarily better. – Max Jan 26 '10 at 13:47
  • 16
    Closing the SO tab in firefox helps me to code faster... – Jla Jan 26 '10 at 14:29
  • 2
    Closing Firefox makes everything faster. – Filip Ekberg Sep 16 '10 at 08:36
  • It depends on the problem, but generally speaking if you memorize some of the functionalities of the libraries you use most, that can help. It cuts time on documentation lookup. – locoboy Apr 19 '11 at 20:34

15 Answers15

26

I get a lot of productivity out of Resharper - It's especially useful if you learn all the features and keyboard shortcuts

Rob Fonseca-Ensor
  • 15,510
  • 44
  • 57
  • 2
    ReSharper is the number one productivity booster! – bitbonk Jan 26 '10 at 10:14
  • 1
    Although other products are available (CodeRush & Resharper!, for example). I'm not either better than the other, but some people prefer one. Horses for courses. :) – ZombieSheep Jan 26 '10 at 10:47
  • The world is separated to kinds of people: those who hate Resharper, and those who can't live without it ... I relate to the first group.. –  Jan 28 '10 at 07:33
  • 1
    @opc I'd say the world is separated into pragmatists and dogmatists, that way you cover non-programmers too – Rob Fonseca-Ensor Jan 28 '10 at 08:42
10
  1. As everyone else has mentioned, use Resharper or equivalent.

  2. Learn the keyboard shortcuts and use them. Just about every operation you can perform in VS has a keyboard equivalent, and the more of them you know, the less time you'll spend poking around in menus. This is equally important for using Resharper.

  3. Pay attention to anything you have to wait for. Are you waiting for builds to finish? Remove projects that you aren't working on from your solution and reference their assemblies instead. You can always add them back if you need to. Are you waiting for unit tests to run? Maybe you can segment the tests into a set you run several times a day and a set you run before every check-in. Are you waiting for your application to start up every time you test it? Maybe you can define a build configuration that excludes startup code whose functionality isn't involved in what you're working on right now.

  4. Get a solid-state drive and put your OS and development tools on it. Put more memory in your machine.

  5. A simple for tip for dealing with the tedium of editing code that you copy and paste: Don't copy and paste code. I'm sure that there are circumstances under which it's acceptable, even necessary, to copy and paste code, but if it's part of your everyday workflow you need to stop what you're doing and fix it. I wouldn't even mention this if more than one person hadn't suggested it.

Robert Rossney
  • 94,622
  • 24
  • 146
  • 218
  • 1
    +1 for removing projects. Build times can be a major roadbump in VS. – Dave Sims Jan 26 '10 at 21:32
  • As Dostoevsky observed, man is the animal who can get used to anything. This can be a great strength, but it also means that we often forget that it's even possible to change things that plague us. – Robert Rossney Jan 26 '10 at 21:44
9

I don't want to open a whole CodeRush & Refactor! / Resharper can of worms, but a good quality re-factoring tool like one of these would probably help enormously. I have been using CodeRush and Refactor! for a little over a year, and the time it takes to write robust and maintainable code is way shorter now than it was a couple of years ago.

Of course, there's a learning curve, but the benefits after just a few weeks are enormous.

ZombieSheep
  • 29,603
  • 12
  • 67
  • 114
  • 3
    Unfortunately for the holy war, I'm a pragmatist and would say to everyone: Just try resharper and coderush for yourself for a week and use the one that suits you the most... Not using either is the only wrong choice – Rob Fonseca-Ensor Jan 26 '10 at 10:18
  • 1
    My point exactly. I tried Resharper and found it wasn't for me, but I know there are many happy users out there. Neither company would survive if the product didn't have benefits. :) – ZombieSheep Jan 26 '10 at 10:45
  • I use both together. With a bit of tweaking, they play well together. If you have used both you know that there IS SOME overlap but the gestalt of each is entirely different and they compliment one another quite nicely. – Sky Sanders Jan 26 '10 at 18:50
9

Make your environment to respond faster.

Slow pc, IDE, build, repetitive tasks that could be automated kills speed seriously.


Every little thing counts. Even increasing Repeat rate in Control panel=>keyboard properties.

Arnis Lapsa
  • 45,880
  • 29
  • 115
  • 195
5

You could draw your class/sequence diagrams in a modelling tool like Enterprise Architect that can then generate the code for you.

Paolo
  • 22,188
  • 6
  • 42
  • 49
  • 1
    This can save many hours of tedious typing, it will even generate skeleton methods for you. It makes UML much more useful because you can also link your code/UML meaning as you change the code, the tool can update your UML to match and the UMl doesn't end up out of date like the rest of your documentation. – Mr. Boy Jan 26 '10 at 11:32
5

I hate to be the one to bring this up and I'm no Linux fanboy but I tried an addin called ViEmu a few months back. It took me at least a month to get back up to my usual productivity because learning all the commands and how to chain them is a big ask but now,..I'm easily 5-10 times quicker at refactoring.

It kinda hard to explain how but you get the most work out of it when you come across text editing jobs that are awkward and repetitive it seems,..say you've got 20 lines of code where you need to remove the middle camel cased word from the variable name. It's that kind of thing.

The link for ViEmu is here - http://www.viemu.com/

HTH

EightyOne Unite
  • 11,665
  • 14
  • 79
  • 105
2

Unfortunately for me it's just intellisense, although I do tend to re-bind a number of keyboard shortcuts to help. The context menu (my keyboard doesn't have a context menu button) is one of my most used for adding references etc.

I did read not too long ago about a 'neural headband' for gamers. It was designed to be trained so they could think 'forward' & 'fire' rather than pressing W + Mouse1, and claimed to increase reaction times. I doubt it could be trained up enough yet, but if technology like this could be used so you think 'implement base class Foo and add method Bar()' and the code is generated within VS, then that would be amazing :) Sadly it's a little way off, and I can imagine 'Coffee' being the result of far too many broken builds...

Ian
  • 33,605
  • 26
  • 118
  • 198
2

Good tools help a lot. I especially like Visual Assist X: http://www.wholetomato.com/

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
1

Have you thought about creating and using code snippets for things you do regularly? These can be a real time saver as you just dump them straight in and can easily refactor the variables used within them.

Ian
  • 33,605
  • 26
  • 118
  • 198
1

Well, no doubt I'm an oddball, but for desktop apps (not web) here's what I do. I consider almost any app as just a glorified editor. That is, it has a data structure that needs to be persistent, and a UI to let the user put information into that data structure and get it out.

For the data structure, keep it simple, simple, simple. I consider it just a repository for information, with as little redundancy as possible. I do not want to build data structure that exists for the purpose of being a visible manifestation of the underlying data, such as tree controls, etc. because then that needs to be kept in agreement with the underlying data, and you get into all the issues of how to keep redundant data consistent. (Example: for graphics, don't build it, draw it.) If I cannot avoid creating redundant data structure, I stay away as much as possible from notification-style programming that tries to keep redundant data structure in tight agreement. Much of the buglist and performance issues arise from that. Rather I prefer loose coupling, where a certain amount of inconsistency can be tolerated and is managed by processes that run once in a while to propogate changes.

For the UI, I was a big believer in OOP and MVC-style UI coding, until I discovered this in 1986. Now I'm spoiled, and I can get complex UIs coded in a fraction of the time possible by the usual control-event-handling style, and they are trivial to modify as requirements change. But so far, I'm in the company of maybe only 3 people in the world who use it, because it is definitely not mainstream.

Community
  • 1
  • 1
Mike Dunlavey
  • 40,059
  • 14
  • 91
  • 135
0

It seems to me that I see two things:

  1. You don't have a full keyboard. I can't recommend getting a new keyboard enough.
  2. You could use templates to make it easier. I gather that you have to do a lot of programming before you ever get started on your project. If you would use templates, you could make a template containing all your exception handlers, .NET references, and so forth. Then when you want to code, you just open the template, edit the namespace (which might be automatic) and your good to go.
Arlen Beiler
  • 15,336
  • 34
  • 92
  • 135
0

You may try Resharper.

Other option - you can try Telerik's Just Code.

Danail
  • 10,443
  • 12
  • 54
  • 76
0

I learned the dvorak keyboard layout, which is much faster for English and a little bit faster for programming. It took me three months to get back to my old qwerty speed, but I continued improving. I think it saved me a lot of time in the long run.

Thomas
  • 174,939
  • 50
  • 355
  • 478
0

In addition to Resharper, I've found Hawkeye saves me enormous amounts of time tracking down source code for a particular widget, or trying out properties and their visual effects in real time. Highly recommended.

It's kind of like FireBug for .NET rich clients.

Dave Sims
  • 5,060
  • 3
  • 24
  • 26
0

Read Zain Naboulsi's excellent "Coding Faster: Visual Studio Tips & Tricks".

retrodrone
  • 5,850
  • 9
  • 39
  • 65