JavaScript

Opinions about JavaScript as first language? It will stunt my growth as a programmer? Some people says that it teach bad habits, and this worries me.

I really do not like webdev, although I'm interested in other areas of programming. But that seems to be one of the most accessible fields of programming to jump in and make some money.

Other urls found in this thread:

cs.vt.edu/undergraduate/checksheets
cms.caltech.edu/academics/ugrad_cs
catalog.mit.edu/degree-charts/computer-science-engineering-course-6-3/
twitter.com/SFWRedditVideos

yeah.... no....

>being this useless

who the hell would recommends javascript for a first language first of all?

you either learn java or python now a days, and if youre not interested in webdev, fucking do not learn JS (BS) you should go for something more object oriented

anyhow, wtf are you doing in here in first place you noob scrub

fuck shit fuck

Well, maybe I did not express myself correctly. I said that although I do not like web development very much and prefer other fields in programming, at the moment it interests me because of the ease of entering that market.

learn C, forget all the other shit languages

>Opinions about JavaScript as first language?
it's pretty poor. in my opinion every aspiring programmer should learn basic C and Java first

>It will stunt my growth as a programmer? Some people says that it teach bad habits, and this worries me.
no, you're not a 4 year old child (I hope). even if you learn a ton of bad habits you're still ahead of someone who knows nothing. you have to understand why bad habits are bad, so you kinda have to learn about them either way

Well web dev is the main thing JS gets used for. So if you don't want to wind up in that field, JS probably isn't the best choice. If you're willing to hate your life in exchange for a white collar job, you can give it a shot, but generally that's best avoided.

JS isn't bad if you limit yourself to The Good Parts. Which is an actual book you should read before attempting JS programming.

Python would be a more appropriate first language IMO. Java is a good intro to OOP foot CS students and not otherwise terribly useful. C would be better than Java if this is literally baby's first coding.

Yes this is true. But I do not intend to spend much time in this, just until I stabilize financially, then I try to move to an area that I like better.

If I had the right time and conditions I would start with a language like Scheme or C. But that is not the case, and I will probably have to go the "wrong way".

That's not quite the case now. You can do more than web dev with JS with the popularity of node and the movement into mobile. I just wouldn't learn it as a first language, since it'll just make you a bad developer.

Where I work we do mostly JS/node for a web app and its desktop mobile counterparts. But it also extends into a lot of other services. I started out with C though.

Thanks, I will search for the book.

What language would you indicate?

then what's the point of programming? you're just another shit pajeet

Javascript is a great first language, it uses C syntax so you know 80% of the syntax starting out. Javascript has powerful high order functions, much more so than Python or Ruby. The only place Javascript lacks is not having mapping and iterator functions so that you are using old fashion C for loops and manipulating variables and incrementing by hand. If you want to use the version of Javascript that uses Python's universal for loops that serve as mapping functions and do comprehension, then learn Coffeescript. Coffeescript is honestly the best scripting language there is right now, its only hampered by the fact that its just a transpiler language. If they ever made Coffeescript a standalone language it would be the absolute best

javascript is literally all objects
what do you mean by more object oriented

>no mapping and iterator functions
for (const foo of bar) {

}

foo.map((bar) => {

})

>Python as a first language
Yeah not learning punctuation is a good habit to have

that's okay. if your main goal is to find a job in frontend webdev quick then go learn js

well, at least you learn to indent properly

>What is inheritance?
>What is polymorphism?
>What are contracts?
>What is scoping?
Dynamic objects and that everything is an object are probably the only two things I like about JS. Its fast to develop in but its also easy to pickup bad practices and write garbage quality code because its so forgiving for newbs.

Honestly OP I'd recommend a strongly typed language instead eg Java because it also happens to be easy to read without being as low level and slow to develop in as C or C++. Strong typing will punish you and point out stupid mistakes and at the end of the day will quickly teach you basics about typing system and inheritance. Once you grasp basic concepts you'll be able to easily transition between C like languages and will even give you basics should you decide to go functional in few years once youre more experienced and happen to find programming interesting.

What about all of those?

>What is inheritance?
>What is polymorphism?
>What are contracts?
>What is scoping?
javascript has all of this

>Honestly OP I'd recommend a strongly typed language instead eg Java because it also happens to be easy to read without being as low level and slow to develop in as C or C++.
seconded, although using typescript instead of java would allow him to kill two birds with one stone

