473,624 Members | 2,223 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Brackets and the Invention of CSS

Is there some particular reason that the inventors of CSS chose
to leave us with the legacy of the curly brackets (for which one
has to shift press) rather than the square (for which one simply
has to press)?

p [margin: 0;]

is two key presses shorter then

p {margin: 0;}

Multiply that by a few billion over the world of css, taking in
to account a lot of consequences including the bigger chance of
typos and revisions, the greater expenditure of energy on people
and processors, more wear and tear on the keyboard.

--
dorayme
Nov 24 '07 #1
37 2501
dorayme wrote:
Is there some particular reason that the inventors of CSS chose
to leave us with the legacy of the curly brackets (for which one
has to shift press) rather than the square (for which one simply
has to press)?

p [margin: 0;]

is two key presses shorter then

p {margin: 0;}

Multiply that by a few billion over the world of css, taking in
to account a lot of consequences including the bigger chance of
typos and revisions, the greater expenditure of energy on people
and processors, more wear and tear on the keyboard.
Square brackets are for attribute selectors. A useful but not often used
feature because of IE.

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
Nov 24 '07 #2
In article <4d************ *************** @NAXS.COM>,
"Jonathan N. Little" <lw*****@centra lva.netwrote:
dorayme wrote:
Is there some particular reason that the inventors of CSS chose
to leave us with the legacy of the curly brackets (for which one
has to shift press) rather than the square (for which one simply
has to press)?

p [margin: 0;]

is two key presses shorter then

p {margin: 0;}

Multiply that by a few billion over the world of css, taking in
to account a lot of consequences including the bigger chance of
typos and revisions, the greater expenditure of energy on people
and processors, more wear and tear on the keyboard.

Square brackets are for attribute selectors. A useful but not often used
feature because of IE.
So... are you are implying perhaps that it was anticipated that
the square brackets would have been used more often?

--
dorayme
Nov 24 '07 #3
In article
<do************ *************** *******@news-vip.optusnet.co m.au>,
dorayme <do************ @optusnet.com.a uwrote:
Is there some particular reason that the inventors of CSS chose
to leave us with the legacy of the curly brackets (for which one
has to shift press) rather than the square (for which one simply
has to press)?
Perhaps to build upon existing conventions. Perhaps on some keyboards
square brackets actually are harder to type. Perhaps they tossed a coin.
p [margin: 0;]

is two key presses shorter then

p {margin: 0;}
So is p {margin:0}

--
Sander Tekelenburg
The Web Repair Initiative: <http://webrepair.org/>
Nov 24 '07 #4
On 2007-11-24, dorayme wrote:
>

Is there some particular reason that the inventors of CSS chose
to leave us with the legacy of the curly brackets (for which one
has to shift press) rather than the square (for which one simply
has to press)?

p [margin: 0;]

is two key presses shorter then

p {margin: 0;}
It's only one key press shorter for me; when I press { in a .css
file, the closing brace is automatically inserted.
Multiply that by a few billion over the world of css, taking in
to account a lot of consequences including the bigger chance of
typos and revisions, the greater expenditure of energy on people
and processors, more wear and tear on the keyboard.

--
Chris F.A. Johnson <http://cfaj.freeshell. org>
=============== =============== =============== =============== =======
Author:
Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
Nov 24 '07 #5
dorayme <do************ @optusnet.com.a uwrites:
Is there some particular reason that the inventors of CSS chose
to leave us with the legacy of the curly brackets (for which one
has to shift press) rather than the square (for which one simply
has to press)?
I suspect it's a question of familiarity - JavaScript, C, Perl, and
many other languages with which many web developers may be familiar
all use curly brackets.

