Thursday, November 21, 2013

Coding Woes, and Comment Etiquette

Comments, some may argue that they're equally as important as the code itself. When I first learned to code it was mainly little projects done only for myself. I would automate little things or solve problems for Project Euler. Comments were for myself, and the simplicity of the code usually meant that I didn't do much commenting. Ah, that habit came back to bite me today.
Some comments on my A2 submission.
AH! A whole 3 points gone because of sparse commenting on my part. My code worked fine though! Isn't that what matters? No, comments are important, because in a professional or even an academic environment, the code you write isn't just for you. It's for you as well as the people that need to work on it as well, either to adjust it or maintain it. It seems like a small nuisance at first, though it's a habit that is an absolute must for a competent programmer. Success requires communication, something that fast uncommented code doesn't always do very well. So I'll try to stick to the habit of doing so, hopefully so will everyone else, and we can all enjoy good communication in the future.

Monday, November 11, 2013

Linked Lists and Memory

I was recently made aware of one of classmates blogs, quite excellent in my opinion. Besides being impressed with his choice to self host and code it all on his own, he brought up an interesting thing that I feel may not be getting enough attention, though I realize many of us know about it and it may even be covered in 108 for all I know, but I feel should  be something everyone knows. That being pointers and allocation of memory. My classmate made this point with linked lists though it applies to all data structures. Each value is simply a block of memory which points to another block of memory. All together values and pointers form all data structures, languages such as Python just have them built in and made easy for us. A complex understanding may not be immediately necessary with all the processing power available to us, though it's surely a must for more constrained environments.