To what standard do you hold your code?

Cosmic

Manners maketh man
Joined
Jul 4, 2009
Messages
12,888
Reaction score
951
FP$
29
If you are writing code for yourself, and you do not expect other people I ever read it, what kind of standards do you enforce? Do you add comments anyway, and make sure everything is tidy, or do you just write the code and get it over with?
 
For stuff I write only for myself, I generally will lean up a tiny bit on the commenting, but not too much. In general, my rule with commenting is that I should only comment when I think a piece of code might not be readable at first glance to someone else. However, when writing stuff only I will probably read, I try to remember that a future version of myself will probably lose a lot of understanding of what I was thinking and essentially become "someone else". 😛

In terms of organization, I habitually try to keep code pretty clean no matter what. I feel like it doesn't take a lot of extra effort, and it always seems worth as much time for myself as it is for other people.
 
I wrote a whole 200,000 line social network project (school project for scholarship) and I think it has a couple comments, mostly because I understand what it does. I'd never want anyone to read it because it would be horrible to go through not knowing exactly what everything does, but I took out of it to make sure even if you're writing something for yourself that someone might one day read it, so take it to a high standard.
 
My main approach is to make code as sectioned as it can be, have a logical relationship with CSS support files, occasional notes between major coding sections and of course, validate code to HTM5 standards or XHTML Strict for older pages which need minor modifications.

I also parallel HTML files with text files, where they can hold heavy amounts of design/coding notes .. as it makes life easy, keeping main HTML as clean as possible, without losing sight of how it all came together in early development stages.

All the best,
Cal 🙂
 
Luke said:
I wrote a whole 200,000 line social network project (school project for scholarship) and I think it has a couple comments, mostly because I understand what it does. I'd never want anyone to read it because it would be horrible to go through not knowing exactly what everything does, but I took out of it to make sure even if you're writing something for yourself that someone might one day read it, so take it to a high standard.
200,000 lines of code for a school project? :O :O :O Are you sure you didn't write 20,000? 😛
 
Hmm.. the only script which I made open-source is a MyBB plugin. A very simple plugin. The others, such as posts exchange and rpg script, I dont give out to others.

I do make every effort to make my code tidy, adding comments etc. I also have my own style of coding. Such as { inline with 'if' and not below 'if'. - PHP.
 
Cosmic said:
If you are writing code for yourself, and you do not expect other people I ever read it, what kind of standards do you enforce? Do you add comments anyway, and make sure everything is tidy, or do you just write the code and get it over with?

I write my code and get over it 🙂
 
Cosmic said:
Luke said:
I wrote a whole 200,000 line social network project (school project for scholarship) and I think it has a couple comments, mostly because I understand what it does. I'd never want anyone to read it because it would be horrible to go through not knowing exactly what everything does, but I took out of it to make sure even if you're writing something for yourself that someone might one day read it, so take it to a high standard.
200,000 lines of code for a school project? :O :O :O Are you sure you didn't write 20,000? 😛

Around 200,000, it was a two year project and involved a lot of different parts to write it and involved developing a heap of features.
 
Back
Top Bottom