Simple project to put my newly acquired knowledge of building clean code to the test.
The whole point of the project is to transform my older program in file "OriginPoint.c" into a new, clearer code using Robert C. Martin's "Clean Code: A Handbook of Agile Software Craftsmanship" as a reference. The program in its core has only one task: align text in a given txt and export it into a new file. Being a begginer I was, trying to write code to handle string manipulation resulted in a messy code - a perfect candidate for the cleanup project.
- GCC
gcc -o align-text align-text.c
Windows .exe file available after the project is finished
./align-text <file_in> <aligned-file>
- Create clear namerules
- Break up code into smaller chunks
- Reduce number of passed argument
- Hide library functions (clarity sake)
- Remove comments
- Improve error handling
Problems with output file if file was created in Windows with ANSI (Windows-1252) characters and program run on a Linux system. Double characters and uneven lines.
@rue-mionne