Closed Thread Icon

Preserved Topic: simple coding question (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=15774" title="Pages that link to Preserved Topic: simple coding question (Page 1 of 1)" rel="nofollow" >Preserved Topic: simple coding question <span class="small">(Page 1 of 1)</span>\

 
butcher
Paranoid (IV) Inmate

From: New Jersey, USA
Insane since: Oct 2000

posted posted 02-05-2001 22:36

I was just wondering how many of you actually use upper and lower case letters in your coding.

i.e. <HTML> or <html>.

Both work fine as far as I know, and I was wondering if there are any good reasons to trouble myself to use the uppercase variety.

I've been learning MySQL lately and noticed that all my books use the uppercase for actual commands, but I'm not sure if it's a habit I should get into, or if it's just done in the books to help differentiate between command words and other variables.

Love to know what you all think on the subject.

Phil
Bipolar (III) Mad Scientist

From: Eastbourne, UK.
Insane since: Mar 2000

posted posted 02-05-2001 23:17

I've mostly always use uppercase when writing my Tags It was something I read when I first started learning html, that stated if you use uppercase, it makes it easier to see your tags and check if you've written code that has errors.

bunchapixels
Neurotic (0) Inmate
Newly admitted
posted posted 02-05-2001 23:19

butcher,
html/javascript/DHTML is, generally speaking, very lenient with coders.
it doesnt bother with little syntactical things like that.
im not too sure about other languages, im sure alot of them are far less forgiving (although JS variables are case sensitive)
with html, ive found that capitalising tags simply helps with reading code - it is far easier to pick out a <TABLE> tag than a <table> tag, IMO. Plus, one has to hold down the shift key to type the "<" and ">" anyway, so why not hold it down?
However, javascript is a slightly different matter. the important thing to realise with this is that it is case sensitive, so whatever conventions you make, just stick to them.
from the training i have had, and the (good) coding i have read, the general convention is to have lower case for variables, unless you have a mix of two words, then you capitalise the first character of the second word:
function getInterest(), myAccount, blueBook, etc etc....
...and it is also case sensitive when declaring Arrays too... {names = new Array('bob', 'billy',...)}
so yeah, that's what i reckon.

JakeB
Paranoid (IV) Inmate

From: us
Insane since: Oct 2000

posted posted 02-05-2001 23:24

if it needs to be capital it wouldn't be too hard to make a program go through and capitalize the stuff between the tags.

WarMage
Maniac (V) Mad Scientist

From: Rochester, New York, USA
Insane since: May 2000

posted posted 02-05-2001 23:25

In actuallity you should probabally use the lower case variation! Sound strange? The reason is, XHTML specifications require that your code be in lowercase. Now this does not mean much now but in the distant future (1 or 2 years) HTML browsers will be replaced by XML browsers, and from there you will need to declair that you are using XHTML and their specifications in order to have your code show up at all.

So it would be my recomendation that you do it the lower case method. I was once yelled at by F1_Error for this mistake, he gave me a link to the W3 XHTML specifications and said this is why. That changed my mind, and I think that it will make the transition much easier in the future when it is required of me to do so.

<off topic> Wouldn't it be nice a nice world where you could simply specify which DTD you wish to use on your website, you could pick the Microsoft version, the mozilla version, or even the W3 version, and everyone would see the site exactly as you want them to.</off topic>

-mage-

mr.maX
Maniac (V) Mad Scientist

From: Belgrade, Serbia
Insane since: Sep 2000

posted posted 02-05-2001 23:32

Just a small addition to WarMage's post above - HTML 4 specification says that tags must be in uppercase. So, how you should write tags actually depends on what DTD you plan to use.

mbridge
Paranoid (IV) Mad Scientist

From:
Insane since: Jun 2000

posted posted 02-05-2001 23:32

I've always used lowercase...I like the looks better, and I hate fooling with the capslock key. XHTML compatibility is a plus too.

la'dsasha
Neurotic (0) Inmate
Newly admitted
posted posted 02-06-2001 00:07

i always use lowercase. its easier on the eyes when trying to read code. WHEN YOU TYPE IN ALL CAPS, IT REMINDS ME OF PEOPLE WHO ARE YELLING AND IT IS VERY VERY ANNOYING. i avoid caps.

------
Hell hath no fury like a woman scorned

mr.maX
Maniac (V) Mad Scientist

From: Belgrade, Serbia
Insane since: Sep 2000

posted posted 02-06-2001 00:17

IMO, lowercase tags look very unreadable... They also remind me on FrontPage generated pages, yuck!

DocOzone
Maniac (V) Lord Mad Scientist
Sovereign of all the lands Ozone and just beyond that little green line over there...

From: Stockholm, Sweden
Insane since: Mar 1994

posted posted 02-06-2001 09:10

Yah, I've been doing a lot of work with XML, and I know from the specs that future versions of the browsers will start to insist we use <lowercase> tags, may as well get used to it now.

Your pal, -doc-

[peer]
Bipolar (III) Inmate

From: Ottawa, Ontario, Canada
Insane since: Apr 2000

posted posted 02-06-2001 14:17

I use lowercase, I like it better... mostly because uppercase tags remind me of Netscape Composer :F

----

WarMage
Maniac (V) Mad Scientist

From: Rochester, New York, USA
Insane since: May 2000

posted posted 02-06-2001 16:01

Doc! You found a use for XML?!?

Could you tell me what you are doing with it? I have been looking to use XML somewhere but just have not been able to come up with any ideas that would be widely supported.

-mage-

butcher
Paranoid (IV) Inmate

From: New Jersey, USA
Insane since: Oct 2000

posted posted 02-06-2001 21:53

I was going to ask the same question of the Doc WarMage. I'm reading a beginers book on XML, and no real usefull practice project has jumped out at me. I'm really not quite sure what to do with it, although I've been told by more than one person that it's the next wave to ride.

WarMage
Maniac (V) Mad Scientist

From: Rochester, New York, USA
Insane since: May 2000

posted posted 02-06-2001 23:18

The only thing that I have found it useful for is an easy way of parsing documents. It presents a clear an concise method to find different tags and to get information from them onto a document that I have.

It is much easier to get infromation out of something that looks like

<product>Sun Tan Lotion</product>

than

<td>Sun Tan Lotion</td>

But as of now, setting up a standard display format to work with XML is a little behind the times, you can use the IE 5.5 capabilities for display but they are still not yet widely supported.

So as it is XML is now useful for situations where you are not attempting to display the information in a web context but rather have the information in database transfers or in application to database tie ins.

The option for the web would be to have both XML representation and an HTML representation, but that is a bit of a bother code wise, updating two documents that represent the same data...

XML just doesn't have the standard support yet.

But if it is being used, there must be some greater good to it that I am still missing.

-mage-

« BackwardsOnwards »

Show Forum Drop Down Menu