Open aajoseph2 opened 4 months ago
Code Review:
Your sort project is very impressive and complex, and I think you all did an amazing job with the sort functionality overall. The code was well written, minimalistic and organized, and the majority of the code was well documented. While the flag functionality was a little buggy, I think it is still impressive that you were able to add flags to your program, and I think the way you handled them was very smart. You did forget the free the majority of the malloced memory in sortfunc.c, like on line 138, but I think is it impressive the number of different functions you were able to add. I know sort.c wasn’t the bulk of the project, but some adding some code comments there would be nice. Some major bugs that I’ve noticed was I tried running sort on mkdir and the program crashed, I don’t know if there is a limit to the file size that you can sort. Also, I know this was mentioned in your doc comments, but the program does have some unexpected behavior if provided with no arguments, and I think it would be better to check to see if the user has inputed the correct number of arguments or not. Overall fantastic work on this complex project!
Summarized Suggested Changes:
Code review: Your code looks really good, I do see a lot of hard work behind the code. Some of the thing that I really like here is:
Some of the thing I find it a bit off, and maybe some suggestions:
This is just me being nitpicking, but all and all, great job.
Nice work. It's extremely hard to find any faults with this project; please review the comments above and make fixes if necessary. I wouldn't say the infinite reading is a problem when run without args, ^D should terminate it correctly. You implemented several C library or useful utility features here, they'd be great if spun off to a separate library someday (not a project for you two to worry about!).
NAME sort - sort lines of text files
SYNOPSIS sort [OPTION] [FILE] [text output] | sort [OPTION] ex: ls | sort [OPTION]
DESCRIPTION Write sorted concatenation of FILE to standard output.
AUTHOR Written by Shyon Ghahghahi and Amin Joseph
LIMITATIONS Limited support with multiple flags. Unwanted behavior when combining -n, -b, or -f