![]() | |
![]() |
| | Thread Tools | Display Modes |
#11
| ||||
| ||||
|
|
I think people who put too much emphasis on curly braces are really spending too much time on the wrong topic. As an example, they have names for this stuff - a curly brace on the side is called "K&R style" or "One True Brace Style" (1TBS or OTBS). Give me a break. (http://en.wikipedia.org/wiki/Indent_style#K.26R_style) That page also describes others styles - interesting reading for geeks. My personal preference is to put the brace below the code (BSD/Allman style for those who care). With the quality of software these days at an all-time low I'm not surprised when I see so much rhetoric focused on where the brace is, rather than whether the code between the braces actually works. |
|
VS2005 has an IDE flag that lets you toggle where the brace will go. In that world the argument is over. Don't like the way someone wrote their code? Hit a switch. The argument is over. |
|
In the interest of portability and consistency, I personally like to see JavaScript with semicolons - in many cases the exact same code can be pasted into Java or C# and work with few changes - and I've been able to paste C# code into a script block with very little syntactical grief as well. In the argument about which is "better", I'd say the more portable it is, the better it is. [going off on a rant here, got yer coffee or other stiff beverage?] Next to animations that can't be turned off, banners that roll in front of content, and pages so full of ads that it's tough to even find content, one of the top things that irritate me about scripted websites is the number of sites that show script errors in the status bar. (I recommend turning off popup notifications of script errors unless you're diagnosing errors on your own site.) We see these errors everywhere. Usually it's an "object is undefined" error, occasionally there's all kinds of stuff messed up. Is software "good enough" to go production when a new visitor's first connection to the site reveals coding errors? How can someone walk away from a production site and call it done when over 50% of the audience is going to see errors? http://www.w3schools.com/browsers/browsers_stats.asp I've been told by many webmasters (yes, I report many script errors - you're not surprised are you?) that script errors are the result of issues with the brain-dead implementation of JS in IE, non-compliance with ECMA, and bugs that Microsoft refuses to fix. Having written a boat load of cross-browser code I know this is a lot of BS, and failure to make code work properly is entirely politically motivated, or pure incompetence. How can anyone justify a "var undefined" error as being a platform issue? Why can't people acknowledge that failure to initialize a variable is a coding error, not a platform-specific defect? When did it become politically correct to dismiss coding errors because the end-user is stupid enough to be using Internet Explorer as the browser? Maybe we have a new corollary for modern development: "The number of bugs you find in code when run over any given platform is directly proportional to the disdain the developer has for that platform." |
|
Cutting these people a little slack, and getting back on-topic, one of the reasons why we see so many JavaScript errors is that it's too easy to make them. As a non-compiled, non-typed language, every line of JS code is subject to runtime issues which would be found by modern compilers but these days finding errors is often left to end-users. Environments for pre-release testing are everywhere (http://www.testingfaqs.org/t-unit.html and elsewhere) but the number of developers who use them has to be tiny. I've said it before but I think the overall problem with JavaScript usage is over-use of a good thing. We wouldn't write an operating system, compiler, database, or a server-side business application in a script language, but somehow working in a browser is cool and hip and in that environment it suddenly becomes OK to write massive utilities in JS for a browser. I don't get that logic. And now that Ajax is popular (even though it was unpopular before someone gave it a name, sheesh) we find a resurgence in popularity for JavaScript as well. Now wait a sec - because we have technology that allows us to put more code on the server people are finding excuses to write more code in the client? Personally I'd think Ajax should encourage people to put LESS code in the browser. If you want a thick app, get a thick client. People these days are asking for thin clients that look just like a thick app. Some people are resorting to creating very thick browser apps using ActiveX or Java applets - all in the name of "ease of deployment" ... until they actually try to deploy the stuff. And then the vision changes to using the increasingly popular JavaScript with DHTML. That's great too until you hear "oh yes, and we need to support IE, NS, FX, OP, MO, KQ, ... and cell phones..." Looking back at this thread, I'm sort of sorry that a lot of this dove-tails with Chandru's comments. I realize I've just documented exactly why JavaScript has been such a black sheep, which is exactly what he was objecting to from that article. Oh well, too late now. T |
#12
| |||
| |||
|
#13
| |||
| |||
|
|
As long as it remains a glue language and it's buried in big containers like AJAX libraries, WPF, GWT then I have no complaints. Let their armies of programmers worry about what browser dialect my refrigerator speaks, not me. |

#14
| |||||||||
| |||||||||
|
|
"Tony Gravagno" wrote I think people who put too much emphasis on curly braces are really spending too much time on the wrong topic. As an example, they have names for this stuff - a curly brace on the side is called "K&R style" or "One True Brace Style" (1TBS or OTBS). Give me a break. (http://en.wikipedia.org/wiki/Indent_style#K.26R_style) That page also describes others styles - interesting reading for geeks. My personal preference is to put the brace below the code (BSD/Allman style for those who care). With the quality of software these days at an all-time low I'm not surprised when I see so much rhetoric focused on where the brace is, rather than whether the code between the braces actually works. Just a short interchange on personal style, no further implications intended. |
|
However, I could respectfully contend that one who actually *knows the nomenclature* of the *placement of curly braces* may also be spending too much time on the wrong topic. I will, however, try to concentrate on the dismal state of my software here onwards. |
|
VS2005 has an IDE flag that lets you toggle where the brace will go. In that world the argument is over. Don't like the way someone wrote their code? Hit a switch. The argument is over. Unfortunately I'm still using ED. |

|
As one who's helped create an extremely workable RDP, the client side of which works entirely with JavaScript, I would have to disagree with, apparently, myself, or at least the impression I gave you in my last post. Iae, a few points: 1) The fact that JavaScript is a "script" language is irrelevant. So could you classify mvBasic. |
|
Like mvB, JS has a syntax checker and, no doubt, a p-code type runtime. |
|
A true script language decodes on the fly (like Proc) and the main objection to such is lack of speed and error checking only on execution of the statement. 2) Once again, I do not understand the concerns above. You say that "People these days are asking for thin clients that look just like a thick app." Which describes my BUI. What, exactly, is wrong with that if a) it works efficiently b) satisfies the user's needs and c) is totally maintainable (at present I'm practically the entire R&D staff, for complex reasons.) We've already discussed the benefits and otherwise of thin vs thick clients over and over. |
|
3) Don't understand the deployment issue comment either. Why would having the odd java applet or ActiveX be a problem? |
|
I do have some, and I don't have any problems; in fact I remember you once saying that thick client software was easy to deploy though some Acronym I've forgotten. Since I don't have any problems even without using said deployment software, where's the beef? |
|
3) We're not "writ[ing] an operating system, compiler, database, etc." in JavaScript, we're writing very basic but necessary UI stuff. What, exactly is wrong with "more code on the client?" Chandru Murthi |
#15
| |||
| |||
|
|
If you're wondering what the hell I'm talking about or you just got very offended by something then I guess I once again didn't express myself properly. I assure you I have a smile on my face as I write this because I think it's funny that this topic can be taken in so many directions. |
#16
| |||
| |||
|
|
2) Once again, I do not understand the concerns above. You say that "People these days are asking for thin clients that look just like a thick app." Which describes my BUI. What, exactly, is wrong with that if a) it works efficiently b) satisfies the user's needs and c) is totally maintainable (at present I'm practically the entire R&D staff, for complex reasons.) We've already discussed the benefits and otherwise of thin vs thick clients over and over. 3) Don't understand the deployment issue comment either. Why would having the odd java applet or ActiveX be a problem? I do have some, and I don't have any problems; in fact I remember you once saying that thick client software was easy to deploy though some Acronym I've forgotten. Since I don't have any problems even without using said deployment software, where's the beef? 3) We're not "writ[ing] an operating system, compiler, database, etc." in JavaScript, we're writing very basic but necessary UI stuff. What, exactly is wrong with "more code on the client?" Chandru Murthi |
#17
| |||
| |||
|
|
It's a great article. So javascript has been ridiculed as the "black sheep". Because of it inconsistencies (forced by the DOM model). Because of its dynamic typing which horrifies purists. Because of its ability to define attributes and methods of objects on the fly. Well, slap the designers hard on the wrist with a wet noodle. |
![]() |
| Thread Tools | |
| Display Modes | |
| |