This thread is not directly related on coding or programming in Javascript, but on sharing thoughts about some things on Javascrpt, so I post it on General Lounge.
First off a WARNING. I am neutal to Javascript. I love to hear different opinions and that is why I create such threads. But if any random wild drama queen emerge, I will be the first person reporting this thread to close. So, NO DRAMA. Nobody is against Javascript and this thread is not a debate on "What programming language is the best?". There is no answer to that anyway. The programming language that solves your problem optimal for YOU, is the best programming language for YOU, for the CURRENT job YOU do. Everyone has different needs, end of disucssion. The topic is different and I hope better than that.
So I realized, that everyone teaching Javascript these days tell people that new properties and methods can be added to objects at any time in a program.
This is true and one thing that makes Javascript flexible, but it is also a huge problem. That is taken most of the time wrong. And it's not the learner's fault. What is wrong is that the prototype design must be correct and solid. Otherwise bad things can happen. The bad attitude that has passed through weak tutorials is that if someone will declare a prototype, but if the design is weak and wrong, "oh well, they can fix that by adding something here and there".
THIS is one of my greatest objections on JS as a "first learning programming language" or "learning programming language" in general. It gives you the power to make terrible code that will actually work. Most people think they know how to program, while they make code ready to be served to an italian restaurant (google spaghetti code).
There is a debate:
"If it works, I don't really care. It works for me."
True. But what if you revisit the code after six months and don't remember what on earth is going on? Commenting will not help a loose design.
Most important what if your code is about to be shared with other people? What if you make a plugin for instance?
Making solid prototypes helps you make solid code, without adding or removing much attributes or methods everywhere. That makes the code easy to maintain, debug, expand and modify, while having a loose approach can make it very hard to maintain the code.
So after sharing some thoughts, here comes a bunch of questions.
1] Do you believe that solid prototypes should be taught or not? Do you believe it is an issue that newcomers in JS create terrible code sometimes? I met many IT guys telling me they hate Javascript. But what I realized after long conversations was that they don't really hate the language. They hate how people use it.
2] Do you believe JS is good for beginner programmers? From one side they can make spaghetti code, on the other hand, you got ease and flexibility. I mean it is REALLY debateable. I learned to code in QBasic when I was 14 years old, when all I had was terrible code examples full of GOTO commands. I am dead serious, there was no internet back then. But I ended up programming well and if you ask me, QBasic wasn't a bad language. I just lacked a good tutorial on structured programming.
3] Tell me a few things you LOVE on JS.
4] Tell me a few things you dislike on JS.
I want to get a bigger picture and maybe this thread would be useful to more people in the future.
P.S. My JS level is newcomer, but I learn really fast, because I already know how to code on several other languages. STILL I am a noob on JS and that's why I make such a conversation.
First off a WARNING. I am neutal to Javascript. I love to hear different opinions and that is why I create such threads. But if any random wild drama queen emerge, I will be the first person reporting this thread to close. So, NO DRAMA. Nobody is against Javascript and this thread is not a debate on "What programming language is the best?". There is no answer to that anyway. The programming language that solves your problem optimal for YOU, is the best programming language for YOU, for the CURRENT job YOU do. Everyone has different needs, end of disucssion. The topic is different and I hope better than that.
So I realized, that everyone teaching Javascript these days tell people that new properties and methods can be added to objects at any time in a program.
This is true and one thing that makes Javascript flexible, but it is also a huge problem. That is taken most of the time wrong. And it's not the learner's fault. What is wrong is that the prototype design must be correct and solid. Otherwise bad things can happen. The bad attitude that has passed through weak tutorials is that if someone will declare a prototype, but if the design is weak and wrong, "oh well, they can fix that by adding something here and there".
THIS is one of my greatest objections on JS as a "first learning programming language" or "learning programming language" in general. It gives you the power to make terrible code that will actually work. Most people think they know how to program, while they make code ready to be served to an italian restaurant (google spaghetti code).
There is a debate:
"If it works, I don't really care. It works for me."
True. But what if you revisit the code after six months and don't remember what on earth is going on? Commenting will not help a loose design.
Most important what if your code is about to be shared with other people? What if you make a plugin for instance?
Making solid prototypes helps you make solid code, without adding or removing much attributes or methods everywhere. That makes the code easy to maintain, debug, expand and modify, while having a loose approach can make it very hard to maintain the code.
So after sharing some thoughts, here comes a bunch of questions.
1] Do you believe that solid prototypes should be taught or not? Do you believe it is an issue that newcomers in JS create terrible code sometimes? I met many IT guys telling me they hate Javascript. But what I realized after long conversations was that they don't really hate the language. They hate how people use it.
2] Do you believe JS is good for beginner programmers? From one side they can make spaghetti code, on the other hand, you got ease and flexibility. I mean it is REALLY debateable. I learned to code in QBasic when I was 14 years old, when all I had was terrible code examples full of GOTO commands. I am dead serious, there was no internet back then. But I ended up programming well and if you ask me, QBasic wasn't a bad language. I just lacked a good tutorial on structured programming.
3] Tell me a few things you LOVE on JS.
4] Tell me a few things you dislike on JS.
I want to get a bigger picture and maybe this thread would be useful to more people in the future.
P.S. My JS level is newcomer, but I learn really fast, because I already know how to code on several other languages. STILL I am a noob on JS and that's why I make such a conversation.
Last edited by a moderator:


