Skip to main content
deleted 1 character in body
Source Link
Sleiman Jneidi
  • 3.3k
  • 12
  • 20
  • When you move from a language to another, make sure you don't mix naming conventions. Unlike C#, Java uses Camel casing for method names and not Pascal casing. for example:

     public String getMessage(){ ... } 

And not

 public String GetMessage () { .. } 
  • Constants should be uppercased ( I mean its conventional)

     public static final int LOG_ENTRIES_DISPLAY = 6; 
  • t and m are not good names for fields representing time and message. You can simply call them time and message.

  • String is not the right data structure for representing time, you can use Date instead where you can override the toString method to get a string out of your LogMessage.

  • There is no need to initialize offset to zero in the constructor, where it's already initialized to zero (because it is a field).

  • When you move from a language to another, make sure you don't mix naming conventions. Unlike C#, Java uses Camel casing for method names and not Pascal casing. for example:

     public String getMessage(){ ... } 

And not

 public String GetMessage () { .. } 
  • Constants should be uppercased ( I mean its conventional)

     public static final int LOG_ENTRIES_DISPLAY = 6; 
  • t and m are not good names for fields representing time and message. You can simply call them time and message.

  • String is not the right data structure for representing time, you can use Date instead where you can override the toString method to get a string out of your LogMessage.

  • There is no need to initialize offset to zero in the constructor, where it's already initialized to zero (because it is a field).

  • When you move from a language to another, make sure you don't mix naming conventions. Unlike C#, Java uses Camel casing for method names and not Pascal casing. for example:

     public String getMessage(){ ... } 

And not

 public String GetMessage () { .. } 
  • Constants should be uppercased ( I mean its conventional)

     public static final int LOG_ENTRIES_DISPLAY = 6; 
  • t and m are not good names for fields representing time and message. You can simply call them time and message.

  • String is not the right data structure for representing time, you can use Date instead where you can override the toString method to get a string out of your LogMessage.

  • There is no need to initialize offset to zero in the constructor where it's already initialized to zero (because it is a field).

Source Link
Sleiman Jneidi
  • 3.3k
  • 12
  • 20

  • When you move from a language to another, make sure you don't mix naming conventions. Unlike C#, Java uses Camel casing for method names and not Pascal casing. for example:

     public String getMessage(){ ... } 

And not

 public String GetMessage () { .. } 
  • Constants should be uppercased ( I mean its conventional)

     public static final int LOG_ENTRIES_DISPLAY = 6; 
  • t and m are not good names for fields representing time and message. You can simply call them time and message.

  • String is not the right data structure for representing time, you can use Date instead where you can override the toString method to get a string out of your LogMessage.

  • There is no need to initialize offset to zero in the constructor, where it's already initialized to zero (because it is a field).