Sign in to follow this  
  • entries
    97
  • comments
    98
  • views
    50539

Homework.

Sign in to follow this  
caffeineaddict

67 views

So it seems real life has had to interfere for the past couple of days. I had to do some computer science homework yesterday and today. Calculate results of equations that are in Reverse Polish Notation (also called postfix notation). Not really hard, but I probably complicated it more than necessary.

The main gist of the homework was to work with a stack, using push, pop, etc. I wound up using a fair amount of string manipulation and character arrays to extract what I needed [sad]. Like I said, certainly not the most elegant solution, but it works, and I can't complain about working code! Oh, by the way, the strtok() function is very handy for breaking things up based on defined delimiters[smile].

Haven't had much of a chance to work on Reversi, and that sucks.

I do have a question for those more knowledgeable than me. For those of you who have coding jobs, how much emphasis is placed on working code vs. elegant and clean code? I've been sort of worrying about this lately. I can produce working code, but more often than not it's not very elegant, but it gets the job done. I'd very much like some input on this. I know that the ideal situation is nice, clean, elegant code that works.

I've been coding for quite a while now, just recently started college and have become increasingly aware of my coding. Prior to college, basically 0 people ever saw my code besides me, so in this more teamlike environment where we sometimes code up solutions in small groups, i've become sort of self conscious. How could I go about writing better and cleaner code? Any exercises you would recommend?
Sign in to follow this  


0 Comments


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now