![]() | |
#81
| |||
| |||
|
|
Evertjan. said the following on 3/1/2008 7:33 AM: snip This is certainly NOT off topic in this NG. You don't think that the meaning of words, and the history of the meanings, is off-topic here? Sounds more like it would be better in a group dedicated to the meanings and history of words. |
#82
| |||
| |||
|
|
Thomas 'PointedEars' Lahn wrote: a. The word you were looking for is _deprecated_, not "depreciated". Actually, "depreciated" is the correct word. |
|
Some moron about 75 years ago decided that "deprecated" sounded more kewl, |
#83
| |||||
| |||||
|
|
Jeremy J Starcher said the following on 1/2/2008 11:21 PM: A search for navigator is a better search to use. If a different variable name is used then you miss it. If you search for navigator you will find where it is used or defined. |
|
While I may end up with code that is less efficient than "the best possible code," I believe that these simple things narrow down my choices. As a Javascript novice, I would have found a 'Best Practices' article too much -- well, at least the "Best Practices" I'd end up writing. Have you read Matt's? |
|
(Good grief, can you /imagine/ the discussion about what "best practices" would be like? I doubt we could even agree on a brace style, though K&R did show the only way. *weg*) How they do things in C is irrelevant to how you do them in JS ![]() |
|
Best Practices document discussion? It has already happened here when Matt wrote his. URL: http://groups.google.com/group/comp....browse_thread/ thread/c532483403801387/738bf21b7896d015?lnk=gst&q=matt+kruse+best |
|
And no, you won't get three people in this group to agree on much of anything unless it is a condemnation of anything a particular poster has to say about Javascript. The last time the name was mentioned it got changed out with ** to mask the name. |
#84
| |||||
| |||||
|
|
Dr J R Stockton said the following on 1/2/2008 7:14 AM: In comp.lang.javascript message <4IidnY9-v9gXG-faRVn_vwA (AT) giganews (DOT) com>, Tue, 1 Jan 2008 13:30:25, Randy Webb <HikksNotAtHome (AT) aol (DOT) com> posted: Is this a good use of eval? function convertToDecimal(fraction){ return eval(fraction) } Where fraction is a fraction that you need converted to decimal? It can be written like this: If that string is supplied from outside, then the case is already covered as "not known at run time". Return. Define "supplied from outside". |
|
The string is supplied as the value of a select element. |
|
Otherwise, no : it is not a good use of eval. Evidently the argument 'fraction' is intended to be a string. But a string is not a good way of representing a fraction internally. It is when it is the value of a select element. |
|
A rational fraction should be represented as {Num:n; Den:d} or similar, or as a case of {Typ:F; Num:n; Den:d}, or as a simple case of a structure designed to hold general expressions (a tree for arithmetic notation; an array or list for RPN). Or a simple string. KISS. |
|
It is only bad data design that makes the use of 'eval' seem appropriate for that purpose. It isn't bad data design at all. When you need a number in two forms - both decimal and fraction - and you choose which one to use where, the best way is to keep the fraction as a string and convert it to decimal when needed. |
#85
| |||||
| |||||
|
|
On Thu, 03 Jan 2008 09:21:57 -0500, Randy Webb wrote: Jeremy J Starcher said the following on 1/2/2008 11:21 PM: A search for navigator is a better search to use. If a different variable name is used then you miss it. If you search for navigator you will find where it is used or defined. Should be used in combination, since I GoogleCode provided these "gems" in on the search of "lang:javascript isie" var IsIE = (document.all) var isIE=(window.ActiveXObject) var isIE = document.createElementNS==null; |
|
/* DOUBLE YECK */ var isIE = navigator.appName == 'Microsoft Internet Explorer' ? 1 : 0; While I may end up with code that is less efficient than "the best possible code," I believe that these simple things narrow down my choices. As a Javascript novice, I would have found a 'Best Practices' article too much -- well, at least the "Best Practices" I'd end up writing. Have you read Matt's? Of course. Since you've stated multiple time you think a 'Best Practices' document is the way to go, I had assumed you wanted something more comprehensive. |
|
(Good grief, can you /imagine/ the discussion about what "best practices" would be like? I doubt we could even agree on a brace style, though K&R did show the only way. *weg*) How they do things in C is irrelevant to how you do them in JS ![]() As I've been told more than once here lately. JS *did* borrow braces from C, so we should at least borrow how to USE them too. *evil grin* |
|
Best Practices document discussion? It has already happened here when Matt wrote his. URL: http://groups.google.com/group/comp....browse_thread/ thread/c532483403801387/738bf21b7896d015?lnk=gst&q=matt+kruse+best +practices# Now that I've not read ... yet. Will most likely be lunchtime entertainment. |

