Is JS frustrating in the *macro* world?
Results 1 to 12 of 12

Thread: Is JS frustrating in the *macro* world?

  1. #1
    Settled 4 red convertible dalecosp's Avatar
    Join Date
    Jul 2002
    Location
    Accelerating Windows at 9.81 m/s....
    Posts
    7,707

    Is JS frustrating in the *macro* world?

    I've often posted about micro-frustrations with Javascript. It's rather unlike PHP; it's the language of the browser, not the server; it doesn't seem to have clear-cut rules ("Always Use Semicolons", "Don't use semicolons --- JS will add the ones it needs"); and debugging it *used to be* like herding cats (thank you, Whomever, for Firebug).

    But is the "macro" world of Javascript also frustrating? What it seems to me: the only people writing "pure" JS are the library devels; everyone who works in the real world uses a mix of pure JS and some library. Since it deals directly with the DOM, the community is full of HTML newbs, artsy graphics designer types and more trolls than a Grimm's tale. And the target is "the modern browser" (whichever of the $x++ it is this month) --- which leads to a decision tree that makes complex XML documents looks like tinker-toys by comparison.

    So, I'm trying to figure out the community, the paradigm I will use to increase my ability to be a "front end" developer ... since I'm basically the *only* devel here. What do I read? What do I practice (in my "free" time, )? What do I believe? Do I follow Crockford, Eich, or someone else? Do I devote myself to jQuery even though some of our web properties are YUI-based ... and do I ignore Scriptaculous even though it's still being used on some company pages? Do I slow down my sites by including "my" library along with the ones the original developers used?

    I'm not saying that the PHP community is perfect either; not by a long shot. But I'm really having trouble with the entire idea of attempting to master JS. I mean, I can write the schiz ... it just takes *forever* compared with PHP (that's probably a function of my experience).

    If this is a rant, please excuse me. I'm just trying to think out loud in a place where I'd probably just sound like "blah blah blah" to most anyone else I can bend an ear on ....

    What do *you* think?
    /!!\ mysql_ is deprecated --- don't use it! Tell your hosting company you will switch if they don't upgrade! /!!!\ ereg() is deprecated --- don't use it!

    dalecosp "God doesn't play dice." --- Einstein "Perl is hardly a paragon of beautiful syntax." --- Weedpacket

    Getting Help at All --- Collected Solutions to Common Problems --- Debugging 101 --- Unanswered Posts --- OMBE: Office Machines, Business Equipment

  2. #2
    Senior Member traq's Avatar
    Join Date
    Jun 2011
    Location
    so.Cal
    Posts
    949
    Watch/read anything Crockford says. He knows what he's talking about and says it is very understandable, entertaining ways.

    JS is exactly opposite PHP in many ways, but learning it really helped grow my PHP skillset (especially concerning object-oriented design). Just be careful which examples you follow - like PHP, there is a low entry barrier, which results in lots and lots of crap examples.

  3. #3
    High Energy Magic Dept. NogDog's Avatar
    Join Date
    Aug 2006
    Location
    Ankh-Morpork
    Posts
    13,922
    Don't know if this is good news or not, but if node.js gains enough traction, you'll only need one language for both client and server sides: JavaScript.
    Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be." ~ from Nation, by Terry Pratchett

    "But the main reason that any programmer learning any new language thinks the new language is SO much better than the old one is because he’s a better programmer now!" ~ http://www.oreillynet.com/ruby/blog/...ck_to_p_1.html


    eBookworm.us

  4. #4
    Settled 4 red convertible dalecosp's Avatar
    Join Date
    Jul 2002
    Location
    Accelerating Windows at 9.81 m/s....
    Posts
    7,707
    Quote Originally Posted by NogDog View Post
    Don't know if this is good news or not, but if node.js gains enough traction, you'll only need one language for both client and server sides: JavaScript.
    Lol, and a good 401K and early retirement ;-)

    Quote Originally Posted by traq
    Watch/read anything Crockford says. He knows what he's talking about and says it is very understandable, entertaining ways.

    JS is exactly opposite PHP in many ways, but learning it really helped grow my PHP skillset (especially concerning object-oriented design). Just be careful which examples you follow - like PHP, there is a low entry barrier, which results in lots and lots of crap examples.
    I do enjoy reading him and he comes across not only as a knowledgeable person, but as someone I can respect as a human without invoking Biblical commands on myself

    That said, I don't feel like reading professionally much @home and am never sure if I can justify it here in the cube with so much to do ... <sigh>...
    Last edited by dalecosp; 04-30-2013 at 12:35 PM.
    /!!\ mysql_ is deprecated --- don't use it! Tell your hosting company you will switch if they don't upgrade! /!!!\ ereg() is deprecated --- don't use it!

    dalecosp "God doesn't play dice." --- Einstein "Perl is hardly a paragon of beautiful syntax." --- Weedpacket

    Getting Help at All --- Collected Solutions to Common Problems --- Debugging 101 --- Unanswered Posts --- OMBE: Office Machines, Business Equipment

  5. #5
    Senior Member traq's Avatar
    Join Date
    Jun 2011
    Location
    so.Cal
    Posts
    949
    start with his videos. he's very engaging.

    ---------------------------
    as for some of the concerns you voiced earlier:

    Always Use Semicolons.

    libraries (jQuery especially) are very useful because they cover a lot of the cross-browser stuff for you. It's much easier and more robust than trying to code it all yourself from scratch. If you have existing stuff that uses several different libraries, it would be good to choose one to focus on and start weeding out the others as you can.

    (I know that this is probably easier said than done, but hey- it's a place to start learning!)

    Regarding the DOM, you know it exists, so you're already a mile or so ahead of most JS coders.
    Last edited by traq; 04-30-2013 at 03:19 PM.

  6. #6
    Settled 4 red convertible dalecosp's Avatar
    Join Date
    Jul 2002
    Location
    Accelerating Windows at 9.81 m/s....
    Posts
    7,707
    Quote Originally Posted by traq View Post
    as for some of the concerns you voiced earlier:

    Always Use Semicolons.
    Well, it's what I do in PHP, so I may as well; I guess you know how large a can of worms that is, and that Eich doesn't curse in public (I wish I never did!).

    I started doing some reading of DC's and came up with: 1] Avoid Archaic Constructs, and 2] Always use blocks in structured statements.

    So, between semicolons and bracketed blocks, I should feel right at home? Until I write a function, that is ...

    Regarding the DOM, you know it exists, so you're already a mile or so ahead of most JS coders.
    +1 ... see the above re: HTML gurus and designer-boiz
    /!!\ mysql_ is deprecated --- don't use it! Tell your hosting company you will switch if they don't upgrade! /!!!\ ereg() is deprecated --- don't use it!

    dalecosp "God doesn't play dice." --- Einstein "Perl is hardly a paragon of beautiful syntax." --- Weedpacket

    Getting Help at All --- Collected Solutions to Common Problems --- Debugging 101 --- Unanswered Posts --- OMBE: Office Machines, Business Equipment

  7. #7
    Pna lbh ernq guvf¿
    Join Date
    Jul 2004
    Location
    Kansas City area
    Posts
    19,420
    There are also some useful tools like JSHint that may or may not provide useful warnings/guidance with regards to your code.

  8. #8
    Settled 4 red convertible dalecosp's Avatar
    Join Date
    Jul 2002
    Location
    Accelerating Windows at 9.81 m/s....
    Posts
    7,707
    Thanks ... I'll take that as a recommendation. I've been using JsLint instead ... might be enlightening to see a more general POV than just DC's ...
    /!!\ mysql_ is deprecated --- don't use it! Tell your hosting company you will switch if they don't upgrade! /!!!\ ereg() is deprecated --- don't use it!

    dalecosp "God doesn't play dice." --- Einstein "Perl is hardly a paragon of beautiful syntax." --- Weedpacket

    Getting Help at All --- Collected Solutions to Common Problems --- Debugging 101 --- Unanswered Posts --- OMBE: Office Machines, Business Equipment

  9. #9
    Pedantic Curmudgeon Weedpacket's Avatar
    Join Date
    Aug 2002
    Location
    General Systems Vehicle "Thrilled To Be Here"
    Posts
    21,876
    Certainly JavaScript has one of the ugliest syntaxes of any language of its ilk - a syntax I'm sure was deliberately designed to make it look like something it's not (character witness for the prosecution: its very name is misleading, has misled, and continues to mislead). I've encountered CoffeeScript that replaces JavaScript's syntax with something that is better suited to its semantics.
    Last edited by Weedpacket; 05-01-2013 at 04:41 PM.
    THERE IS AS YET INSUFFICIENT DATA FOR A MEANINGFUL ANSWER
    FAQs! FAQs! FAQs! Most forums have them!
    Search - Debugging 101 - Collected Solutions - General Guidelines - Getting help at all

  10. #10
    Settled 4 red convertible dalecosp's Avatar
    Join Date
    Jul 2002
    Location
    Accelerating Windows at 9.81 m/s....
    Posts
    7,707
    I suppose the fact it's a 10-day hack might have something to do with it, as well. People complain about PHP being a quick PERL hack ... Javascript actually has a much greater adoption rate, seeing as every browser (well, *most* browsers) on earth has a running environment for it.

    But wasn't it supposed to be a sort of implementation of Scheme? (or was that your point?)

    Back to "micro-frustrations" ... I probably shouldn't tell on myself, but it is almost 5 PM here. I just managed to lock up Firefox doing something like this:
    Code:
    function foo() {
       bar();
    }
    
    function bar() {
       something();
       much_more_something();
       foo();
    }
    I guess I should install Spidermonkey and learn to use it; in PHP, I usually lint most everything via the CLI ... no CTRL-C for a stuck Firefox, though. Lucky I'm not on Windows 8 ... it probably would've said:
    Code:
    Firefox has stopped working ....
    Checking for a solution to the problem ...
    
    ...
    
    Don't do that, you clod!
    /!!\ mysql_ is deprecated --- don't use it! Tell your hosting company you will switch if they don't upgrade! /!!!\ ereg() is deprecated --- don't use it!

    dalecosp "God doesn't play dice." --- Einstein "Perl is hardly a paragon of beautiful syntax." --- Weedpacket

    Getting Help at All --- Collected Solutions to Common Problems --- Debugging 101 --- Unanswered Posts --- OMBE: Office Machines, Business Equipment

  11. #11
    Pedantic Curmudgeon Weedpacket's Avatar
    Join Date
    Aug 2002
    Location
    General Systems Vehicle "Thrilled To Be Here"
    Posts
    21,876
    Quote Originally Posted by dalecosp
    But wasn't it supposed to be a sort of implementation of Scheme? (or was that your point?)
    Close; more like Self - a loosely-typed Smalltalk.
    THERE IS AS YET INSUFFICIENT DATA FOR A MEANINGFUL ANSWER
    FAQs! FAQs! FAQs! Most forums have them!
    Search - Debugging 101 - Collected Solutions - General Guidelines - Getting help at all

  12. #12
    Settled 4 red convertible dalecosp's Avatar
    Join Date
    Jul 2002
    Location
    Accelerating Windows at 9.81 m/s....
    Posts
    7,707
    /!!\ mysql_ is deprecated --- don't use it! Tell your hosting company you will switch if they don't upgrade! /!!!\ ereg() is deprecated --- don't use it!

    dalecosp "God doesn't play dice." --- Einstein "Perl is hardly a paragon of beautiful syntax." --- Weedpacket

    Getting Help at All --- Collected Solutions to Common Problems --- Debugging 101 --- Unanswered Posts --- OMBE: Office Machines, Business Equipment

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •