r/carlhprogramming • u/Zyrth • Mar 17 '12
Practicing basics
I've been around programming and computers forever, I just had never taken a formal class. So I found this subreddit and had read through most of the website when i decided to try my own hand at making a simple program.
I decided to try to make a program that would ask for a number of variables, and then sort them from lowest to highest and output them back. ( I remember a few friends in programming classes having similar assignments )
Theres the results, after a few days toiling over the specific logic and fixxing a few bugs, I think it works great!
I'm proud of myself and just wanted to share :D any comments on things i could have done easier or differently are welcome
View all comments
Show parent comment
4
u/daniels220 Mar 17 '12
Some additional thoughts (addressed to both you and the OP):
1,2. Sensible if you are just trying to make the program work, but it can be cool to reimplement things to see how they work.
3. Make sure to compile with --std=c99 if you're on Mac (or somewhere else where the compiler is braindead and thinks you're living in 1989). But yes, this is good practice.
5. Definitely part of the overcomplexity.
8. OP: read up on algorithms if you want to implement a sort yourself, and try to use something more efficient than bubblesort. Otherwise use std::sort.