Javascript has inheritance, polymorphism and proper lexical scoping with let and const. Java will cause far more brain damage than modern Javascript.

Learn Typescript. You'll basically learn Javascript at the same time and it makes you aware of the bad parts of Javascript. It's objectively better than Java or Python.

I've tutored multiple first year students and I found JS is actually a really great place to start. You can get more enthusiastic about programming because you immediately can jump into working with a gui, rather than spending an hour to spit out some basic arithmetic in a command line window. The syntax is mostly C like, you won't have to worry about bullshit like forced OOP paradigms (Java/C#) or manual memory management, barely understandable standard libraries functions and behaviors, and cryptic errors from the compiler, linker, and runtime (C/C++). It won't teach you bad habits (Python), unless you use jQuery. Don't start using jQuery. It has higher order functions without the strict and confusing syntax of pure functional languages.

I'd probably recommended learning JS first (basic grasp and fun of programming), Java/C# second (gain understanding of OOP), then C/C++ next (understanding of underlying memory management and compiling).

Worst is to try learning C/C++ first. While it's the language I work in and it is powerful, it's filled with a thousand gotchas, and is frustrating for people to start in.
While python isn't as frustrating, and can even be fun, it's horrible contrarian syntax will give you bad habits. Who the fuck thought __main__ and shit like self was a good idea? Essentially it does everything differently for the sake of being different.
OOP is okay, but can be limiting requiring you to fit your program into its paradigm. At least its build errors are descriptive.

prototype OO is really the best kind of OO you would want to use in a scripting language because of its dynamic nature. You dont have to define classes, you just make objects and start using them and the objects are still capable of inheritence. Class scoping is the reason that high order functions dont work in Python or Ruby as class scope is constantly cock blocking the ability to pass functions freely

>It won't teach you bad habits (Python)
You almost had me until this.

C is a good place to start. Or you could be more modern and work with something like golang or rust.

Coffeescript? What are you even doing.. people just es6+ now or you're a dinosaur in the world of JS.

It's fine. Just start learning already and stop worrying about shit.

>Coffeescript? What are you even doing.. people just es6+ now or you're a dinosaur in the world of JS.
not supported in legacy browsers, and even if it was there is too many syntax hacks, ES6 is ugly and not a clean break

see That is the best advice you can receive, and not enough people follow it.

You can learn as many fucking languages as you want, there's no law that limits programmers to only learning a few languages.

So, when you are starting out, JUST PICK SOMETHING AND STICK WITH IT.

Every second wasted on pondering your options could have been used to getting better at a language, had you just picked something at the beginning.

If you are having trouble choosing, just roll a pair of dice. You should strive to learn all of them eventually, so it doesn't matter where you start.

I hope you mean NodeJS. Never start as a web dev, take on node or python.

I swear to god Sup Forums retards spend more time deciding what to learn and what OTHERS should learn than actually learning and programming. If Sup Forums was a kernel it'd spend 95% of its time scheduling and only 5% would be allocated to other actual useful programs.

>what is polyfill

Whitespace program flow
True instead of true or TRUE
colon instead of curly braces
Have to insert self as the first argument of any method, although you call the method without the first argument
and/or instead of &&/||
if __name__ == "__main__" entry point
duck typed, but no initializer keyword, and strongly typed
No implicit string conversion
DoTrue() if condition else DoFalse() ternary operator
Python 3 not backwards compatibility with python 2.
; Line endings heavily discourage, however statements still can be separated ;
No labeled break or continue
No switch statement
No multiline comments
No implicit multiline statements
Elif instead of else if
And that's the tip of the iceberg. If all a student knows is python, they'll carry over a ton of bad habits they'll have to overcome.

I would recommend Javascript to people who have never coded in their life and have 0 understanding of what they are getting into. The main benefit is the instant feedback you get, and you only deal with the text editor and a browser.

With C you have a sink or swim situation and all sorts out outside factors like code compilation, header files, etc, that would overwhelm a complete noob.

Now, if you are computer savvy and have taken basic computer classes in school that dealt with advanced OS usage then yeah C is probably a good start.

As opposed to JS though...

Okay. Tell me a bad habit you'll pick up in JavaScript. Just because crockpot wrote a smaller book doesn't mean it's bad.

The Definitive Guide book contains a very extensive reference of every single function/method included in the "standard library."

Having slightly different syntax from C does not automatically form bad habits. Multiline comments for instance are not monads. Programmers should be expected to pick up trivial features with a new language.

Unless you're trying to train elementary school students to look like they can program like adults. In which case nobody who cares knows the difference, and you're still a retard.

Automatic semicolon insertion and fake imperative OOP / arrays off the top of my head. Extremely fuzzy == operator probably fucks people up too. 'crockpot' devotes two indicies to a decent short list of stuff that's wrong with JS.

>Automatic semicolon insertion

You're kidding me right?

Javascript is the easiest language to learn right now.

document.write('Hello world!');


You type this instantly in the console of your browser.

>Having slightly different syntax from C does not automatically form bad habits
>slightly
Pythonic syntax is insanely idiosyncratic, and every jr dev I've brought onto my team that started off in Python is always the one having to ask the most question and writing the worst code.

I love inconsistency

Automatic semicolon insertion on return statements gives a pass to all manner of retardation.

oh and my favorite

That's a language feature not a "bad habit".

It's a language feature that encourages bad habits and cultivates a flawed understanding of semantics. Text processing on that level should be left to text editors.

You need to learn programming basics first. JS is quite possibly the worst choice for this other than VBA, since it will "teach" you 100 useless catches that won't apply anywhere else, and handle other real problems magically for you.

Python is a decent choice for understanding the basic premises of programming.

C is a decent choice for understanding how programs actually work on a more intuitive level. In this specific regard, C and C++ are largely interchangeable, imo.

None of these languages cost money to learn, and you will be unemployable for this skill for at least another year. Might as well choose one that will actually teach you.

Stop hiring retards.

It's a bad feature. You should always use semicolons anyway.

Horseshit. HTML and JS being the sloppy mess that they are made the internet possible because somehow near laymen could figure them out and everything they wrote somehow ran in people's browsers. You're fucking retarded if you think JS is anything other than simple.

Trust me, I've fought against hiring most of the candidates we get. But the ones who know anything basic ask for massively inflated salaries because "my CS degree means I should get $120k a yeaR!!!", so we just end up hiring the tards from bootcamps that'll settle for $40k

That's not really what I was arguing. All I said was "it will teach you lots of dumb shit that's not true, and not teach you a bunch of important shit that is true".

That doesn't mean it doesn't try to be easy and simple. I even said it "handles other real problems magically for you".

>You're fucking retarded if you think JS is anything other than simple.
See Not that JS is anywhere near Visual Basic stupid, but it's not a simple language by any stretch. Enabling normies and logical consistency don't often go hand in hand.

>You're fucking retarded if you think JS is anything other than simple.

Sloppy code don't scale up well. You're just blabbing stuff you don't understand. Stay retarded.

Automatic semicolon insertion, == semantics and function level scoping are retarded but they're solved with any decent linter.

>Opinions about JavaScript as first language?
I hate JS but it's a fine first language.

>It will stunt my growth as a programmer?
I don't see why it would.

>Some people says that it teach bad habits, and this worries me.
Bad habits go beyond not learning OOD, which you can do in JS anyway if you really want to. You can write badly in any language and JS isn't hard to write well either.

>I really do not like webdev
Well, you're in luck, since node.js arrived you can now do anything in javascript. Why you'd want to is a different question.

>settle for $40k
Why leave the Bay area when we can hire armies of retards for more than what a white guy with a CS degree nets in the boonies?

Is Ruby an alright first language?

Yes

Just don't do any code golf shit ever (even though it's really fucking fun)

