ankushbhardwxj / codemon

cli to win programming contests
https://pypi.org/project/codemon/
MIT License
26 stars 12 forks source link

Add a sensible default template (java) #68

Closed Enigmage closed 3 years ago

Enigmage commented 3 years ago

Currently we don't have a proper default template for java. This is the template that gets added to source files during init if the user does not have a custom template in ~/.codemon/ folder.

The goal is to have a sensible default template that is capable of taking care of the basic needs of the user during a competitive programming contest without having too much boilerplate.

The template can be added in the template string under default_java method of the Templates class in the CodemonMeta module.

ankushbhardwxj commented 3 years ago

@Enigmage - go ahead and send a PR

paramsiddharth commented 3 years ago

Is this issue available at the moment? I'd like to work on this.

ankushbhardwxj commented 3 years ago

@paramsiddharth - Go ahead 👍🏻

paramsiddharth commented 3 years ago

@ankingcodes Please note that since the filename holds significance in Java classes, we need to decide the class name based on the filename. Also, I have noticed that specifically CodeForces allows any class name for the solution, though "Solution" is preferred by many. To make sure that the classes are compiled and run properly, we need to make sure that the class name is the same as the filename before the .java extension. That would also mean making changes to codemon.py too. One way to avoid the hassle and leaving it to the user to take care of it would be naming the class "Solution" by default and adding a comment asking the user to change the name as required.

ankushbhardwxj commented 3 years ago

@paramsiddharth - I'm not very aware about this point that you've discussed since I normally do competitive coding in C++ or Python. You may make the changes as per your research. In case, any Java programmer faces problems, they may make an issue.

paramsiddharth commented 3 years ago

@paramsiddharth - I'm not very aware about this point that you've discussed since I normally do competitive coding in C++ or Python. You may make the changes as per your research. In case, any Java programmer faces problems, they may make an issue.

@ankingcodes Did you look at #77 ? I took into account the points I made in the previous comment and added a sensible template for Java to CodemonMeta.py. Should I make any changes?