Thread: What do we think about JavaScript?

  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
    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.

  5. #5
    [](){}(); 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.

  6. #6
    (?<!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.

  7. #7
    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);
    //}

  8. #8
    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.

  9. #9
    Master Apprentice phantomotap's Avatar
    Join Date
    Jan 2008
    Posts
    5,108
    O_o

    I like the Javascript language fine, and a few features which have been seriously discussed could see me moving to Javascript for most development.

    However, I am specifically referring to the language. The standard library and DOM related components are, being generous, obnoxious cruft.

    Soma
    “Salem Was Wrong!” -- Pedant Necromancer
    “Four isn't random!” -- Gibbering Mouther

  10. #10
    Registered User
    Join Date
    Oct 2006
    Posts
    3,445
    Web Assembly is just over the horizon, and it's likely that there will be tools that compile real languages into Web Assembly, reducing the world's dependence on JS.
    What can this strange device be?
    When I touch it, it gives forth a sound
    It's got wires that vibrate and give music
    What can this thing be that I found?

  11. #11
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Ireland
    Posts
    8,446
    I did at a professional level for almost 15 years. A time when ASP.Net was all the rage and ColdFusion this new kid on the block. When client-side cripting was practically non existing. I saw the CoffeeCup Editor taking the world by storm, followed by Dreamweaver. Moved into PHP, witnessed the birth of 3 CSS versions and the struggle to make HTML 4 a widely used standard. Witnessed the birth of Ajax and how it brought javascript from the ashes as Microsoft unwillingly contributed to its widespread use. I remember when Javascript was accused of being a poorly developed language and the major contributor to browser incompatibility. The latter has indeed changed, but people seem to have forgotten the former.

    For almost 15 years, I breathed the poisonous fumes of web development, server and client side. I have no wish of going back. It would be like going back to prison.
    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.

  12. #12
    Registered User MutantJohn's Avatar
    Join Date
    Feb 2013
    Posts
    2,665
    Quote Originally Posted by phantomotap View Post
    O_o

    I like the Javascript language fine, and a few features which have been seriously discussed could see me moving to Javascript for most development.
    This is kind of how I feel.

    I didn't really appreciate the beauty of JavaScript until they introduced generators and then I really fell in love with it once the library "co" was written.

    Honestly, the async code that I've written looks absurdly awesome but that might also be because I've never really played with a language that supports generators, let alone full coroutines. And even then, it's not like generators or coroutines are even unique to JS, they just happened to port them over.

    I like the C-style syntax and I appreciate the degrees to which you can implement functional programming concepts.

    But there's very many silly things that JS does that I feel keeps it from being a true powerhouse, such as it's allowance of comparing a string to a date object or a number to a string without so much as a warning, it just evaluates to false. This leads to bugs that are incredibly hard to track down.

  13. #13
    Registered User MutantJohn's Avatar
    Join Date
    Feb 2013
    Posts
    2,665
    Quote Originally Posted by Mario F. View Post
    For almost 15 years, I breathed the poisonous fumes of web development, server and client side. I have no wish of going back. It would be like going back to prison.
    There's pretty robust front-end frameworks that can help mitigate a lot of the front-end toxicity. Ampersand is a pretty good one. It's object-oriented and declarative. Its implementation of types isn't half-bad either and really plays well to a C++ developer's natural thinking.

    But there are times that I've found myself completely eschewing the framework and just doing some jQuery stuff myself so I guess that means about as much as that does lol.

  14. #14
    Registered User
    Join Date
    May 2003
    Posts
    1,619
    I dunno. I use it extensively for web dev.

    On the plus side, I do like being able to make object and array literals. Prototype-based inheritance at first was a tricky paradigm to wrap my head around but it's grown on me.

    On the down side, I don't like the weak typing and I don't like some of the downstream effects of this structure, though - mainly, how spotty IntelliSense and such tools are. I tend to spend a lot more time reading API documentation because my development environment can't always present this information to me inline as I need it. This is certainly not new; I learned development in the days before IntelliSense existed, but it's a great time-saver that I really find I miss when it's not working reliably.
    You ever try a pink golf ball, Wally? Why, the wind shear on a pink ball alone can take the head clean off a 90 pound midget at 300 yards.

  15. #15
    Unregistered User Yarin's Avatar
    Join Date
    Jul 2007
    Posts
    2,158

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