Is Python better or can I stick with Ruby?
>golf shit
What

>Horseshit. HTML and JS being the sloppy mess that they are made the internet possible because somehow near laymen could figure them out and everything they wrote somehow ran in people's browsers. You're fucking retarded if you think JS is anything other than simple.

>sloppy mess
take notice of the specific technical description of syntax and language features this basement dweller is using. This is all youre ever going to get out of a Sup Forums programming thread, a bunch of kids who think js is a 'sloppy mess' and cant give a single specific example of why that is. Its pointless to match wits with an unarmed man, any thing you say here is met with 13 year olds who can only say things like 'sloppy mess'

code golf. Solve some problem in as few characters as possible.

Python is marginally worse (imo) because it doesn't feature OOP so naturally as Ruby, and object oriented programming is basically everything right now. But it's a great language and was my first language.

This one isn't that unusual. Javascript numbers are all IEEE 754 floats and IEEE 754 includes infinity and NaN. NaN should be a number type and it shouldn't equal anything else.

Ok. So I can't go wrong with Ruby, that's cool.
>was my first language
Can first languages really give you bad habits? Did Python shape the way you program or not at all?
Lastly, at what point should C (and maybe ASM) be learned in order to acquire a good understanding of how programming and computers work?

While not an idea first language, it is still the de factor standard for modern web development....and with preprocessors like TypeScript and (too) many frameworks to support all kinds of front-end/middle/back-end work, JS is taking over the world. For better or worse, you NEED to learn JavaScript whether you like it or not. The browser has become its own O/S and JS is the underlying programming platform. Anyone who tells you otherwise is a charlatan and likely someone who just writes firmware in a lab without windows.

