Skip to main content
update wording
Source Link
  • The VotesController class consists of several almost identical methods. I know that copy-paste is bad, but I have no idea how to deal with it in this case.

  • I am not sure about naming conventions in Spring. Have I properly named controllers, entities, fields, etc.?

  • I really hate the way I pass information to the Mustache templates. For example, I need to display a question's creation date in this form: May 27 '20 at 15:40, but if I just use Date creationDateTime field from the Question entity then Mustache will display it in the form 2020-05-27 15:40:49.0.

And then I can use formattedCreationDateTime in the template. It is not the single oneonly example.

  • The VotesController class consists of several almost identical methods. I know that copy-paste is bad, but I have no idea how to deal with it in this case.

  • I am not sure about naming conventions in Spring. Have I properly named controllers, entities, fields, etc.?

  • I really hate the way I pass information to the Mustache templates. For example, I need to display a question's creation date in this form: May 27 '20 at 15:40, but if I just use Date creationDateTime field from the Question entity Mustache will display it in form 2020-05-27 15:40:49.0.

And then I can use formattedCreationDateTime in the template. It is not the single one example.

  • The VotesController class consists of several almost identical methods. I know that copy-paste is bad, but I have no idea how to deal with it in this case.

  • I am not sure about naming conventions in Spring. Have I properly named controllers, entities, fields, etc.?

  • I really hate the way I pass information to the Mustache templates. For example, I need to display a question's creation date in this form: May 27 '20 at 15:40, but if I just use Date creationDateTime field from the Question entity then Mustache will display it in the form 2020-05-27 15:40:49.0.

And then I can use formattedCreationDateTime in the template. It is not the only example.

deleted 46 characters in body
Source Link
eanmos
  • 405
  • 4
  • 21
Notice removed Draw attention by eanmos
Bounty Ended with gtiwari333's answer chosen by eanmos
update grammar, spelling, punctuation
Source Link

I have to write a simple web application using the Java Spring framework as my course project. So I decided to write a simple Stack Overflow clone. My application havehas the following features:

I am very new in Java, Spring, and web-backend world so I think there is largemuch room for improvement.

  • The VotesController class consists of several almost identical methods. I know that copy-pastpaste is bad, but I have no idea how to deal with it in this case.

  • I am not sure about naming conventions in Spring. Have I properly named controllers, entities, fields, etc.?

  • I really hate the way I pass information to the Mustache templates. For example, I need to display a question's creation date in this form: May 27 '20 at 15:40, but if I just use Date creationDateTime field from the Question entity Mustache will display it in form 2020-05-27 15:40:49.0.

To solve this problem I have created the String formattedCreationDateTime field in the Question entity and call the Question.formatCreationDateTime method just before passpassing the question entity to Mustache.

I would really appreciate any advice'sadvice on how to improve my code. I would be glad to see review on my JavaScript and CSS, but it is not a priority.

I am not sure if relatively big code size like this is allowed on this site. I hope so.

I have to write a simple web application using the Java Spring framework as my course project. So I decided to write a simple Stack Overflow clone. My application have the following features:

I am very new in Java, Spring, and web-backend world so I think there is large room for improvement.

  • The VotesController class consists of several almost identical methods. I know that copy-past is bad, but I have no idea how to deal with it in this case.

  • I am not sure about naming conventions in Spring. Have I properly named controllers, entities, fields, etc?

  • I really hate the way I pass information to the Mustache templates. For example, I need to display a question's creation date in this form: May 27 '20 at 15:40, but if I just use Date creationDateTime field from the Question entity Mustache will display it in form 2020-05-27 15:40:49.0.

To solve this problem I have created the String formattedCreationDateTime field in the Question entity and call the Question.formatCreationDateTime method just before pass the question entity to Mustache.

I would really appreciate any advice's on how to improve my code. I would be glad to see review on my JavaScript and CSS, but it is not a priority.

I am not sure if relatively big code size like this is allowed on this site. I hope so.

I have to write a simple web application using the Java Spring framework as my course project. So I decided to write a simple Stack Overflow clone. My application has the following features:

I am very new in Java, Spring, and web-backend world so I think there is much room for improvement.

  • The VotesController class consists of several almost identical methods. I know that copy-paste is bad, but I have no idea how to deal with it in this case.

  • I am not sure about naming conventions in Spring. Have I properly named controllers, entities, fields, etc.?

  • I really hate the way I pass information to the Mustache templates. For example, I need to display a question's creation date in this form: May 27 '20 at 15:40, but if I just use Date creationDateTime field from the Question entity Mustache will display it in form 2020-05-27 15:40:49.0.

To solve this problem I have created the String formattedCreationDateTime field in the Question entity and call the Question.formatCreationDateTime method just before passing the question entity to Mustache.

I would really appreciate any advice on how to improve my code. I would be glad to see review on my JavaScript and CSS, but it is not a priority.

Notice added Draw attention by eanmos
Bounty Started worth 300 reputation by eanmos
Tweeted twitter.com/StackCodeReview/status/1267108602604642305
deleted 3 characters in body
Source Link
eanmos
  • 405
  • 4
  • 21
Loading
added 2 characters in body; edited tags; edited title
Source Link
Jamal
  • 35.2k
  • 13
  • 134
  • 238
Loading
Source Link
eanmos
  • 405
  • 4
  • 21
Loading