Hello,
Question for you. ?
On different sites, source code is viewed differently. For example, some sites nicely align their source code like:
[code]
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN”
“http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml” xml:lang=”en” lang=”en” dir=”ltr”>
<head>
<title>..</title>
</head>
<body>
<p>Text</p>
</body>
</html>
Where as others have everything aligned left, such as:
[code]
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN”
“http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml” xml:lang=”en” lang=”en” dir=”ltr”>
<head>
<title>..</title>
</head>
<body>
<p>Text</p>
</body>
</html>
Is it just preference on how it is done, or are there any “benefits” for each? Ours is aligned like the first, and it seems to me, in my opinion, a waste of bandwidth.
Thanks in advance.
Regards,
[i]Originally posted by PeOfEo [/i]? *sniff* Well how's that for peer pressure?
[B]Lavalamp does not indent, thus making him not cool, because [i]all[/i] of the cool people indent.[/B][/QUOTE]
[i]Originally posted by omega [/i]It looks good because it is good :p. Look indenting is right, if your not indenting, well then you are wrong.
[B]I'm the only developer on my site I guess, and I mainly indent out of habit. I use ctrl+f to find where I want to be anyways (semantic code makes this s0Oo much easier)... I guess indentation just looks good ? [/B][/QUOTE]
[i]Originally posted by webanimal [/i]These forums, for example :p View the source code of any thread page on these forums, and scroll down to the first <script> tag. :eek: Holy shat! Check out that wild indentation! :eek:
[B]I believe some people are compulsive indenters.[/B][/QUOTE]
[i]Originally posted by PeOfEo [/i]Sorry maddox, I guess I'm wrong.
[B]Look indenting is right, if your not indenting, well then you are wrong.[/B][/QUOTE]
[i]Originally posted by webanimal [/i]ASCII art?
[B]Some people's code looks like they are trying to draw a picture of something. What do you call that? I forget.[/B][/QUOTE]
[i]Originally posted by webanimal [/i]Not only do you use tables, but you nest them. ?
[B]I use indentation sometimes for nesting tables[/B][/QUOTE]
These forums, for example View the source code of any thread page on these forums[/QUOTE]
[i]Originally posted by IncaWarrior [/i]Weirdo.
[B]I like tables for layout, they add a nice sort of padding to my source[/B][/QUOTE]
[i]Originally posted by lavalamp [/i]?
[B]Sorry maddox, I guess I'm wrong[/B][/QUOTE]
[i]Originally posted by Paul Jr [/i]YEAH!!! That's the way it should be. ?
[B]I do not indent my mark up; I smush it together to make it as unreadable as possible to everyone but me.[/B][/QUOTE]
[i]Originally posted by omega [/i]
[B]I'm not even going to bother with the standard why CSS should be used schpeil... Ryan REALLY needs to get that on WebDev Faqs tho... [/B][/QUOTE]
[i]Originally posted by omega [/i]
[B]True... but if you're not going to touch a site for 6 months, you should delete it, IMO. [/B][/QUOTE]
[i]Originally posted by Robert Wellock[/i]So you got a PM then?
[B]Who summed the Dark God of XHTML he hears through the ears of many...[/B][/QUOTE]
[i]Originally posted by Robert Wellock[/i]Bring it.
[B]gaze upon one of my non-indented pieces and try decipher where I placed the errors of code judgment - compared to the indented version - I challenge all.[/B][/QUOTE]
[i]Originally posted by webanimal[/i]You'd think so wouldn't you.
[B]Is this like a cult or somthin? [/B][/QUOTE]
[i]Originally posted by webanimal[/i]No, but you would have if you dropped the tables, since I did life has been one big pool party. ?
[B]I wuz wonderin. Do the girls think guys who indent are cool? I mean if I indent, will I get lots of girlfriends?[/B][/QUOTE]
[i]Originally posted by omega[/i]He's got one. :rolleyes:
[B]He really needs a page devoted to him.[/B][/QUOTE]
[i]Originally posted by omega [/i]
[B]Well, I can't relate as I've never had any clients, but I can see your point. I do indent my scripts- especially since I have a bad habit of forgetting the ending curly brace. [/B][/QUOTE]
[i]Originally posted by omega [/i]
[B]Well, Paul, tell me: how could it be straight if it's associated with you?[/B][/QUOTE]
[i]Originally posted by DaveSW [/i]
[B]Anyway, I don't indent my code because it's hand written in html-kit. In consequence it's far superior to anything indented because it's hand written. I have such clean code I don't need to resort to indenting to see where I am. ? [i]That's xhtml-god philosophy.[/i][/B][/QUOTE]
[i]Originally posted by Robert Wellock [/i]
[B]Indentation of both programming code and script is a sensible philosophy only the stupid or foolhardy don't indent script and as for these highlighting IDE's, well you cannot rely on such opulence; notepad is the tool of the trade.[/B][/QUOTE]
[i]Originally posted by Robert Wellock [/i]
[B]A good coder does not indent code for his own benefit, he does it for the benefit of others.[/B][/QUOTE]
[i]Originally posted by Robert Wellock [/i]
[B] gaze upon one of my non-indented pieces and try decipher where I placed the errors of code judgment - compared to the indented version - I challenge all.[/B][/QUOTE]
[i]Originally posted by Robert Wellock [/i]
[B][i]else { $choice=$_POST['chosen']; $sql = "select * from Courses_Exam where Course_code = '$choice' "; $result = mysql_query($sql); echo("<div class='center'><table border='1'>"); echo("<tr><th>Course Name</th><th>Course Code</th><th>Places Available</th></tr>"); while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) { $available = $row['Max_no'] - $row['No_enrolled']; echo("<tr><td>".$row['Course_name']."</td><td>".$row['Course_code']."</td><td>".$available."</td>"); }; echo("</table></div>");
mysql_close($cnx);[/i]
There is one or two errors in the above code if the code was indented you'ld spot one straight way.[/B][/QUOTE]
else
{
$choice=$_POST['chosen'];
$sql = "select * from Courses_Exam where Course_code = '$choice' ";
$result = mysql_query($sql);
echo("<div class='center'>nt<table border='1'>n");
echo("<tr><th>Course Name</th><th>Course Code</th><th>Places Available</th></tr>");
while ($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
$available = $row['Max_no'] - $row['No_enrolled'];
echo("<tr><td>".$row['Course_name']."</td><td>".$row['Course_code']."</td><td>".$available."</td>");
}
echo("</table></div>");
mysql_close($cnx);
}
else{
$choice=$_POST['chosen'];
$sql = "select * from Courses_Exam where Course_code = '$choice' ";
$result = mysql_query($sql);
echo("<div class='center'>nt<table border='1'>n");
echo("<tr><th>Course Name</th><th>Course Code</th><th>Places Available</th></tr>");
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)){
$available = $row['Max_no'] - $row['No_enrolled'];
echo("<tr><td>".$row['Course_name']."</td><td>".$row['Course_code']."</td><td>".$available."</td>");
}
echo("</table></div>");
mysql_close($cnx);
}
[code=php]
else {
$choice = $_POST['chosen'];
$result = mysql_query("SELECT * FROM Courses_Exam
WHERE Course_code
= '". $choice . "'");
echo '<div class="center"><table border="1">' . "n";
echo '<tr><th>Course Name</th><th>Course Code</th><th>Places Available</th></tr>';
while($row = mysql_fetch_array($result)) {
$available = $row['Max_no'] - $row['No_enrolled'];
echo '<tr><td>' . $row['Course_name'] . '</td><td>' . $row['Course_code'] . '</td><td>' . $available . '</td></tr>' . "n";
}
echo '</table></div>' . "n";
mysql_close($cnx);
}
[/code]
[i]Originally posted by PhillMc [/i]
[B]I would have written it as Paul did. 'Course, then again, my niche has been software development for 7 years, I started Web Development about a year ago. I've written apps that consist of 30,000+ lines of code (like my Point of Sale and Inventory Managment System). If I didn't indent those, I would be bald trying to edit it. As for markup, I do not indent. ? [/B][/QUOTE]
[i]Originally posted by Paul Jr [/i]
[B]Solid.
Welcome to The Brotherhood. ? [/B][/QUOTE]
I still can't relate to all you programmers, as I never programmed[/QUOTE]
[i]Originally posted by webanimal [/i]
[B]I am gonna redo my site with tables and css.[/B][/QUOTE]
[i]Originally posted by webanimal [/i]
[B]After we get past the workarounds and incompatability issues, then I will make a website strictly css. [/B][/QUOTE]
[i]Originally posted by skydan [/i]
[B]I agree that CSS is quite hard to get into...[/B][/QUOTE]
I agree that CSS is quite hard to get into, I have spent so many hours tweaking it, but now I'm so proud our CSS works 99% correctly in:[/QUOTE]
[i]Originally posted by skydan [/i]Nah, all you need is a good book, then when you've read and understood the book you need to get practice at it. Workarounds are generally used for IE because it sucks.
[B]I agree that CSS is quite hard to get into[/B][/QUOTE]
[i]Originally posted by webanimal [/i]It's not the language that's the problem, it's the browsers various implementations of it. Attached is a totally CSS start menu that I made recently with some CSS 3, if you view it in Firefox it's great, but IE just has a fit, (there's that IE is crap thing again).
[B]It's the compatiblity issues and workarounds that I see, that makes me think they are not finish with it yet.[/b][/quote]
[i]Originally posted by webanimal [/i]Attached is also a 3 column layout with fully commented source code. It uses a layout technique that Ryan (pyro) devised.
[B]The other day, when I decided to go all css, I went to read on the 3 col thang.[/b][/quote]
[i]Originally posted by webanimal [/i]?
[B]I like my tables, and I like the way they load.[/b][/quote]
[i]Originally posted by webanimal [/i]Yes but all that code only needs to be downloaded once, with tables it has to be downloaded with every page, which is why CSS comes out ahead.
[B]As far as the amount of code is concerned. All the styles pages I have looked at might not have much code in the body, but they have alot in the head or external file.[/b][/quote]
[i]Originally posted by webanimal [/i]So don't use a WYSIWYG editor, I know I don't.
[B]If you use a wysiwyg editor, it's gonna cram all kinds of stuff like spacers in there, and that's a lot of code.[/b][/quote]
[i]Originally posted by webanimal [/i]As long as it's not content then I don't mind. Although exceptions must be made for flash cartoons such as
[B]I'm just curious. What do you people think about these flash elements people are using in their pages now? I don't like it, but it looks good.[/b][/quote]
[i]Originally posted by webanimal [/i]The easiest way is to hit quote, then copy what is in the textarea and then press back and quote someone else, but what I usually to is just copy the quote code, change the name and copy and paste the quote I want.
[B]And, how do you quote several people in the same post? I can only copy and paste one at a time, and it's on a different page.[/B][/QUOTE]
Yes but all that code only needs to be downloaded once, with tables it has to be downloaded with every page, which is why CSS comes out ahead.[/QUOTE]
So don't use a WYSIWYG editor, I know I don't.[/QUOTE]
It's not the language that's the problem, it's the browsers various implementations of it. [/QUOTE]
[i]Originally posted by webanimal [/i]
[B]I still ask the question: Why are all the major websites still using tables? Even Google uses them, and they use very little code.[/B][/QUOTE]
Because I think it would cost too much and take too much time to convert a large commercial website, containing hundreds, if not thousands, of pages, to CSS. It's easier to start the right way when you are building something that large.[/QUOTE]
0.1.9 — BETA 6.17