Teaching an Old Dawg New Tricks 44

Posted by Bob Koss Thu, 21 Dec 2006 16:16:00 GMT

I learned something a few weeks ago that has saved me quite a bit of typing. I’m a pretty good typist but I still feel that saving a few seconds here and there pays compound interest when integrated over weeks, months, and a career. I’ve never seen anyone do this before and I get to work with a lot of programmers so I thought I’d share it here.

Joe “J.B.” Rainsberger was in our office a few weeks ago giving some internal training. Joe is the author of JUnit Recipes and if you don’t already own the book, buy two copies – it’s very good. Anyway, Joe was doing a demo for us and I watched how he created objects in Eclipse. If I wanted a new Counter object, for example, I would type:

Counter counter = new Counter();

But Joe would type:

new Counter();

and he then uses Eclipse’s Quick Help (ctrl-1) which offers to either create a local variable or a field in the class. That’s 2 keystrokes if Eclipse does it or 15 if I type it. That’s quite a return on investment in my book.

Try it and see if it makes you go just a little bit faster.

Comments

Leave a response

  1. Avatar
    David about 3 hours later:

    ctrl-1 (cmd-1 on mac) offers many, many cool shortcuts. Some are geared towards solving compilation problems like the one you desribe above. Others are simply helpful tasks like assigning the value of a parameter argument to a newly created field (it creates the assignment and the field simultaneously).

  2. Avatar
    Brandon 16 days later:

    Definitely, Ctrl+1 is probably the most used shortcut key in my eclipse arsenal (well except maybe Ctrl+F11 to re-run the tests).

  3. Avatar
    KO 17 days later:

    IntelliJ IDEA makes this even easier, since you don’t have to type the ; before the refactoring. So you can just type “new Co” (ctrl-space) (enter) (ctrl-alt-v) (enter). This is possibly my most used key combination of that length. Looking at it now it could probably be simplified.

  4. Avatar
    Anonymous 18 days later:

    alternatively, in Eclipse, you could do the following:

    1) type “Count” 2) hit ctrl-space for code completion; chances are Counter will be the top entry. 3) type “counter = new” 4) hit ctrl-space for code completion; Counter will be the top of the list.

    You have to hit a few more keystrokes to do the code completion, but that’s balanced by fewer keystrokes for the classname. More important (to me), you’re moving forward, adding to the line of code, rather than stopping and filling in.

  5. Avatar
    Ola Ellnestam 22 days later:

    In this particular case. I’d type “new” followed by ctrl-space. Which invokes the pre-defined “new-template”. There are a few more useful ‘macros’ I like. All as easily invoked as the one above:

    - foreach

    - main

    - for

    I can also recommend creating you own. Window – Preferences – Java – Editor – Templates

    Me and a few friends usually jokes about this and referring to it as ctrl-space/ctrl-1 programming ;-)

  6. Avatar
    J. B. Rainsberger about 1 month later:

    Even better in Eclipse: some of the most-used Quick Fixes have their own hotkey. Instead of Ctrl+1, try Ctrl+2, followed by L for local variable or F for field. This is how I routinely do it now.

    Take care.

  7. Avatar
    Richard over 3 years later:

    Alt Shift L for local field. Alt Shift M for Extract Method. (Alt Shift I for Inline if you Extract Method too far)

    That and things like showing the class hierarchy, showing the implementation hierarchy of the selected method, highlighting usage of whatever your cursor is on in different colours for read and write, call hierarchy both incoming and outgoing. All very handy shortcuts.

    I’m stuck with Visual Studio at the moment which, even with Resharper, doesn’t come close to the tools available in Eclipse!

  8. Avatar
    ipad to itunes transfer over 3 years later:

    it is really good ,you can have a try

  9. Avatar
    eleiagaid over 4 years later:

    Do you have many new tricks?

  10. Avatar
    jenniferthomos2 over 4 years later:

    How to convert AVI to iPad with best iPad Video Converter – AVI to iPad Best AVI to iPad Converter a professional iPad converter to convert avi files into iPad mp4 format, of course it can easily convert almost 100 kinds of videos to iPad for enjoying. The input format includes AVI, AMV, MKV, FLV, MTS, M2TS, MOD, H.264/AVC, RMVB, HD TS, HD MOV, WMV HD, etc. Best AVI to iPad Converter allows users to enjoy videos with the large and high-resolution screen freely with your iPad. There are many powerful editing functions such as effect, trim, crop, add watermark, merge and so on. RECOMMENDED: For Mac Users, you can try iPad Converter for Mac Version! FLV to iPad Converter DivX to iPad Converter

  11. Avatar
    hansekarl over 4 years later:

    Thank you that you can take your time from your busy scheduel, it is very kind of you to provide this precious information for us There is certainly certainly a great dvd ripper for mac deal to understand about this. I imagine mac dvd ripper you built some great points dvd ripper mac in Functions also. Preserve doing work ,great employment!

  12. Avatar
    Solid State Relay over 4 years later:

    Your site is amazing.I am very impressed to see this,i want to come back for visiting your site.Keep doing Good as well as you can.

  13. Avatar
    IC electronic componenets over 4 years later:

    great post and like it

  14. Avatar
    hes over 4 years later:

    Thomas sabo developed its own distinctive way, a distinguishing face due to constant support and designs by both of them. They had an eye for detail, an amazing compassion for the material and a sixth sense for thomas sabo charms fashions and trends. A complete new segment was created for the market because of this. Looking at the amazing success achieved, by the end of 1990 his company determined to establish retail outlets of thomas sabo its own. Throughout Asia, Europe and America exclusive stores, sales agencies and shops were set in different countries in rapid succession. Thomas Sabo changed from being a secretive protection of fashion insiders to getting developed as a well-built, globally acknowledged brand. The most popular collection of thomas sabo jewellery Charm Club Collection was originated with the creative director Susanne Kolbli’s idea. Today fashion has more freedom than ever before. There are diverse trends all over and so is their collection.

  15. Avatar
    Hoteluri Romania over 4 years later:

    Definitely, Ctrl+1 is probably the most used shortcut key in my eclipse arsenal.

  16. Avatar
    Appartamenti Bucarest over 4 years later:

    I’ve read an article with Eclipse hotkeys and it was also a list. This can help beginners to become experienced Eclipse user faster.

  17. Avatar
    http://www.cheapsrosettastone.com over 4 years later:

    Great sources for fashion news and fashion articles. It’s got offered many details around the relevant information. I like this post a lot and i am likely to recommend it to my buddies. Brief and practical methods within the post saving time and inside searching process. It’s this kind of awesome source or technique i can’t wait to attempt it. The post is utterly incredible. Appreciate your all you could posted and whatever you present to us!

  18. Avatar
    Big pony over 4 years later:

    I like what you have said,it is really helpful to me,thanks!

  19. Avatar
    okey oyunu oyna over 4 years later:

    This very useful counter. Thanks …

  20. Avatar
    chaussures puma over 4 years later:

    nice sharing.thanks my dear friend and i will come next time.

  21. Avatar
    red pumps over 4 years later:

    Do you like the Red Pumps? They are very popular in the young friends, because they have different styles. We are Red Heels and Red Shoes providers. We can give you the cheapest price and the best service, and do you want to join us at once?

  22. Avatar
    wedding dresses over 5 years later:

    Thank U for sharing.It helps me a lot.

  23. Avatar
    Mulberry Outlet over 5 years later:

    Mulberry Outlet Syles from the new collections at reduced introductory prices. This is a great way to pick up a trendy, new but cheap designer Mulberry Outlet handbag.

  24. Avatar
    cigaretteoem over 5 years later:

    great article ,thanks

  25. Avatar
    www.replicapwatches.com over 5 years later:

    Say thanks a lot for your time best rolex watches and energy to have put these things together on this weblog. Jack and i also very much loved your knowledge through your own articles wrist watches for men in certain things. I’m sure that you have several demands on your schedule hence the fact that you took just as much time as you did to steer people really like us through this article is definitely highly liked breitling bentley watch.

  26. Avatar
    jingle over 5 years later:

    The proposals, which have not been Gas RC Car fleshed out and only show up as broadly worded titles so far, They do not consist of nicely more Off-Road RC Car than 100 bills that have been thought to be earlier this yr that lawmakers agreed to hold more than to 2012, The desire record of lawmakers’ 1:5 Scale RC Car proposals to become thought to be by council on Monday is intended to become restricted to “emergency” measures,

  27. Avatar
    jingle over 5 years later:

    A suggestion to prohibit union RC Monster Truck people from spending union dues via authorized payroll deductions has currently produced opposition from well prepared labor,

  28. Avatar
    Monster beats studio Ferrari Headphones over 5 years later:

    This is a really good post. Must admit that you are amongst the best bloggers I have read.Monster beats studio Ferrari Headphones Monster Beats headphones E-shop Thanks for posting this informative article.

  29. Avatar
    SMC solenoid valve over 5 years later:

    Our main products have various series, such as FESTO cylinder,oil lubricator,two-way solenoid valve,double acting cylinder,hand pull valve,quick exhaust valve,pneumatic cylinder,hand operated valve,SMC cylinder,cylinder piston rod and pneumatic solenoid valve for sale. Our pneumatics are widely used in different industries.

  30. Avatar
    Backup iphone sms over 5 years later:

    Users are complain about the data lose on the tablet. why not backup to Mac before lose them? yeah! a regularly backup of the file can be a good idea!

  31. Avatar
    bodybuilding over 5 years later:

    This article is a wealth of interesting quality content. Your thoughts are well-written and researched. I relate to this information. Thank you for providing this information to readers who like to think outside the box.

  32. Avatar
    creatine over 5 years later:

    This is a great piece of writing! I am highly impressed with your research and writing skills. You have hit the nail right on the head with this information in my opinion. You are wonderful.

  33. Avatar
    Project Management over 5 years later:

    Every year we take the family to somewhere special to get away and just enjoy life. Our family doesnt like to stay in hotels all the time so we decided to start renting condos and timeshares, this was one of the best ideas ever.

  34. Avatar
    benk over 5 years later:

    keep posting!

    Today’s Technology UK News Blaze UK Sport News UK Celebrity Talk UK Fashion Now

  35. Avatar
    Showbiz Celebrity News over 5 years later:

    This is great and I like it

  36. Avatar
    Gadgets to Update over 5 years later:

    This is cool and great

  37. Avatar
    UK Politics and Events over 5 years later:

    I might look for this and see whats great in here

  38. Avatar
    The UK Sports over 5 years later:

    There are a lot of things to consider in here

  39. Avatar
    UK Health Issues over 5 years later:

    Is this the real thing for me? Great and I like this stuff

  40. Avatar
    dennisse over 5 years later:

    Is this true? pretty amazing

    plastic surgery sacramento

  41. Avatar
    Michael Michael Kors over 5 years later:

    Makeup Outlet Stores can be fabulous places to find makeup bargains. Yet cosmetics companies don’t seem to do much to advertise or market these sources for discontinued cosmetics and overstock makeup. Cosmetics Company Outlet or CCO Outlet This is the outlet store that gets the most people talking. It’s more widely known than most other brands. CCO Outlet is owned by Estee Lauder and that company owns most of the make up brands that many of us adore when we visit specialty stores like Sephora and Ulta. In fact, Estee Lauder owns MAC Cosmetics in addition to others like Clinique, Bobbi Brown and Smashbox, and has owned Stila and some other high end luxury cosmetic brands. If you’re looking for a MAC makeup Michael Kors Watches outlet, CCO is your place. They have a decent selection of discontinued MAC products, and are often a source for limited editions that you may have missed out on the first time around. The Cosmetics Company Store also carries a wide variety of hair and body care products in addition to fragrances and colognes. Estee Lauder also owns Bumble and Bumble, Tommy Hilfiger, and they even own La Mer though I’ve never seen that at any CCO! Look to outletbound.com to see if there MICHAEL Michael Kors outlet Hamilton Quilted Crossbody Bags Pink [Mmkfs14] Michael Kors Clutches Michael Kors Crossbody Bags Michael Kors FREE SHIPPING Michael Kors Hamilton Michael Kors Handbags Michael Kors Hot Sale Michael Kors New Arrivals Michael Kors Satchels Michael Kors Shoulder Bags Michael Kors Tote Bags Michael Kors Totes Michael Kors Wallets Michael Kors Watches is CCO in your region. Bare Escentuals Makeup Outlet Store I was recently out at a Premiere MICHAEL Michael Kors outlet Hamilton Quilted Crossbody Bags Pink [Mmkfs14] Michael Kors Clutches Michael Kors Crossbody Bags Michael Kors FREE SHIPPING Michael Kors Hamilton Michael Kors Handbags Michael Kors Hot Sale Michael Kors New Arrivals Michael Kors Satchels Michael Kors Shoulder Bags Michael Kors Tote Bags Michael Kors Totes Michael Kors Wallets Michael Kors Watches Outlet store in Las Vegas, NV. Much to my surprise, I saw a Bare Escentuals Outlet Store! I didn’t even know such things existed. The selection was small and the discounts weren’t anything to get too excited about. But a bit of research shows that there are 3 more of these makeup outlet stores in the USA. Find more information at outletspotter.com. These seem to be located in Indiana, Texas and Virginia. Neutrogena Cosmetic Company Outlet I’m not sure if this exists anymore. I’m told there was one of these near the Los Angeles Airport but when i tried to track it down further, I couldn’t find it. I can’t seem to find it using Google either. Lancome The Company Outlet Lancome doesn’t get nearly as much press for their outlet store as Estee Lauder does. But if you can find one, Lancome’s outlet store tends to have better prices and steeper discounts than The Cosmetics Company Outlet. L’Oreal owns Lancome, and something like 500 more brands, but you won’t find drug store brands at the Lancome Outlet. I’ve seen Kiehl’s and some other products that didn’t capture my attention too carefully. But the outlethas fabulous prices on Lancome. If you can’t find what you’re looking for in your own region, there are many online makeup outlet stores that carry Estee Lauder, Lancome Urban Decay, Stila, Smashbox, and many other brands you love.

  42. Avatar
    Jordan High Heels over 5 years later:

    Air Jordan 6 Rings High Heels is one of the most popular Jordan Heels For Women shoes now. The design of different color ways and the calssy upper leather give the shoe both fashion and high quality. It will surely makes you outstanding and elegant. As a fashion chaser, you should have a pair of Air Jordan 6 Ring Heels. The popularity of Nike Heels have been greatly aided by its easy customization. Air jordan heels may be found online and through independent brokers of the footwear. Maybe you are worrying about not being tall and slim enough. Don’t worry, we recommend this Air Jordan 6 Rings High Heels boots.

  43. Avatar
    Rental Mobil over 5 years later:

    There are a lot of things to consider in here

  44. Avatar
    <a href="http://www.lorenziboots.com/">Gianmarco Lorenzi Shoes</a> over 6 years later:

    Another thing to consider is the Chaussures Louboutin Pas Cher of time that you spend at the bowling alley. If you are Christian Louboutin Bouts ronds on playing and practising for long Louboutin Bootes at a stretch, the advice is to invest in an expensive, high end bowling shoes, which are more durable and can withstand chaussures Manolo Blahnik pas Cher usage for years. But if you are only planning on bowling for fun and leisure, then you don’t need any expensive pair. Just choose one Christian Louboutin Bottes femme is comfortable. However, bear in mind that the quality of the shoes should not be compromised by the cost.

Comments