45

Why does the default IntelliJ default class javadoc comment use non-standard syntax? Instead of creating a line with "User: jstauffer" it could create a line with "@author jstauffer". The other lines that it creates (Date and Time) probably don't have javadoc syntax to use but why not use the javadoc syntax when available?

For reference here is an example:

/**
 * Created by IntelliJ IDEA.
 * User: jstauffer
 * Date: Nov 13, 2007
 * Time: 11:15:10 AM
 * To change this template use File | Settings | File Templates.
 */
1
  • I am aware that the default can be changed. I am just wondering if there is any good reason why there would choose that for a default. Commented Sep 15, 2008 at 15:30

5 Answers 5

54

I'm not sure why Idea doesn't use the @author tag by default.

But you can change this behavior by going to File -> Settings -> File Templates and editing the File Header entry in the Includes tab.

As of IDEA 14 it's: File -> Settings -> Editor -> File and Code Templates -> Includes -> File Header

1
  • 7
    In IDEA 14, this is File -> Settings -> Editor -> File and Code Templates -> Includes -> File Header. Commented Aug 25, 2015 at 13:53
6

In AndroidStuido 1.0.2 on Mac

Go in Preferences then on left span File and Code Templates After selecting file and code templates on right hand side select includes tab select file Header and change your file header.

4

The default is readable, usable, but does not adhere to or suggest any coding standard.

I think the reason IntelliJ doesn't use the Javadoc tags in the default, is so that it avoids possible interference with any coding/javadoc standards that might exist in development shops. It should be obvious to the user if the default needs to be modified to something more appropriate.

Where I am working, the use of author tags is discouraged, for various reasons.

3

Because it's a default file template that you're supposed to change to your organization's standard, or your tastes.

My best guess.

1

It is likely that the header snippet you show is older than javadoc and was just borrowed from some coding standard document, probably written for C++.

2
  • It appears the company was founded to make a Java IDE: jetbrains.com/company/jbstory.html Commented May 19, 2009 at 15:17
  • My point is that they probably looked around and found a C++ coding standards document (maybe from a former job, maybe from somewhere online) and grabbed the header from that.
    – Alex B
    Commented May 19, 2009 at 15:31

Not the answer you're looking for? Browse other questions tagged or ask your own question.