+ 2
Were there any particularly hard/annoying problems you had to overcome in the development of the language JavaScript?
Nearly everything in JavaScript is broken. Here are just a few annoyances: 1. For starters, it doesn’t even have an integer data type! What other language doesn’t have integers? 2. JavaScript doesn’t have normal arrays as most programmers understand them. 3. JavaScript is not object oriented instead it uses prototypes.
9 odpowiedzi
+ 3
junayeD ●_°
1. What do you mean that it does not have an integer data type? What is 10,20,30,84,554 then? I think you meant that we do not have to declare the data type explicitly. It because the type of variable is declared during runtime. Python and PHP have it.
2.I do not get what you mean by "normal arrays".
3.Every programming language does not have to be object oriented.
+ 3
Calviղ Given Typescript compiles into JavaScript, would you agree that front-end developers need to learn vanilla JavaScript WELL before jumping into libraries, frameworks, and transpilers? I have unfortunately seen some developers stuck in jQuery-land given they never learned vanilla JavaScript first so they don't know how to write code outside of jQuery syntax.
So I personally recommend learning vanilla JavaScript WELL first, and then jump into the tools that run on top of it. The benefit, I believe, is that you can much more easily adopt new libraries, frameworks, and so forth as they come down the pike. You're not "stuck" in a particular tool's shortcuts.
+ 2
Ćheyat Integer data type are numbers which don’t not have floating point.(eg 7654 and not anything like 7.876)
But in JavaScript, unlike most other languages integer and float both belong to same datatype called "Number".
There is no explicit data type for integers or floating point numbers, and it often becomes a headache for devs, especially when processing data.
+ 2
Ćheyat on #3. JavaScript is indeed "object oriented" Think of all of the built-in objects with a rich set of properties and methods such as window, document (when working with JavaScript on a web page), and Date and Array. Everything in JavaScript is an object except for primitives but even primitives such as strings behave like objects in that you can access their properties such as length.
The fact that inheritance is achieved through prototypes does not mean it is not object oriented. It just means that there is a different way to implement inheritance of objects. In JavaScript it is done through the prototype chain.
+ 2
Lisa F yeah
+ 2
on #2 yes, JavaScript has arrays, so I am also confused on why they are not "normal"
JavaScript is typeless meaning you do not have to declare the data type of your variables. This also means you can have an array that stores a string, integer, date, and object all in the same array. I cannot think of a reason why you would want to do that, but it's allowed. And guess what? An array is also a JavaScript object itself.
An object is merely a container of properties and their values. A value can be a primitive or another object which in turn stores more properties/values. Some properties can store methods and are hence called methods.
+ 2
If you really want "normal" programming in JavaScript, write Typescript.
Typescript is strong type language, it definitely has integer type, and all other common data types, number , string , boolean , enum , void..
Typescript has normal array with generic array type.
Typescript can be written in object oriented programming with encapsulation, inheritance, overloading, overriding, polymorphism, and abstraction methods.
+ 2
PS: JavaScript is not "broken." If you study why it was primarily created (to respond to human interactivity on a web page which is a very slow process as compared to the responses needed by say, an operating system application) you can see how it works and why it has become the defacto (by fact, not by law) front-end scripting language.
Those who try to force it to work like C or C++ or Java seem to miss the point that it was never created to compete with those languages. It has a different purpose in life.
Also, there is no point in creating a new language that does all of the things other languages already do so well. So study where/why JavaScript applies, and you will start appreciating or at least understanding the things about the language that currently annoy you now.