This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Eclipse setup question

 
Higgledy Smith
Ranch Hand
Posts: 192
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do you configure Eclipse so that whenever a new class is created the editor will open with a customized commented prolog section?

like:

 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Edit the file header template.

Java -> Code Style -> Templates -> Comments - Files.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's a weird way to comment Java classes, though, and completely bypasses the built-in Javadoc mechanism.

IMO including change history in the file itself is a code smell: that's what SCCSs are for.
 
Higgledy Smith
Ranch Hand
Posts: 192
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
David Newton wrote:That's a weird way to comment Java classes, though, and completely bypasses the built-in Javadoc mechanism.

IMO including change history in the file itself is a code smell: that's what SCCSs are for.


I agree. The company I worked for at the time insisted on it, not me.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18094
48
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
David Newton wrote:That's a weird way to comment Java classes, though, and completely bypasses the built-in Javadoc mechanism.

IMO including change history in the file itself is a code smell: that's what SCCSs are for.


Actually, this particular prototype is rather odd. If the SCCS is CVS, the $Log$ keyword will be expanded to list the changes. There doesn't seem to be a point to having someone add manual history below that, as the example seems to imply.

CVS is a little odd itself. It actually does expand the log into the source file archive itself, then appends later log messages as updates are made. Or such has been my experience.

SVN took a different tack, which I'm not sure I agree with. On the one hand, when you have 3 pages of log history before you even see the code, it can be a real nuisance. But the history does provide a cue as to where people have been meddling, when bugs pop up.

Then again, I have a bigger problem when people create source lines that are 3x wider than the printed page. For serious debugging I've never successfully made it to "paperless" (and some of these guys also bleed off the screen as well). Trying to highlight items with my infamous pink marker on an LCD screen just doesn't seem to work.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic