473,386 Members | 1,733 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Conditional Compilation: add to Gecko

VK
Taking into account many new features in JavaScript1.6 and
JavaScript1.7 which are syntactically incompatible with Javascript
versions run on other browsers: would it be reasonable to propose as
"new feature request" at bugzilla.mozilla.org the conditional
compilation mechanics. Obviously this mechanics has to be then fully
compatible with the existing one for IE:
http://msdn2.microsoft.com/en-us/lib...t1(VS.71).aspx
and further links.

JScript sample:

<script>
/*@cc_on @*/
/*@if (@_jscript_version < 5.5)
window.alert('JScript below 5.5');
@elif (@_jscript_version >= 5.5)
window.alert('JScript 5.5 or higher');
@else @*/
window.alert('Not a JScript parser');
/*@end @*/
</script>

For the seamless accommodation it is needed to add to the list of
conditional compilation variables extra two:

@_javascript
Always returns true for Gecko platforms.
Respectively @_jscript always returns false for Gecko platforms.

@_javascript_version with possible values 1.5, 1.6, 1.7, (1.8, ..)

IMO it is the only way to have any use out of extra features in a
cross-browser way: leaving out different hacks with dynamic "<script>"
write and separate .js files for different browsers.

Any opinions on that?
Dec 18 '07 #1
10 1743
VK
On Dec 18, 5:08 pm, VK <schools_r...@yahoo.comwrote:
Taking into account many new features in JavaScript1.6 and
JavaScript1.7 which are syntactically incompatible with Javascript
versions run on other browsers: would it be reasonable to propose as
"new feature request" at bugzilla.mozilla.org the conditional
compilation mechanics?
If anyone has an opinion on that and Bugzilla account she/he can also
comment at https://bugzilla.mozilla.org/show_bug.cgi?id=408835

In the latter case a possible "excited lexicon" of some clj posters
should be avoided so preserved for clj itself ;-)
Dec 18 '07 #2
VK said the following on 12/18/2007 9:08 AM:
Taking into account many new features in JavaScript1.6 and
JavaScript1.7 which are syntactically incompatible with Javascript
versions run on other browsers: would it be reasonable to propose as
"new feature request" at bugzilla.mozilla.org the conditional
compilation mechanics.
No, it would be a stupid idea. It will put you back in the days of
language="javascript1.2".

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Dec 18 '07 #3
VK
On Dec 19, 2:54 am, Randy Webb <HikksNotAtH...@aol.comwrote:
No, it would be a stupid idea. It will put you back in the days of
language="javascript1.2".
IMHO right the opposite, it would take us away from the old times with
separate files for separate situations. Though Brendan Eich seems to
think that "javascript1.2" way is still good enough and I'm of course
not in the position to enforce my opinion onto Gecko team: see
responses at
https://bugzilla.mozilla.org/show_bug.cgi?id=408835

Dec 19 '07 #4
VK said the following on 12/19/2007 12:04 AM:
On Dec 19, 2:54 am, Randy Webb <HikksNotAtH...@aol.comwrote:
>No, it would be a stupid idea. It will put you back in the days of
language="javascript1.2".

IMHO right the opposite, it would take us away from the old times with
separate files for separate situations. Though Brendan Eich seems to
think that "javascript1.2" way is still good enough and I'm of course
not in the position to enforce my opinion onto Gecko team: see
responses at
https://bugzilla.mozilla.org/show_bug.cgi?id=408835
That is not even close to what Brendan was talking about in that thread.
It is nice to see that people outside of c.l.j can't understand you either.
--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Dec 19 '07 #5
VK said the following on 12/19/2007 12:04 AM:
On Dec 19, 2:54 am, Randy Webb <HikksNotAtH...@aol.comwrote:
>No, it would be a stupid idea. It will put you back in the days of
language="javascript1.2".

