Jump to content

How important is 'organized' code?


SarahG

Recommended Posts

Wondering everyone's opinion on this... How important is it to you to have your code organized well? By that I mean indented, line breaks, comments etc. Also do you follow a particular nomenclature and if so, why?

 

I had this debate with a colleague recently when they produced code that was a but of a mess, hard to read and (IMO) hard to maintain as a result. To their point, what difference does it really make, if it works?

 

What do you think?

Link to comment
Share on other sites

I think it's hugely important. In my experience there is always going to be someone, at some point, who needs to be able to look at your code and understand it. If you variable names are all useless and you lack comments and line breaks it's going to be a real headache for that person. On top of that, it makes debugging a ton easier.

Link to comment
Share on other sites

I think it is very important, especially in a situation where others are going to read or make future amendments. And I think it also shows your professionalism, if you arrange very roughly, chances are you are not all that good and otherwise shows the exact opposite. I remember when I was going to make some changes on a website some guy created, the codes were not only bogus but the arrangement was just too muddled up. I was pissed, is an understatement.

 

I find myself writing codes on a straight line or a slant like style. And I'm always keeping everything on different lines e.g a variable on a line, another on another line. If I was going to write HTML codes for a page I'm going to do it like the below:

 

<html>
<head>
<title>this is the title</title>
</head>
<body>
<div>This is a div tag</div
</body>
</html>
Link to comment
Share on other sites

I agree with Jay Mum and CyberGenius. I like to have my code and organized. If people are finding it difficult to read because there are no line or paragraph breaks, they would get frustrated and probably want to move on and go to another site. I don't want to frustrate my visitors while they're on my site, and it's important that my website looks as clean and professional as possible.

Link to comment
Share on other sites

I agree with Jay Mum and CyberGenius. I like to have my code and organized. If people are finding it difficult to read because there are no line or paragraph breaks, they would get frustrated and probably want to move on and go to another site. I don't want to frustrate my visitors while they're on my site, and it's important that my website looks as clean and professional as possible.

 

I'm talking about code, not websites. But yes clean and professional websites are important too  :thumbsup:

Link to comment
Share on other sites

  • 2 weeks later...
  • Administrators

Yup same here.  It's overwhelming working on others code that is not kept organized.  Even my own before I consider a project complete I have to open each file and double check all spacing, indents ect....

Link to comment
Share on other sites

  • 3 months later...

 

I think it is very important, especially in a situation where others are going to read or make future amendments. And I think it also shows your professionalism, if you arrange very roughly, chances are you are not all that good and otherwise shows the exact opposite. I remember when I was going to make some changes on a website some guy created, the codes were not only bogus but the arrangement was just too muddled up. I was pissed, is an understatement.

 

I find myself writing codes on a straight line or a slant like style. And I'm always keeping everything on different lines e.g a variable on a line, another on another line. If I was going to write HTML codes for a page I'm going to do it like the below:

<html>
<head>
<title>this is the title</title>
</head>
<body>
<div>This is a div tag</div
</body>
</html>

 

I agree with you 100% about professionalism, I remember in school my classmates never indented their code which made it a huge pain in the ass to help troubleshoot. No matter how many times I would tell them their code would always look like a mess.

 

I wanted to ask though why you code your HTML like that? Usually HTML is considered best to be indented however with static HTML files basically nonexistent on the web these days and template systems that garble up your HTML before displaying it, I must admit that it is more difficult to get the results you want.

Edited by crazycroc
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...