| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
|
|
|
|
#23 (permalink) | |
|
Web Developer
Join Date: Oct 2006
Posts: 2,007
|
Quote:
No offence, but you are saving nothing by writing css like that. Because it isn't clearly set out you have several errors in there which are hard to spot at a quick glance. Firstly. What's the point in this when there are no curly braces afterwards with attributes in? Code:
Secondly, you aren't being consistent, now you include the curly braces Code:
Thirdly, you have the word "solid" randomly in there, which I can only guess is the remains of a border attribute that was there at some point. Code:
Don't mean to be such an ass, but encouraging people to code this way is not constructive at all. I'm by no means perfect but find the following the most readable way of writing code. Code:
This is designed to be a constructive criticism which I hope you find helpful. I do not mean to be patronizing at all, but apologize if that is how you feel this message comes across. |
|
|
|
|
#24 (permalink) |
|
Grumpy old man
Join Date: Oct 2007
Location: North Japan
Posts: 1,457
|
I usually aim to write code that is more or less self commenting by using descriptive function names, variables etc. Same with CSS. It's not really hard to guess what these functions do: function dbAddNewUser(...) function dbDeleteUserRecordByID($id) function dbGetUserRecordByLastName($lastname) I used to comment like mad. These days I only comment if I've done something weird or slightly obscure and I want to remind myself why I did it. Or occasionally if I use some kind of hack to solve a problem, I usually leave a comment with the intention of going back later and figuring out a better, cleaner way (although I rarely do). |
|
|
|
#26 (permalink) |
|
I like code.
|
I usually don't comment my code, unless I am creating a large library and lots of people will be using. Code { for thought }
"My programs never have bugs, they just develop random features." |
|
|
|
#27 (permalink) |
|
Interactionist
Join Date: Sep 2006
Location: Manchester
Posts: 174
|
I'm a front-end developer and I comment my code when I'm working with others on it, although I think my class/ID names are pretty self explanatory. I only ever put a line in my code, but tend to create a text file will a dictionary of all my class names, ID's, colour hex codes, images and how I've approached certain things. |
|
|
|
#28 (permalink) |
|
Trained to Kill.
|
If you cant read html or css without comments get another job. Sometimes programming requires it but all comes down to the scale, I find I comment alot when I'm using different technologies together such as web services and PHP or flex and RPC. I comment important things that are easily forgotten. |
|
|
|
#29 (permalink) |
|
Trailer Trash™
Join Date: Sep 2006
Posts: 851
|
comment if it's not clear, or if you need documentation to be auto-generated "# this method is called add_two_integers, it takes two integers and returns an integer" is a waste of space "# method to return the sum of widgets & wodgets" is ok, but still superfluous if your method is called "sum_of_widgets_and_wodgets" mind you, if it's not clear, it's crap code… (odd algorithms—or obfuscating your genius—excepted) i add comments to partial templates when doing dynamic pages simply so i can see what partial is responsible for what html easily ... <!-- foo.list.tmpl --> <ul> <li> ... etc., but i seldom bother with static html meh.
|
|
|
|
#30 (permalink) | |
|
i'm done, son
Join Date: Jan 2005
Posts: 12,262
|
Quote:
|
|
|
![]() |