By contrast, not too many devs are writing web apps in SmallTalk or
Objective-C. Even fewer than there once were, no thanks to Apple. :-(

[ObjC retain];

sherm--

--
WV News, Blogging, and Discussion: http://wv-www.com
Cocoa programming in Perl: http://camelbones.sourceforge.net
Nov 24 '07 #6
In article <us************ ************@te xtnews.euro.net >,
Sander Tekelenburg <us**@domain.in validwrote:
In article
<do************ *************** *******@news-vip.optusnet.co m.au>,
dorayme <do************ @optusnet.com.a uwrote:
Is there some particular reason that the inventors of CSS chose
to leave us with the legacy of the curly brackets (for which one
has to shift press) rather than the square (for which one simply
has to press)?

Perhaps to build upon existing conventions.
Which were?
Perhaps on some keyboards
square brackets actually are harder to type.
Well, that is a question, I might be seeing a biassed sample here
in Australia?
>
p [margin: 0;]

is two key presses shorter then

p {margin: 0;}

So is p {margin:0}
How do you figure this? And what is its relevance?

--
dorayme
Nov 24 '07 #7
In article <pc************ @xword.teksavvy .com>,
"Chris F.A. Johnson" <cf********@gma il.comwrote:
On 2007-11-24, dorayme wrote:


Is there some particular reason that the inventors of CSS chose
to leave us with the legacy of the curly brackets (for which one
has to shift press) rather than the square (for which one simply
has to press)?

p [margin: 0;]

is two key presses shorter then

p {margin: 0;}

It's only one key press shorter for me; when I press { in a .css
file, the closing brace is automatically inserted.
I vaguely recall something like this on this winbox I fire up now
and then (in a pgm called Topstyle). Similar perhaps is BBEdit's
built in control + 1 getting <h1></h1with the cursor seemingly
conveniently in between. All very well in a way. There are
drawbacks of course: you are typing away and you want a level one
heading and quickly realise it is a level 2 you want, oops... you
have to change two numbers. The normal typing way of putting the
opening tag would give you a chance (if you realise just after
typing the first 1) to merely back space on and carry on.

That reminds me, there is a whole lot of shifting going on for
for < and the greater than. But in this case, the inventors could
hardly have chosen instead the "," and "."

Perhaps a special html/css board is needed. <g>
Multiply that by a few billion over the world of css, taking in
to account a lot of consequences including the bigger chance of
typos and revisions, the greater expenditure of energy on people
and processors, more wear and tear on the keyboard.
--
dorayme
Nov 24 '07 #8
In article <m1************ @dot-app.org>,
Sherman Pendley <sp******@dot-app.orgwrote:
dorayme <do************ @optusnet.com.a uwrites:
Is there some particular reason that the inventors of CSS chose
to leave us with the legacy of the curly brackets (for which one
has to shift press) rather than the square (for which one simply
has to press)?

I suspect it's a question of familiarity - JavaScript, C, Perl, and
many other languages with which many web developers may be familiar
all use curly brackets.
Yes, I suspect this is probably the direct or indirect
motivation. I recall programming in Microsoft QuickBasic on a Mac
SE and there were few brackets involved and when they were they
were round or square (Remember those days Sherm?). Oddly enough I
forget about the later FutureBasic which I had to move to with
the PowerPC chip... I suppose Javascript and C and Perl are very
old compared to CSS...

--
dorayme
Nov 24 '07 #9
On 2007-11-24, dorayme <do************ @optusnet.com.a uwrote:
In article <us************ ************@te xtnews.euro.net >,
Sander Tekelenburg <us**@domain.in validwrote:
>In article
<do*********** *************** ********@news-vip.optusnet.co m.au>,
dorayme <do************ @optusnet.com.a uwrote:
Is there some particular reason that the inventors of CSS chose
to leave us with the legacy of the curly brackets (for which one
has to shift press) rather than the square (for which one simply
has to press)?

Perhaps to build upon existing conventions.

Which were?
It's common in programming languages for {} to go around bigger blocks
of stuff consisting of a few lines or more.

C, Tcl, Java, JavaScript, Perl, and Ruby are all examples where this is
the case.

I think you'd tend to use {} even when writing on paper with a pencil
for large blocks of stuff. So maybe that's where it comes from. () is
used in expressions like (2+3)*5, [] usually for array and/or dictionary
access, like a[2] or a["foo"], and {} to enclose several lines at a
time.
Nov 24 '07 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

21
12944
by: deko | last post by:
Do I need to use curly brackets in PHP if .. else statements? other constructs? Does it matter? What are Best Practices? Why? thanks in advance... This seems to work WITHOUT curly brackets: if(ereg("Win", getenv("HTTP_USER_AGENT"))) $visos = "Windows"; elseif((ereg("Mac", getenv("HTTP_USER_AGENT"))) || (ereg("PPC",
3
3341
by: Eric Ellsworth | last post by:
Hi all, Does anyone have any bright ideas for Access' tendency to add square brackets when it parses queries, then tell you that the query syntax is invalid. In my case, I'm trying to do a LEFT JOIN on a subquery, like so: SELECT DISTINCT . FROM LEFT JOIN (SELECT FROM targetMarkers WHERE targetID = Forms!frmTargetDetails ) as TM ON . = targetMarkers. WHERE (((targetMarkers.) Is Null));
7
6808
by: Brian Henry | last post by:
i was just looking at the tcplistener example on the MSDN docs and saw this Dim bytes(1024) As Dim data As = Nothing the data types ar ein brackets, what is the significance of the brackets? and when i type them into vb.net 2003 the brackets remove themself... why are they there, what do they do? thanks!
1
4282
by: Greg Strong | last post by:
Hello All, Why would brackets be added to the SQL of a pass through query to Oracle? If I paste the debug print of the SQL statement into SQLPlus of Oracle's XE edition it works, and does NOT have brackets around the tablespace preceding the table name. However when I create the pass through query in VB brackets are placed around the tablespace, and the pass through query does NOT work. If I eliminate the brackets around the...
4
3957
by: Nunzio | last post by:
I am trying to build an email address in PHP code using v5.1.2. All works well until I try to surround the email address with angle brackets. Every method I try causes the email address to disappear completely. I have to believe that this is a common problem, but I can't find any answers in the PHP docs or in Google. Any insight would be greatly appreciated. Below are some of my failed attempts. $strAddressee = "$ContactName...
0
8174
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8680
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8624
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
5565
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4082
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4176
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2607
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1786
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1485
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.