r/C_Programming • • 23d ago

Question misc. questions from newb

What was your first project? Was it prompted? Did you think of the idea yourself? How long did it take? Was this your first coding language or did you start with another one?

Will appreciate any advice. Definitely about to get obsessed.

0 Upvotes

9 comments sorted by

2

u/LemonLord7 23d ago

Went from Matlab to Java to C# to C++ to C. Just happened that way. First C project was in school to make a PID controller in a microcontroller for an electric motor. I almost died. Then years later I made a I doubly linked list.

1

u/ButterscotchPale568 23d ago

Was the transition from C++ to C rougher? Or about the same as the previous learning jumps?

1

u/LemonLord7 23d ago

Matlab to Java was the worst, the rest was "easy".

The hard part with going C++ to C is not being able to code (for me at least). It is deciding how to go about various problems, e.g. enforce encapsulation through pimpl or discipline, which C++ does for free with private. Should all pointers be nullchecked or handled with discipline? Initialize structs with return value functions or out parameter functions? Should exceptional errors be handled with an error enum or program abort? The "worst" part is that all choices are correct (depending on the context), but you gotta choose and live with the pros and cons, while C++ already has standard ways to deal with all these, which reduces mental burden on you and makes it easier for others to understand the code.

Then in C you also get to have fun with old timers who do stuff the old way (which was best then) and people who do "modern C" and people who think about best practices, and so on, and you gotta find your own way through all of it but also be able to communicate about the concepts in your group to better understand each other and get along.

3

u/flyingron 23d ago

The first real C project was probably writing a device driver for a printer in an early V6 UNIX kernel. I went on to write several things, like a hard disk backup program, while I was a student systems administrator.

My first post-college job had no real C in it, though I did write a program that scanned documents for security classifications and put the highest marking on the top and bottom of pages when output to the printer.

After that, I got a job working for the US Army BRL and did various things including writing one of the first internet routers out there.

1

u/LEWMIIX 23d ago

my first real project was a tiny game (astriods-like space shooter). I came up with it myself, i was looking for a project with a very small scope. I set myself a few goals i wanted to achieve and what knowledge i wanted to gain from it.

In university we learned java but i also selected c and cpp courses, which i think are mandatory if you really want to learn c.

i finished the project in 2 weeks i think.

1

u/wak6817-2 23d ago

my first (C) was a reversed polish calculator, no, i got it from K&R2 and made my own version, 2 hours, i started with a lot of programming languages and switched a lot

1

u/wsppan 23d ago

My first projects were school assignments. I then went through various languages like Perl, Tcl, Java, Python in my career.. I got a new job and was assigned a legacy C project to modernize as a Java mucroservice. I needed to ramp up on C quickly so I set about doing the following

Sudoku solver/generator

  1. Start with a basic brute force backtracking algorithm to solve puzzles.
  2. Add more dimensions to the puzzle. Make code generic over those different puzzle sizes.
  3. Implement different algorithms like Algorithm X (see Dancing Links) and constraint propagation and search (see Peter Norvig).
  4. Create a puzzle generator.
  5. Add dimensions to the generator. Make code generic over these added dimensions.
  6. Generate puzzles that have only one provable solution.
  7. Create GUI. First with curses then GTK.
  8. Add hints and possibilities features.
  9. Add timer, saved games, import puzzles, etc.

I made it to step 6 before I lost interest.

1

u/Abigboi_ 23d ago

Aside from brain teasers in college, my first real project was PNG en/decryption.

1

u/Due_Sentence_2660 22d ago

Welp my first C project was making tetris (I was using windows at the time so I looked into why `windows.h` sucks lol)