IMHO right the opposite, it would take us away from the old times with
separate files for separate situations. Though Brendan Eich seems to
think that "javascript1.2" way is still good enough and I'm of course
not in the position to enforce my opinion onto Gecko team: see
responses at
https://bugzilla.mozilla.org/show_bug.cgi?id=408835
Just for kicks and giggles:

<quote cite="VK in URL above">
IMO it is the only way to have any use out of extra features in a
cross-browser way: leaving out different hacks with dynamic "<script>"
write and separate .js files for different browsers.
</quote>

Do you ever stop and think about what you are writing before you write it?
--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Dec 19 '07 #6
VK
On Dec 19, 8:41 am, Randy Webb <HikksNotAtH...@aol.comwrote:
<quote cite="VK in URL above">
IMO it is the only way to have any use out of extra features in a
cross-browser way: leaving out different hacks with dynamic "<script>"
write and separate .js files for different browsers.
</quote>

Do you ever stop and think about what you are writing before you write it?
Fine, rather than to be proven to be an idiot by Brendan Eich I prefer
to be proven to be an idiot by Randy Webb. As I guess the pleasure
should be mutual.

When server gets the request from client then it has two options: i)
choose the right script to send out of several or ii) to send single
script that will accommodate itself at runtime server-side. AFAIK the
second option is currently prevailing. This way I do not understand
the reasoning of using language or type attribute for script tag. And
if we heed runtime client-side accommodation then why do we need to
depend on unreliable feature detection that can be easily spoofed and
even if not then doesn't guarantee that this is _that_ method with
_that_ outcome?
After long time forgotten conditional compilation has been "re-
discovered" everyone just jumped on it as the only really reliable
detection method. So instead of
if (windows.ActiveXObject)
it is now /*@cc_on */ etc
because it is the only one bringing some trust to the developer. So
why the same thing which is great for one application is evil for
other? That would be the case if we had the situation of 1997/98
"whatever is not X - is Y" but we have not this situation as of now.

Just some idiotic thoughts of mine...
Dec 19 '07 #7
VK
On Dec 19, 11:08 am, VK <schools_r...@yahoo.comwrote:
When server gets the request from client then it has two options: i)
choose the right script to send out of several or ii) to send single
script that will accommodate itself at runtime server-side.
.... will accommodate itself at runtime client-side

Damn it. However obvious the typo is, I hope it will not become the
main subject of the discussion.

Dec 19 '07 #8
VK said the following on 12/19/2007 3:08 AM:
On Dec 19, 8:41 am, Randy Webb <HikksNotAtH...@aol.comwrote:
><quote cite="VK in URL above">
IMO it is the only way to have any use out of extra features in a
cross-browser way: leaving out different hacks with dynamic "<script>"
write and separate .js files for different browsers.
</quote>

Do you ever stop and think about what you are writing before you write it?

