Editing Tip for Lazy Programmers

Guest Author

When writing tests it can be handy to have long descriptive method names. If your test suite fails, you can see
immediately from the report what went wrong. On the other hand writing these long names can
be really painful so when writing them it's mostly better to cut&paste the name then to write it.

With NetBeans, there is another nice possibility. Instead of writing the long method name you can just write the
beginning of it and press Ctrl-K. The rest of the name is generated for you. If there are conflicts you can cycle
through the list of names starting by the string you wrote (Ctrl-L is for cycling backwards). Here is an example - the yellow line is important:

Before Ctrl-K

After Ctrl-K

On the first screenshot I am about to add the test method name into the suite. Normally I would have to write it
(ugh!) or use mouse or keyboard to cut&paste it. By pressing Ctrl-K I have it there immediately! You can use it for
any purpose, I chose writing tests just as an example. Works also great for variables or any other longer strings you
use several times in one file.

Be the first to comment

Comments ( 0 )
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.