>Ok. So I can't go wrong with Ruby, that's cool.

Until you want your app to go beyond proof-of-concept / prototype.

[Im not who youre quoting]
>Ok. So I can't go wrong with Ruby, that's cool.
>>was my first language
>Can first languages really give you bad habits? Did Python shape the way you program or not at all?
Being able to understand a programming language at a low level makes a big difference rather than hacking your way through a language and learning by trial and error which might give you bad habits. The reason that Ruby is so good is because it has a very consistent design that pervades the entire language. Python is not consistent and uses lots of hacky syntax, ie having to explicitly pass self to functions rather than have objects know where they are from. The best book to learn Ruby at such a deep level is "The Well Grounded Rubyist". After you read this book you will begin programming in Ruby at the deepest level and never be wondering why things are working the way they are.

>Lastly, at what point should C (and maybe ASM) be learned in order to acquire a good understanding of how programming and computers work?
C syntax is very simple, you can learn most of C syntax in a half hour. The only specific thing that makes C difficult is learning about pointers and memory allocation. These are concepts you have to understand even in highly abstracted languages as things like stack frames and heap allocation affect how functional languages perform. Dont waste too much time on C because it is the definition of quirky as undefined behavior lurks everywhere.

>Until you want your app to go beyond proof-of-concept / prototype.
thank you basement dweller for your deep insight, the programming industry would crumble if we didnt have fizzbuzzers like you spewing out your ignornance

It doesn't matter. JS is easily the most accessible language. The only important thing is not to stick to ONE language. After a while you'll realize that it's all moreorless the same shit anyway, especially if you're not just language hopping and learning from a good software engineering roadmap.

>a good software engineering roadmap
Any tips?

>Can first languages really give you bad habits?
No, not knowing what you're doing and accidentally picking them up can. They can be avoided in all languages. Watch some uncle bob on youtube.
> Did Python shape the way you program or not at all?
Not at all

>Lastly, at what point should C (and maybe ASM) be learned in order to acquire a good understanding of how programming and computers work?
Dunno, I haven't got there yet. I have an EE friend who I bants with about the abstract/concrete languages.

cs.vt.edu/undergraduate/checksheets
cms.caltech.edu/academics/ugrad_cs
catalog.mit.edu/degree-charts/computer-science-engineering-course-6-3/

I can't remember where I got this list from, I think it might have been Sup Forums itself, but I know that this is a supposedly "good list" of programmes to mimic. Just look at any sort of compsci time table thing, take out the fluff and pretend you're a college student all while learning your language(s) of choice.

>javascript has all of this
It doesn't enforce any of it. JavaScript is a free for all, hence the bad habits.

>"C and C++ are tough"
>The Thread

Do yourself a favor and learn C first. You don't have to master all of its nuances or build massive GUI apps with it. Just focus on algorithms.

Then learn C++ to learn OOP.

Then the easier shit will be a cinch to pick up. But by then you will understand enough to write faster, more efficient code in any language. The last thing this world needs is another JavaScript or Java kiddie writing slow, bloated code because they never coded at a lower level because "omg C is so tough!"

The fact that IEEE 754 is the only number type in JS is mad fucky. They avoided one small intellectual gap for a whole galaxy of weirdness that people normally don't encounter in a for loop.

Ya having only floats is dumb as fuck.

Babel/webpack ya silly goose

>tfw learn javascript as babbys first language
>spend awhile learning concepts over syntax, stick to it way too long
>land a job that will require coding skill
>start learning C/C++ to be able to actually be of use besides ideas
>freak out about being fired for only being experienced in javascript
>first day on job
>"Your job in this group will be to simulate the structure on a computer"
>"in a javascript physics engine"
>tfw Sup Forums stressed me out for no reason

Don't believe the memes. Learn whatever language you want, then learn some more.

>javascript physics engine
disgusting