Hacker News new | ask | show | jobs
by zamfofex 2065 days ago
Hello, everyone! Having known about this website for a while, this is my first time deciding to create an account and making a post.

I have (somewhat) recently decided to start working on a simple C project. It is a “replacement” for the Unix utility ‘cal’.

Of course, it is far from actually hoping to replace anything, it is more of a clone with some different functionalities than anything else.

One of my friends mentioned that in his classes for his degree in computer science, he was assigned to fix a ‘cal’ clone the teacher had written in Java.

Since I was always kinda interested by calendars and timekeeping, that sparked some interest in me. I decided to start the project because I felt like it would be fun to try to come up with something simple to display the calendar.

I chose C because it is a (relatively) straightfoward language, and it is very popular, so basically anyone can understand it.

Initially, the program was really short, but lacked a lot of functionalities. As the time went on, and I felt periodically bored enough to work on it, I decided to sacrifice some simplicity for more useful features.

I feel like now it has gotten to the point in which it is “mature enough”, and could potentially be used by people who regularly use ‘cal’.

Don’t mind the bugs too much. (But of course, feel free to bring them up!) One that I know exists and just haven’t gotten around fixing yet is the overflow handling for my function for parsing integers.

I’m looking forward to know what people might think about it! Any kind of feedback is really appreciated, be it regarding functionality, code style, or anything else!

P.S., You can try it through a Web interface through the first link on the website. Try e.g. ‘greg -yh’ for output very similar to ‘cal’.

3 comments

You haven't done a complete clone until you have included Latin, by the way.

* https://unix.stackexchange.com/q/572653/5132

That is hilarious.
Although this looks like it has a ways to go before being a viable replacement to cal, I give you props for putting yourself out there and gathering feedback. That's never an easy thing to do.
The link could really use a quick description of why someone would want to install it (e.g., features cal doesn’t have) and a copy of the manual.
I made it because I felt like it would be fun! There is not much reason to actually install it if you already have ‘cal’, unless for some reason you really want your weeks to start on e.g. Wednesday.