Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. Why is javascript so disliked

Why is javascript so disliked

Scheduled Pinned Locked Moved The Lounge
javascript
28 Posts 22 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M MarkTJohnson

    I'm learning it just now, new job needs it. My biggest gripe is lack of typing of variables. I would like to know what kind of value, object, etc I can pass into a function. Okay, I do like that they are called functions rather than methods. Cut my teeth on C and then Delphi (which had both functions and procedures) but it rankled me for the 10+ years I worked in Java that I had to say method. Javascript does have something akin to function pointers, which is a nice throwback to C.

    I’ve given up trying to be calm. However, I am open to feeling slightly less agitated. I’m begging you for the benefit of everyone, don’t be STUPID.

    J Offline
    J Offline
    Jacquers
    wrote on last edited by
    #5

    MarkTJohnson wrote:

    My biggest gripe is lack of typing of variables.

    Typescript to the rescue :)

    1 Reply Last reply
    0
    • M MarkTJohnson

      I'm learning it just now, new job needs it. My biggest gripe is lack of typing of variables. I would like to know what kind of value, object, etc I can pass into a function. Okay, I do like that they are called functions rather than methods. Cut my teeth on C and then Delphi (which had both functions and procedures) but it rankled me for the 10+ years I worked in Java that I had to say method. Javascript does have something akin to function pointers, which is a nice throwback to C.

      I’ve given up trying to be calm. However, I am open to feeling slightly less agitated. I’m begging you for the benefit of everyone, don’t be STUPID.

      OriginalGriffO Offline
      OriginalGriffO Offline
      OriginalGriff
      wrote on last edited by
      #6

      Erm ... JS has both methods and functions - the former operate on object data (as per C#) the later are procedural and don't (as per C) The difference in name is important because it tells you what you can do with a bit of code - that's why Java insists on method to differentiate it from the more primitive function you were used to in C.

      "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!

      "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
      "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

      Richard DeemingR M P 3 Replies Last reply
      0
      • OriginalGriffO OriginalGriff

        Erm ... JS has both methods and functions - the former operate on object data (as per C#) the later are procedural and don't (as per C) The difference in name is important because it tells you what you can do with a bit of code - that's why Java insists on method to differentiate it from the more primitive function you were used to in C.

        "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!

        Richard DeemingR Offline
        Richard DeemingR Offline
        Richard Deeming
        wrote on last edited by
        #7

        OriginalGriff wrote:

        that's why Java insists on

        Tut tut! Java ≠ JavaScript. :)


        "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

        "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

        OriginalGriffO 1 Reply Last reply
        0
        • OriginalGriffO OriginalGriff

          Erm ... JS has both methods and functions - the former operate on object data (as per C#) the later are procedural and don't (as per C) The difference in name is important because it tells you what you can do with a bit of code - that's why Java insists on method to differentiate it from the more primitive function you were used to in C.

          "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!

          M Offline
          M Offline
          MarkTJohnson
          wrote on last edited by
          #8

          Like I said, learning. Haven't gotten to that stuff yet.

          I’ve given up trying to be calm. However, I am open to feeling slightly less agitated. I’m begging you for the benefit of everyone, don’t be STUPID.

          1 Reply Last reply
          0
          • Richard DeemingR Richard Deeming

            OriginalGriff wrote:

            that's why Java insists on

            Tut tut! Java ≠ JavaScript. :)


            "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

            OriginalGriffO Offline
            OriginalGriffO Offline
            OriginalGriff
            wrote on last edited by
            #9

            Quote:

            ... it rankled me for the 10+ years I worked in Java that I had to say method.

            :-D

            "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!

            "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
            "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

            1 Reply Last reply
            0
            • OriginalGriffO OriginalGriff

              Erm ... JS has both methods and functions - the former operate on object data (as per C#) the later are procedural and don't (as per C) The difference in name is important because it tells you what you can do with a bit of code - that's why Java insists on method to differentiate it from the more primitive function you were used to in C.

              "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!

              P Offline
              P Offline
              PIEBALDconsult
              wrote on last edited by
              #10

              OriginalGriff wrote:

              to differentiate it

              One thing I disliked about Pascal is that it has Function and Procedure distinguished by keyword -- I prefer that C and its ilk don't, and have no keywords for those concepts. I can understand why SQL does things more differentlier, and that's OK.

              D 1 Reply Last reply
              0
              • pkfoxP pkfox

                See title

                In a closed society where everybody's guilty, the only crime is getting caught. In a world of thieves, the only final sin is stupidity. - Hunter S Thompson - RIP

                G Offline
                G Offline
                GuyThiebaut
                wrote on last edited by
                #11

                JavaScript is fine - I used in in various incarnations and Typescript definitely helps write cleaner code. I heard Bob Martin point out that the evolution of programming languages is an evolution in constraining what you can do, each programming language constraining you in a different manner. JavaScript is perhaps a bit of a exception in that it's fairly loose with its constraints which is why something like TypeScript makes sense as it brings static typing with it. I still get caught out occasionally with the asynchronous nature of JavaScript but other than that I think it's fine when used well.

                “That which can be asserted without evidence, can be dismissed without evidence.”

                ― Christopher Hitchens

                1 Reply Last reply
                0
                • pkfoxP pkfox

                  See title

                  In a closed society where everybody's guilty, the only crime is getting caught. In a world of thieves, the only final sin is stupidity. - Hunter S Thompson - RIP

                  K Offline
                  K Offline
                  kmoorevs
                  wrote on last edited by
                  #12

                  Javascript is great!..but I've been using it for 24+ years, so I'm used to it. Combined with CSS and AJAX, and there's not a lot you can't do. My gripe is that after all this time, it's still a PITA to debug in Visual Studio. (probly cause I use master pages) I still rely on the tried and true alert(whatami); debugging method. :laugh:

                  "Go forth into the source" - Neal Morse "Hope is contagious"

                  S J 2 Replies Last reply
                  0
                  • P PIEBALDconsult

                    OriginalGriff wrote:

                    to differentiate it

                    One thing I disliked about Pascal is that it has Function and Procedure distinguished by keyword -- I prefer that C and its ilk don't, and have no keywords for those concepts. I can understand why SQL does things more differentlier, and that's OK.

                    D Offline
                    D Offline
                    dandy72
                    wrote on last edited by
                    #13

                    PIEBALDconsult wrote:

                    differentlier

                    Word of the day.

                    1 Reply Last reply
                    0
                    • pkfoxP pkfox

                      See title

                      In a closed society where everybody's guilty, the only crime is getting caught. In a world of thieves, the only final sin is stupidity. - Hunter S Thompson - RIP

                      A Offline
                      A Offline
                      Amarnath S
                      wrote on last edited by
                      #14

                      I like JavaScript because it is so forgiving. Error messages like NaN, undefined, are much gentler compared to a bunch of Error messages which come in C# projects on Visual Studio.

                      1 Reply Last reply
                      0
                      • K kmoorevs

                        Javascript is great!..but I've been using it for 24+ years, so I'm used to it. Combined with CSS and AJAX, and there's not a lot you can't do. My gripe is that after all this time, it's still a PITA to debug in Visual Studio. (probly cause I use master pages) I still rely on the tried and true alert(whatami); debugging method. :laugh:

                        "Go forth into the source" - Neal Morse "Hope is contagious"

                        S Offline
                        S Offline
                        Steve Raw
                        wrote on last edited by
                        #15

                        kmoorevs wrote:

                        Javascript is great!..but I've been using it for 24+ years, so I'm used to it. Combined with CSS and AJAX, and there's not a lot you can't do. My gripe is that after all this time, it's still a PITA to debug in Visual Studio. (probly cause I use master pages) I still rely on the tried and true alert(whatami); debugging method. :laugh:

                        I still use alert boxes for testing in JavaScript as well! I've been writing Javascript since about 1996 or so. In the beginning, there was no logging console available, so you really had to use alert boxes to test your code. I love writing JavaScript. It's become so versatile over time that your imagination is the limit. It does have its strange quirks, but they present no problems if you know how to work with them. Why is it that in JavaScript, null is an object? In terms of conditional statements, that's when it gets really weird. If you compare null to undefined, the condition returns true. When you compare undefined to null, the condition returns false. If I remember correctly, that's how it goes, but I learned this so long ago that my memory is faint and vague. It's something along those lines, but either way, it goes to show how ridiculous JavaScript can be. Either way, I really like it!

                        1 Reply Last reply
                        0
                        • pkfoxP pkfox

                          See title

                          In a closed society where everybody's guilty, the only crime is getting caught. In a world of thieves, the only final sin is stupidity. - Hunter S Thompson - RIP

                          D Offline
                          D Offline
                          Dr Walt Fair PE
                          wrote on last edited by
                          #16

                          Mainly because it sucks. Have you noticed that the likeableness of javascript is inversely proportional to a person's age? CQ de W5ALT

                          Walt Fair, Jr.PhD P. E. Comport Computing Specializing in Technical Engineering Software

                          1 Reply Last reply
                          0
                          • pkfoxP pkfox

                            See title

                            In a closed society where everybody's guilty, the only crime is getting caught. In a world of thieves, the only final sin is stupidity. - Hunter S Thompson - RIP

                            D Offline
                            D Offline
                            Dave Kreskowiak
                            wrote on last edited by
                            #17

                            One of the things I say to people worried about learning new languages is once you learn the concepts behind one language, you already know most of the concepts behind most other languages. Learning the new language is mostly a matter of semantics and syntax after that. Javascript, for someone who's always been exposed to strong types, doesn't really lend itself to all of the concepts of our normal languages. It's strongly NOT typed, allowing all kinds of values and free-form stuff assigned to it, including entire functions. It doesn't follow a lot of the concepts you learned in other languages. I think it's this "bucking of the norms" that really throws people off and gives everyone a bad taste. IMHO, Javascript being a no-typed language really makes the code-writing and debugging experience a pain in the ass. That and the lack of proper debugging tools in browsers. If you really need Typescript to make the experience that much better, the language and execution environment should have been designed with this in mind. Typescript should not have been an external bolt-on. Once you get used to it, and that's a steep learning curve for noobs, it's not too bad. I just use the tried-and-true old-school techniques of alerts and peppering the code with console.log everywhere.

                            Asking questions is a skill CodeProject Forum Guidelines Google: C# How to debug code Seriously, go read these articles. Dave Kreskowiak

                            J 1 Reply Last reply
                            0
                            • G GKP1992

                              This is almost exactly the same question I asked here in the Lounge about 7 years ago. I was struggling with something and it wasn't working as I expected it to and hence the frustration. @JeremyFalcon gave a really good response to that question and 7 years later I fully agree with him. Most of the hate JS gets is from people who are new to it, and probably have an expectation of how it would/should work. When it does not (and not always due to a straight forward reason) it gets frustrating. Historically JS has been riddled with issues. It still is. But over the years most of the major issues with JS are now avoidable when we use it a certain way. For example, the global namespace pollution has been a major issue causing countless production bugs which can be avoided with the use of JS modules or IFFEs. The callback hell can be avoided with the use of asynchronous programming. As people get more experienced with JS they become more accepting of it's quirks and manage to avoid it's pitfalls while being able to produce robust production ready code.

                              J Offline
                              J Offline
                              jschell
                              wrote on last edited by
                              #18

                              GKP1992 wrote:

                              with JS are now avoidable when we use it a certain way.

                              Which of course works in a day zero startup with two programmers that have been working together for years. With a 20 year old code base which has been worked on by more than 100 developers, each with their own preferences, it doesn't work out too well.

                              1 Reply Last reply
                              0
                              • G GKP1992

                                This is almost exactly the same question I asked here in the Lounge about 7 years ago. I was struggling with something and it wasn't working as I expected it to and hence the frustration. @JeremyFalcon gave a really good response to that question and 7 years later I fully agree with him. Most of the hate JS gets is from people who are new to it, and probably have an expectation of how it would/should work. When it does not (and not always due to a straight forward reason) it gets frustrating. Historically JS has been riddled with issues. It still is. But over the years most of the major issues with JS are now avoidable when we use it a certain way. For example, the global namespace pollution has been a major issue causing countless production bugs which can be avoided with the use of JS modules or IFFEs. The callback hell can be avoided with the use of asynchronous programming. As people get more experienced with JS they become more accepting of it's quirks and manage to avoid it's pitfalls while being able to produce robust production ready code.

                                J Offline
                                J Offline
                                Jeremy Falcon
                                wrote on last edited by
                                #19

                                GKP1992 wrote:

                                7 years later I fully agree with him.

                                Amen brother. IMO the biggest issue with JS is its popularity. You take any language on the planet and make it extremely popular and you're bound to have some people writing stupid code in it. That's not the fault of the language itself though; it's the fault of the "average" coder.

                                GKP1992 wrote:

                                The callback hell can be avoided with the use of asynchronous programming.

                                The whole reason callback hell even started (then went onto promise hell) was due to one of JavaScript's strengths. As you mentioned, most people just didn't know about JS's execution model and would rather insult than learn. But, because of the execution model, it's always been extremely hard to lock JS. Granted, people needed to learn how to deal with that or else they'd suffer race conditions, but peeps only had to take the time to learn the language. The same could be said of any language though. I'm not gonna learn Rust overnight.

                                GKP1992 wrote:

                                As people get more experienced with JS they become more accepting of it's quirks and manage to avoid it's pitfalls while being able to produce robust production ready code.

                                100%. It's a language that's been evolving and will continue to evolve as it grows up, so to speak. As it stands now, it's literally the fastest scripting language on the planet. It runs so fast it deserves its own category of scripting language. Sure, compared to C/C++ or Rust it's slower, but compared to Python, etc. none of them hold a candle to JS. And it has to be that way, it's the dynamic language of the Internet so a lot of time has been spent optimizing its execution engines. Haters gonna hate though. :laugh: :laugh: :laugh:

                                Jeremy Falcon

                                1 Reply Last reply
                                0
                                • pkfoxP pkfox

                                  See title

                                  In a closed society where everybody's guilty, the only crime is getting caught. In a world of thieves, the only final sin is stupidity. - Hunter S Thompson - RIP

                                  J Offline
                                  J Offline
                                  Jeremy Falcon
                                  wrote on last edited by
                                  #20

                                  Haters gonna hate buddy. Everyone who claims to be an expert at JS that hates is lying. It's more ego where they're fooling themselves than them actually being experts. Programmers aren't known for being mature and all.

                                  Jeremy Falcon

                                  J 1 Reply Last reply
                                  0
                                  • K kmoorevs

                                    Javascript is great!..but I've been using it for 24+ years, so I'm used to it. Combined with CSS and AJAX, and there's not a lot you can't do. My gripe is that after all this time, it's still a PITA to debug in Visual Studio. (probly cause I use master pages) I still rely on the tried and true alert(whatami); debugging method. :laugh:

                                    "Go forth into the source" - Neal Morse "Hope is contagious"

                                    J Offline
                                    J Offline
                                    Jeremy Falcon
                                    wrote on last edited by
                                    #21

                                    kmoorevs wrote:

                                    My gripe is that after all this time, it's still a PITA to debug in Visual Studio. (probly cause I use master pages)

                                    Preach brother. :laugh: :laugh: :laugh: Not sure about VS, but Node and VS Code makes debugging much easier these days though. Just guessing you doing ASP.NET because of saying "master pages"? Dunno how well it is on that side of things, but there's a little hope. A little. :laugh:

                                    Jeremy Falcon

                                    1 Reply Last reply
                                    0
                                    • D Dave Kreskowiak

                                      One of the things I say to people worried about learning new languages is once you learn the concepts behind one language, you already know most of the concepts behind most other languages. Learning the new language is mostly a matter of semantics and syntax after that. Javascript, for someone who's always been exposed to strong types, doesn't really lend itself to all of the concepts of our normal languages. It's strongly NOT typed, allowing all kinds of values and free-form stuff assigned to it, including entire functions. It doesn't follow a lot of the concepts you learned in other languages. I think it's this "bucking of the norms" that really throws people off and gives everyone a bad taste. IMHO, Javascript being a no-typed language really makes the code-writing and debugging experience a pain in the ass. That and the lack of proper debugging tools in browsers. If you really need Typescript to make the experience that much better, the language and execution environment should have been designed with this in mind. Typescript should not have been an external bolt-on. Once you get used to it, and that's a steep learning curve for noobs, it's not too bad. I just use the tried-and-true old-school techniques of alerts and peppering the code with console.log everywhere.

                                      Asking questions is a skill CodeProject Forum Guidelines Google: C# How to debug code Seriously, go read these articles. Dave Kreskowiak

                                      J Offline
                                      J Offline
                                      Jeremy Falcon
                                      wrote on last edited by
                                      #22

                                      I'd upvote your post twice if I could. :thumbsup: I think another reason it got a bad rep is for years it was strictly functional back in the day... not procedural like C but functional more like F#. Technically you could do procedural in JS, but a lot the solutions to common problems used a functional paradigm. Functional languages and concepts just aren't as popular. So peeps would rather insult than learn. These days that's all changed though as you can do both OOP or functional. For the types... totes get it. Personally I see value in using a loosely typed language. However, I also see the value in a strongly typed one. Fortunately these days, when you need strong types we have TypeScript and Flow.

                                      Jeremy Falcon

                                      1 Reply Last reply
                                      0
                                      • pkfoxP pkfox

                                        See title

                                        In a closed society where everybody's guilty, the only crime is getting caught. In a world of thieves, the only final sin is stupidity. - Hunter S Thompson - RIP

                                        S Offline
                                        S Offline
                                        Shawn Eary May2021
                                        wrote on last edited by
                                        #23

                                        I'm absent minded, but I often spend hours debugging stupid things that C# would flag instantly. Also, the VSCode Intellisense and code navigation in JavaScript projects tend to be sub-par when compared to C# projects on Visual Studio.

                                        1 Reply Last reply
                                        0
                                        • J Jeremy Falcon

                                          Haters gonna hate buddy. Everyone who claims to be an expert at JS that hates is lying. It's more ego where they're fooling themselves than them actually being experts. Programmers aren't known for being mature and all.

                                          Jeremy Falcon

                                          J Offline
                                          J Offline
                                          jochance
                                          wrote on last edited by
                                          #24

                                          Bah. I've been good enough at it to spot obvious idiocy from 'experts'. It's a bad tech founded on bad principle with more bad practitioners than pretty much any other language you want to pick. It will die. It may take a bit, but it will be an archaic relic in the dust bin of history and it will be consigned there inside half a decade once the right bits come along.

                                          1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups