Thread: What do we think about JavaScript?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User MutantJohn's Avatar
    Join Date
    Feb 2013
    Posts
    2,665

    What do we think about JavaScript?

    Like it or not, it seems like JavaScript is taking the world by storm.

    Everyone needs a website nowadays so you can't escape it on the browser and through the magic of Google's JS engine, V8, JS is now being used in production and by hobbyists alike for managing HTTP servers.

    I work with JS all day and it's a pretty good language. Node's a really good choice for implementing a HTTP server because it threads your application in the way that you want it to be threaded in the first place. The serial nature of the event loop also allows for certain assumptions and guarantees to be made.

    But I equally find myself dealing with its absurd lack of exceptions and tendencies towards "stringing" everything out. Not to mention, deal with JSON soup is a nightmare.

  2. #2
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    I've mentioned it before, but I really dislike Javascript since it's a dynamic language, lacks object orientation, no exceptions and treats everything that doesn't exist as null or whatever. Javascript is good for nothing but an intermediate language, and it fails horribly even at that. Javascript is the bane of every web. Don't use it. It's horrible to code in and it sucks cpu cycles from simple web pages that overuses it, killing battery life.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  3. #3
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Quote Originally Posted by Elysia
    I really dislike Javascript since (it) lacks object orientation
    But Javascript does have built-in support for object oriented programming, just that it does so without explicit classes via its odd but nonetheless valid prototype approach.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  4. #4
    Registered User MacNilly's Avatar
    Join Date
    Oct 2005
    Location
    CA, USA
    Posts
    466
    Quote Originally Posted by laserlight View Post
    But Javascript does have built-in support for object oriented programming, just that it does so without explicit classes via its odd but nonetheless valid prototype approach.
    Yes, Javascript was inspired by (read: ripped off ideas from) Self, which is a pure "object oriented" programming language.

    Languages such as Self and Smalltalk were invented before other languages such as C++ and Java, etc., decided to enforce the "class-based" approach to organizing objects. However, using the class based approach vs. the prototype approach has, like any other design decision, its advantages and disadvantages. Of course, its beyond the scope of this thread to go into a full discussion of these, but suffice to say that the prototype based object approach is not wrong and the class-based approach is not right. Either can be used to express the same ideas.. "Expressiveness" and "verbosity" are subjective terms, after all.

  5. #5
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    It may be valid, but it's at odds with how every other language does it. Frankly, in my humble opinion, I don't like it.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  6. #6
    Registered User MacNilly's Avatar
    Join Date
    Oct 2005
    Location
    CA, USA
    Posts
    466
    Quote Originally Posted by Elysia View Post
    It may be valid, but it's at odds with how every other language does it. Frankly, in my humble opinion, I don't like it.
    This is false and a very bad reason, taken alone, for anyone to dislike Javascript.

    What does "every other language" entail? The typical programmer's bread-and-butter language such as C++, Java, which enforce a class-based object hierarchy?

    The only reason why an enforced "class-based" approach might be better is because more programmers have been indoctrinated to this way of thinking and therefore can be more productive in the workplace. This fact, however, cannot be used as a reason to say its "at odds with every other programming language."

    That said, I do think Javascript mostly sucks.. just as I think most programming languages suck.. try googling "why <programming language X> sucks" for example. You'll find a lot of weird ........ that just makes no sense embedded in Javascript's design.. In fact, I would venture to say that a language's suckiness is directly proportional to the number of people who use it. Of course, however, as a member of this board, I reserve a special place for C (and NOT C++) as the simplest language that models current hardware.
    Last edited by MacNilly; 07-06-2016 at 04:27 AM.

  7. #7
    [](){}(); manasij7479's Avatar
    Join Date
    Feb 2011
    Location
    *nullptr
    Posts
    2,657
    Quote Originally Posted by MacNilly View Post
    I reserve a special place for C (and NOT C++) as the simplest language that models current hardware.
    By that logic JavaScript models the ecosystem available in a current web browser rather well.

  8. #8
    Registered User MacNilly's Avatar
    Join Date
    Oct 2005
    Location
    CA, USA
    Posts
    466
    Quote Originally Posted by manasij7479 View Post
    By that logic JavaScript models the ecosystem available in a current web browser rather well.
    There's no denying that for the foreseeable future, I agree.. Although I was not trying to compare C with Javascript. I think each has become more or less a domain specific language: C for systems programming (although C++ is just as good there) and Javascript for the browser.

    I thought C's greatest advantage and why it is great is because it provides a nice abstraction over the assembly languages of different physical machines -- which are pretty similiar, after all, and this is what allows the abstraction to work.. I have heard that Javascript offers abstraction over different browsers.
    Last edited by MacNilly; 07-08-2016 at 01:25 AM.

  9. #9
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Quote Originally Posted by MacNilly View Post
    ...I reserve a special place for C (and NOT C++) as the simplest language that models current hardware.
    I reserve C++ as the best practical language that models the current hardware. C is just too simple to meet modern needs.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  10. #10
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Ireland
    Posts
    8,446
    Quote Originally Posted by Elysia View Post
    I reserve C++ as the best practical language that models the current hardware. C is just too simple to meet modern needs.
    What does that even mean, modeling the current hardware? I understand you always take extreme sides on all things in life, a behavior you may learn to control when you decide one day to actually learn anything about programming. But at least when you take your usual extreme bias and force it down our throats, do it with something that is actually thought provoking and worth of a debate, and not another bash-on-Elysia post. You make an easy target with your bs nonsense, but it gets tiring over the years. At least surprise us with something worth our time.

    On point, standard C++ is obviously not even close to model hardware. As an higher level language you shouldn't even put it in those terms. It's an abstraction, a high level abstraction, and it stays clear from the hardware systems it depends and operates on as best as it can. It's for this reason that standard C++ memory management is NOT even close to being a model of the kernel memory management, or why accessing the various hardware resources is made as transparent to the developer as it can be made in the context and semantics of the language. For that matter standard C is slightly lower level, closer to the machine if you will, because it lacks many of the semantics and language constructs that allow C++ to increase its high abstraction level; contradicting your assumption that standard C is too simple. Obviously C is a more complex language from the point of view of the developer for the reasons mentioned above. And it is for this reason among others C remains a valuable language, especially in the development of the lower layers of the operating system and many of the top layer utilities too.

    And thank goodness C++ is what it is. Because you, of all people, wouldn't want a language that was nothing more than a C clone. You'd be out of any idiotic bs to shout when carrying your flag and everyone else would be left with a language they had no use for.
    Last edited by Mario F.; 07-08-2016 at 06:02 AM.
    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  11. #11
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Quote Originally Posted by Mario F. View Post
    What does that even mean, modeling the current hardware?
    That was a stab on "C modelling the current hardware".

    Quote Originally Posted by Mario F. View Post
    At least surprise us with something worth our time.
    You don't need to read them. This is not a forum where I have present homework, facts or research. I have no obligation to help or satisfy anyone or make any effort to do so. Don't expect that of me.

    I don't know exactly what you mean by "standard C++." True, in today's world, we want to stray away from the hardware with higher-level abstractions as possible, and that sometimes just doesn't work in places like kernels. But that doesn't take away the fact that C++ can be just a better C. Replace malloc with new, use RAII, don't use exceptions, replace macros with templates and you've pretty much got just a better C. And just as close to the metal as C is. C++ was not designed to be a new Java or C#. It was designed to be close to the metal while offering high-level abstractions. And that is why it's more practical then C, because it offers more tools in the toolbox. Therefore, when you can use C++ over C, you should opt to do so. That is my opinion, and that is why I made a stab at that post.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  12. #12
    [](){}(); manasij7479's Avatar
    Join Date
    Feb 2011
    Location
    *nullptr
    Posts
    2,657
    I like the language, but debugging can be frustrating.
    Especially when your code is N levels deep in callbacks, which seems to be a very common style.
    I really should invest time learning how to properly use the developer tools the browsers provide. That might take away some of the pain, but I don't do web stuff often enough to warrant that.

  13. #13
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Ireland
    Posts
    8,446
    I dislike it. Strongly. In fact, I hate it. Hate as in hate, not as in dislike. But the reason I hate it is not not because I hate it. But because I hate the fact there are no alternatives to it. The client development ecosystem for the web is almost completely tied to this single language that evolves erratically through the different requirements of millions of developers while extending its library in a chaotic manner to answer the whims of whatever is the the new cool thing in web development. And we will one day pay a dear price for this complacency. Javascript is the enemy that you have to share a bed with.

    Web browser vendors are ultimately to blame for this. Every time someone tries to come up with something new, they will take their sweet time to offer support (if they ever will), perpetuating the dependency on javascript and removing any motivation for new and improved languages. And for this reason, web client-side scripting is today one of the ugliest looking, chaotic and nightmarish codebases out there. Looking at a .js file is like looking at the future of a race that decided they didn't want to evolve anymore and adopted pop culture as their everlasting legacy. A bad language that never improved over time and that people just build colorful "plugins" around with colorful names that do colorful things and help finance an whole industry of trainers, educators and book writers along with their publishers. Javascript is the PHP of client-side scripting.

    You asked, I answered.
    Last edited by Mario F.; 06-10-2016 at 05:29 AM.
    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  14. #14
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    Quote Originally Posted by Mario F. View Post
    I dislike it. Strongly. In fact, I hate it. Hate as in hate, not as in dislike. But the reason I hate it is not not because I hate it. But because I hate the fact there are no alternatives to it. The client development ecosystem for the web is almost completely tied to this single language that evolves erratically through the different requirements of millions of developers while extending its library in a chaotic manner to answer the whims of whatever is the the new cool thing in web development. And we will one day pay a dear price for this complacency. Javascript is the enemy that you have to share a bed with.

    Web browser vendors are ultimately to blame for this. Every time someone tries to come up with something new, they will take their sweet time to offer support (if they ever will), perpetuating the dependency on javascript and removing any motivation for new and improved languages. And for this reason, web client-side scripting is today one of the ugliest looking, chaotic and nightmarish codebases out there. Looking at a .js file is like looking at the future of a race that decided they didn't want to evolve anymore and adopted pop culture as their everlasting legacy. A bad language that never improved over time and that people just build colorful "plugins" around with colorful names that do colorful things and help finance an whole industry of trainers, educators and book writers along with their publishers. Javascript is the PHP of client-side scripting.

    You asked, I answered.
    TBH, the entire stack of web technologies is a complete disaster, Javascript is just one part of it. Even if Javascript was amazing and perfect, CSS would still be horrific, HTML still terrible, and HTTP too limiting.

    Everyone involved in the evolution of the web who could have stood up and said "Stop! We've gone far enough in this crazy direction!" but did not, should be deeply ashamed.
    Code:
    //try
    //{
    	if (a) do { f( b); } while(1);
    	else   do { f(!b); } while(1);
    //}

  15. #15
    Make Fortran great again
    Join Date
    Sep 2009
    Posts
    1,413
    Quote Originally Posted by brewbuck View Post
    TBH, the entire stack of web technologies is a complete disaster, Javascript is just one part of it. Even if Javascript was amazing and perfect, CSS would still be horrific, HTML still terrible, and HTTP too limiting.

    Everyone involved in the evolution of the web who could have stood up and said "Stop! We've gone far enough in this crazy direction!" but did not, should be deeply ashamed.
    This is pretty much my feeling. I don't really like anything associated with webdev. It's my weakest point as far as programming goes because I try to avoid it like the plague. Dealing with the nightmare of CSS, and the Javascript differences between browsers for a few months at a previous job was enough to shy me away forever. Side note, the way divs work in HTML has never really made good sense to me. Things would be a lot better if you could do things in a GUI grid manner, as with Tkinter.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. ajax response javascript=>c#=>javascript
    By xddxogm3 in forum C# Programming
    Replies: 1
    Last Post: 03-14-2012, 01:22 PM
  2. Replies: 2
    Last Post: 03-10-2009, 08:36 PM
  3. javascript
    By Redseal in forum Tech Board
    Replies: 8
    Last Post: 06-16-2007, 07:36 AM
  4. javascript
    By xddxogm3 in forum A Brief History of Cprogramming.com
    Replies: 3
    Last Post: 12-07-2003, 10:50 AM
  5. javascript
    By bluehead in forum Game Programming
    Replies: 4
    Last Post: 12-04-2001, 09:13 PM

Tags for this Thread