|
And no, you won't get three people in this group to agree on much of anything unless it is a condemnation of anything a particular poster has to say about Javascript. The last time the name was mentioned it got changed out with ** to mask the name. Ah.. usenet. Somethings never change. We couldn't agree on a lot in Unix shell scripting either. |
#86
| |||
| |||
|
|
In article <qqOdnWNTP6hgb-HaRVn_vwA (AT) giganews (DOT) com>, Randy Webb <HikksNotAtHome (AT) aol (DOT) com> wrote: Evertjan. said the following on 3/1/2008 7:33 AM: snip This is certainly NOT off topic in this NG. You don't think that the meaning of words, and the history of the meanings, is off-topic here? Sounds more like it would be better in a group dedicated to the meanings and history of words. I didn't see the posts that led to the above, but if the use of the word 'deprecate' is appropriate in this NG, as would seem very likely, then a brief discussion which might avoid the incorrect use of a similar sounding or looking word is relevant here. |
#87
| |||
| |||
|
|
Thomas 'PointedEars' Lahn wrote: a. The word you were looking for is _deprecated_, not "depreciated". Actually, "depreciated" is the correct word. Some moron about 75 years ago decided that "deprecated" sounded more kewl, and got the two words hopelessly confused. Properly, to deprecate something is to pray to be protected from it, ee.g.: snip |
|
From all fornycacion and all deadly synne, and from all the deceiptes of the worlde, the fleshe, and the devill: Good lorde deliver us. snip |
#88
| |||
| |||
|
|
On Jan 2, 4:00*pm, Dr J R Stockton <j... (AT) merlyn (DOT) demon.co.uk> wrote: In comp.lang.javascript message <8331b1ee-5f11-4391-bdc6-05d427912e5f@e2 6g2000hsh.googlegroups.com>, Tue, 1 Jan 2008 16:35:16, David Mark dmark.cins... (AT) gmail (DOT) com> posted: *Another reason to minify is that compression (when available) will only reduce comment bulk, whereas minification eliminates it. ISTM wrong always to use something that eliminates all comment, even on a fully-commercial page not intended to be read. *Comment explaining the code should be removed; but comment identifying the source and date can be worth retaining. Absolutely. I typically add copyright and version information at the top after minification. |
#89
| |||
| |||
|
|
On Jan 2, 11:21*pm, Jeremy J Starcher <r3... (AT) yahoo (DOT) com> wrote: On Wed, 02 Jan 2008 12:18:12 -0500, Randy Webb wrote: If it is going into a "Bad Code" document then shouldn't you endeavor to show the best possible way to do it? And that is why I said that I thought that a Best Practices document is a better way to go than a Bad Practices document. The Best document can have an end to it, the Bad document can never ever cover all the bad code you might (and probably will) encounter on the web. Its not my goal to show every single thing that can make for bad code, but I do believe that there are a /small/ and /limited/ number of things that truly awful code will have in common. When I am trying to find a code snippet that will do something I need, the *first* thing I do is search for the variable "isIE". * If not found, Similarly, any hits for "userAgent" indicate that the code can be dismissed out of hand. |
#90
| |||
| |||
|
|
If for example I discuss that a woman I once knew got turned on by talking about code, programming, and hence JavaScript -- would sexual geek fetishes be on-topic here? |

![]() |
| Thread Tools | |
| Display Modes | |
| |