Fine, rather than to be proven to be an idiot by Brendan Eich I prefer
to be proven to be an idiot by Randy Webb. As I guess the pleasure
should be mutual.
Yippeeeeee, I get to be proven an idiot by VK. This should be
entertaining. Hold on to your britches. It's gonna be a blast.
When server gets the request from client then it has two options: i)
choose the right script to send out of several or ii) to send single
script that will accommodate itself at runtime client-side. AFAIK the
second option is currently prevailing.
I changed the text above to reflect your self-correction. The second
option prevails because it is the most reliable option. Hands down.
This way I do not understand the reasoning of using language or type
attribute for script tag.
Because some pedantic moron at the W3C decided it should be mandatory
when it is typically useless.
And if we heed runtime client-side accommodation then why do we need to
depend on unreliable feature detection that can be easily spoofed and
even if not then doesn't guarantee that this is _that_ method with
_that_ outcome?
You have that same problem with the first option. Anything the browser
tells the server is spoof-able. So, how is it any more reliable to let
the server decide what to send if what it is being told is 100% spoof-able?
After long time forgotten conditional compilation has been "re-
discovered" everyone just jumped on it as the only really reliable
detection method.
They did? I haven't seen 20 posts in the last two years that used it and
about half of those are my own posts. So I don't see where "everyone
just jumped on it".
So instead of
if (windows.ActiveXObject)
it is now /*@cc_on */ etc
because it is the only one bringing some trust to the developer.
Any developer that does that is ignorant at best.
So why the same thing which is great for one application is evil for
other?
I have never thought of conditional compilation great for anything. I
use it as a self-admitted crutch and am leaning heavily towards a
different test in the one place I use it.
That would be the case if we had the situation of 1997/98
"whatever is not X - is Y" but we have not this situation as of now.
And that is what you are advocating doing again? You want it so that you
can distinguish between IE, Gecko, and any others? That is right back
where you started in 1997. 10 years of evolution to get right back where
you started. That isn't a step forward, it is 100 steps backwards.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Dec 19 '07 #9
VK
On Dec 20, 1:58 am, Randy Webb <HikksNotAtH...@aol.comwrote:
Fine, rather than to be proven to be an idiot by Brendan Eich I prefer
to be proven to be an idiot by Randy Webb. As I guess the pleasure
should be mutual.
Yippeeeeee, I get to be proven an idiot by VK. This should be
entertaining. Hold on to your britches. It's gonna be a blast.
I guess it is my problem in the Usenet. In my own company I am ideas
generator rather than end-developer though I was in the latter
position for many years. This way I have a person who can make a
decent coffee for me and a person who takes my hints on the fly to
make anything out of them - or to prove them to be a trash. While the
coffee is not a crucial problem if I'm left alone - I still can make
myself something caffeine-containing: the habit to express only the
most necessary from my point of view positions hits me often, as I
don't have the regular guy to explain "VK meant to say..."

Any way: "VK meant to say: it will be more pleasurable to be proved to
be an idiot by Randy Webb rather than by Brendan Eich: whatever
'pleasure' it could be as such. It also should be pleasurable to Randy
Webb to prove once again that VK is an idiot. This way the pleasure
should be mutual".
Ooh.. I'm glad I'm keeping that guy on the salary...
Dec 19 '07 #10
VK said the following on 12/19/2007 6:43 PM:

<snip>
Ooh.. I'm glad I'm keeping that guy on the salary...
I know a lot of people that would be glad if you let him post to Usenet
for you.
--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Dec 20 '07 #11

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

Similar topics

11
by: Steven T. Hatton | last post by:
I've made no secret of the fact that I really dislike the C preprocessor in C++. No aspect of the language has caused me more trouble. No aspect of the language has cause more code I've read to be...
2
by: Steve Jorgensen | last post by:
To begin with an example... Let's say you were wanting to write code usign early binding to the MSXML library, but then be able to switch between early and late binding at will. Conditional...
1
by: chris han | last post by:
Hi, all, I'm trying to use Conditional Compilation Statements in my code. using System; #define DEBUG public class MyClass { public static void Main() {
12
by: wanghz | last post by:
Hi, Could I ask some questions about the conditional compilaion? Suppose I have three simple files: a.c, b.c and c.h /* --------a.c--------- */ #include <stdio.h> #include "c.h" int...
2
by: FireStarter | last post by:
Guys, in the code that follows, why does the method F() still compile, even if DBG is undefined? Inside method G(), the code inside <#if DBG> does not compile (notice that I can write whatever I...
1
by: A.M-SG | last post by:
Hi, We have a solution with several c# projects within it. How can I define solution wide conditional compilation symbols?
4
by: Bob | last post by:
Hi, In VS2003 conditional compilation constants and their state could be defined at project level. I was using this to control what features where offered by various builds. i.e....
10
by: Dave | last post by:
I'm a C++ programmer of many years, trying to get my feet wet in C#. I have a question about conditional compilation. In C++, I would sometimes define a constant in an include file, and then...
6
by: maxwell | last post by:
I'm trying to use the gpp utility (Gnu points to http://en.nothingisreal.com/wiki/GPP) to do conditional compilation in Python, and I'm running into a problem: the same '#' character introduces...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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...

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.