Showing posts with label eclipse. Show all posts
Showing posts with label eclipse. Show all posts

Friday, March 21, 2008

The way I'm working lately

This is actually almost fun.

Figure out some functionality that needs to exist. Within a unit test, write the top-level code for it regardless of whether the supporting methods exist or not.

List people = populationDao.getPeople();

...even if I haven't written populationDao.getPeople() yet.

Eclipse will complain that I have written references to methods that don't exist. Hit control-1 and choose the answer that is "create method 'getPeople' in interface 'populationDao'." Then, of course, PopulationDaoImpl will have errors, because I have a method in populationDao that I haven't implemented. Open up PopulationDaoImpl, control-1, 'add unimplemented methods,' and write the implementation for getPeople().

This way I know that getPeople() has at least some test coverage right from the start.

Tuesday, January 22, 2008

ColdFusion Pain

A brief note regarding ColdFusion, which I'm currently doing development on (augh). CF is pretty loosely typed. Unit test (using CFUnit, god help me) certainly need to explicitly do testing on the types that methods return, as well as methods' abilities to handle arguments of varying types.

As a side note, I use CFEclipse, which is the ColdFusion plugin for Eclipse. It really isn't very good. Its ability to do tag completion is woeful; ctrl-space code completion isn't very complete -- and often the "timed" code-completion popup occurs at precisely the wrong moment (namely, when I'm pressing 'return' for some other reason).

Worst, in my opinion, is CFEclipse's inability to find things. When doing Java development in Eclipse, if I highlight a variable name, I expect to see every instance of that variable highlighted in the current file. CFEclipse doesn't do that with ColdFusion files.

I'm also addicted, in Java, to using the right-click menu to find declarations of variables or to find references to methods and/or files. Not available in CFEclipse at all.

I accept that some of this stuff is hard to do for a loosely typed "language" like ColdFusion. But this is playing hell with my productivity. I also accept that CFEclipse is an open-source project and that I could contribute to it if I really wanted to. I'm considering it.