kotlin-hands-on / advent-of-code-kotlin-template

The Advent of Code template project for Kotlin
https://blog.jetbrains.com/kotlin/2023/11/advent-of-code-2023-with-kotlin/
Apache License 2.0
599 stars 109 forks source link

.txt extension should not be implicitly assumed for the input files #12

Closed risboo6909 closed 1 day ago

risboo6909 commented 1 year ago

The template internally adds .txt extension to the input file names. This leads to confusion for me as a linux user because I used to use input files without any extension.

Here is my workflow:

  1. I add input files for new problems with no extension to my AoC project
  2. Then I'm adding up some code
  3. Running it to check whether it works or not
  4. Getting an error message that my input file doesn't actually exist
  5. I use refactor->rename to add the .txt extension and it fails again, because now the template is expecting my input file name to be filename.txt.txt :)
  6. Finally I go to my refactored code and remove the '.txt' extension and it finally starts to work :)

I propose to avoid adding the .txt extension to all input files and leave it to the user. This won't make code any worse but will help to avoid confusion for a plenty of users.

hsz commented 1 day ago

Well, this is a template, and txt extension is explicitly mentioned. You can always adjust it if you haVe another idea for that. :)