Stanford drops Java for JS

Stanford drops Java for JS.

neowin.net/news/stanford-university-dumps-java-as-an-introductory-programming-language

Other urls found in this thread:

developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode
youtube.com/watch?v=1JZGFjufJEY
twitter.com/SFWRedditImages

And with the IoT, JS will replace C for low-level programming

Say sorry, Sup Forums

class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, world!");
}
}


this familiarizes you with the concept of classes, the concept of scope, the concept of flow control, and the concept of streams. everything makes sense. everything is ordered.

alert('Hello, world!');


this familiarizes you with literally nothing.

>hello world in java makes sense
No, you're just brainwashed. The reason JS makes a poor beginners language is people will end up with a bad mindset on how code actually works. A better one would be C.

Isn't Stanford supposedly in the top 5 of universities in the "world" (aka anglosphere + some other universities burgers happen to know to also exist)?

great. bigger demand for backend people with brains means bigger salary for me. thanks standford!!

hello world in java does not make sense until you understand the basics of the language.

what does "public" mean? what does "System" mean, and how is it different from "system"? what does "println" mean, why does it have parentheses after it, and why is it connected to "System" and "out" by periods? what does "main" mean? what does "void" mean?

these questions all need to be answered before you can do literally anything with the language. if you're learning in a proper environment from the proper sources (like you should be if you're going to fucking stanford), these features act much like the safety on a gun. you may get somewhere, but you're probably not going to get where you'd like to be until you figure out what the fuck you're doing.

javascript on the other hand is a meaningless black box. from that example (and javascript in general) i might as well be offering sacrifices of magical meaningless terms to the gods to make my magical computer box do magical pretty things.

>A better one would be C.
agreed, just make sure to absolutely hammer in how unsafe C is before you let them out of the classroom.

>Isn't Stanford supposedly in the top 5 of universities in the "world"

Stanford is a joke and it's full of Asians, Muslims and assorted nonwhites. An absolute disgrace.

hello world is always shit and will teach you nothing in every language.

Pajeets are taking over Stanford

Someone didn't get accepted at Stanford.

>drops Java
thank fuck for that

>for JS
...oh

Java is the definition of a non-elegant programming language. Why bother people with it is beyond me.

Consider a C++ hello world:

#include

int main() {
std::cout

>this familiarizes you with the concept of classes
because having to make a class just to make a hello world program makes so much sense

this is the OPPOSITE of a good concept of classes

the program is the fucking class, moron.

yes

Elegance is for brainlets

Is still shit. Good schools teach cpp or c and assembly first. Along with classes like os informing how things work. Then they start branching into oop uml poo in the loo options like java, web dev, and servers.

>assembly
That's not exactly a real language, given it is just a human readable representation of the CPU code, and varies wildly from architecture to architecture.
You're having a much more pleasant time programming for let's say an ARM than a x86 mess.

>Good schools teach cpp or c and assembly first

no they don't
they use some simple language like python or something that's distant from hardware to teach concepts of algorithms and general computer science, things that are independent from current computer architecture

then when learning about hardware in parallel does it make sense to learn C

How about freebasic?

thats actually really a shame imo.

i always though java was the perfect intro language, especially for people who need to learn programming concepts but not necessarily become a fully-fledged computer engineer concerned with every last memory allocation detail.

after that, you can move onto other simpler langauges like python, which simplify the process greatly, but uses a lot of shortcuts and half-truths to make it happen, which can teach a beginner some pretty bad habits.

every into java book ive ever read and the intro java class i took would always begin with hello world and straight up say "don't bother trying to understand all these words yet, just know that you need them for now. you will learn what they mean later".

which in my humble opinion is fine because it doesn't take long to get started in functions and objects and that is where you learn about it.

>A better one would be C.

This. Had programmed for years before going to Uni and first semester intro class was programming in Pascal and C. Definitely wasn't a mind blowing unit but using something like C definitely fills in knowledge gaps

Since when is C dependent on computer architecture?
In fact using C or C++ you can show how to manage dynamic memory for container types without any 'magic' involved.
malloc(), realloc(), free()

C becomes hell for beginners when you use shitty APIs.
But there is the obvious solution of not using shitty APIs.
Java actually only caught on because the alternative was using the dreaded windows.h on C.

Because white americans are too fat and too dumb to outsmart Asians and Kebabs.

I think JS is a great first language actually, easy to learn the basics and it's immediately useful. Not very elegant and lots of rough edges, but those are problems when using it in production, not when learning.

However, IMO a university level course should quickly shift to C.

someone make a memeball of JS with the caption "when you ruin the internet" or "when you ruin programming"

Should had used C then C++ for OOP.

Java is garbage, JS is even more garbage.

>Operator overloading in an introductory code sample
C++ fans have Stockholm syndrome

Are you noob?Overloading in C++ can be learned within minutes.
A determined person can learn most of C++ in 1 week and by 2nd week be proficient.

Isn't java and JavaScript basically the same thing?

>as-an-introductory-programming-language

they'll still teach it

they teach every language from python to C++

>A determined person can learn most of C++ in 1 week and by 2nd week be proficient.
that's ridiculous

you need months to get the basics

They're probably teaching Node.js which is actually not bad for an introductory programming language.

Javascript
>Horrendous language
>Designed very quickly
>Has bizarre bugs and behavior baked into the program that can't be fixed without breaking running code.
>So complicated that people avoided programming in it for years, (majority of web use was restricted to "nice" libraries like JQuery for many years).
>Modern Javascript writing conventions are to work within a subset of Javascript with different semantics via 'strict mode' so that it isn't fucking crazy. Strict mode may be thought of as essentially a different (read: good) programming language that closely resembles a subset of Javascript. developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode

Node.JS
>Interpreter for Javascript that comes with a set of core libraries (written in C/C++) and a REPL.
>Said core libraries implement modern features that are typically found in other programming languages as well as many other features that can be non-trivial to implement/work with in other languages.
>Has a package manager called NPM that allows one to easily create projects with external dependencies and stuff, easily install packages (either globally or at a folder level with a hierarchy so that one can easily juggle multiple versions of the same package), easily update packages (with lots of control), and easily upload packages for others to users (it can also be integrated with git and other shit, actually is pretty cash).

Programming node.js code resembles intro programming languages a lot but it has a ton of high-powered features (they're fast too since those are actually implemented in C/C++) like asynchronous program flow, streams (proper ones, not the garbage Java has), events, a bunch of networking features including a built in ability to spin up web servers trivially, etc..

tl;dr: Node.js is actually totally legit, not surprised at all.

Nah, you're just a noob, probably an amateur "programmer" , or college freshman.

A true programmer can pick any language and master it very quickly.

subsets of javascript and c are pretty close

> and master it very quickly

that shows how fucking incompetent you are

mastering anything takes time, there are no shortcuts

A brainlet won't master anything, thou shalt powerful brain master in weeks.
- A. Einstein

> it's exactly like html in quirks mode
So probably more of a browser-company problem than a language problem?

>> it's exactly like html in quirks mode
That is not even close to what I said at all, nor is it a good analogy.

They didn't drop Java. They're just offering JS classes now as well.

The hard part of the teaching is the whole "how do i ask my brain for the routine i need to do with the stuff available" rather than any specific language shit.
The less obtrusive the language the better.

Modern students too dumb to lear some decent language.

>"cout" and a overloaded operator
>elegant
HAHAHAHAHAHAHABHAHAHAHAHAHHAHAHAHAHAHAHAHAH

1. MIT
2.Stanford
3.Harvard
4. California Institute of Technology
5. University of Cambridge
yeah

>int main() {
>int
>integer main() {

What does public static mean/do?

>streams
lmao no

Java doesn't even have proper stream support. For a simple example you can't create a stream manipulation object that takes in a lower case letter at he source and outputs an uppercase letter at the sink. The reason being that you can't write to and read from the same stream at the same time.

The only thing Java "streams" can do is take in a lot of text at one time and at a different time output a lot of text (after being asked to). It is basically no different than an object with some storage inside of it.

On the other hand, in Node.js streams functionality it not only built right in (implemented in C/C++) but it's asynchronous by default. It is therefore trivial to initialize and implement a bunch of double ended streams that daisy chain to form a full blown program (you can even rig them up so that they take in and output different amounts of text and they can transparently link up directly to stdin and stdout).

The rest of your post is also retarded but you obviously know that.

this is fucking terrible for learning
even C has a better hello world

JS is a horrible language, at least Java teaches you rigor.

Why not just "Hello, World!" ? Why all the boilerplate for such a simple program? Java is ugly as sin and far too verbose.

That's just a lie, ask anyone with just a a week of C++ why should you try to stick to noexcept, why would you declare a constructor as explicit and what is the difference between taking an lvalue and rvalue reference. And those are not necessarily advanced concepts, and you need to know them to use the STL well.

That's stupid too, you can get the basics by reading and practicing a few days.

No, it familiarizes you with the fact that you have to write
public static void main(String[] args)
at the beginning of every Java program.

Plus, if you're using an IDE, it usually generates that shit for you when you create a new project. So not that much different.

What? Node.js is a runtime with some extra libraries for being run as a server. It's not a language. And you do know that V8, which runs both Chrome and Node, is written in C++, right? So saying that extra libraries are implemented in C++ isn't that much of a selling point.

That said, Node.js is much more sane environment for writing JavaScript, as opposed to the browser, where you have tons of compatibility issues. Being able to use ES6+ features without thinking is nice. And NPM is pretty good, I'll give you that.

You don't need to shit on JavaScript in order to praise Node. Yes, some old features of JavaScript were bad, but those practices aren't really taught anymore, so I think most new JavaScript code being written these days is already strict mode compatible.

>learning a language with an IDE
worst advice you could give desu

Yeah, it's probably not a great idea, but that doesn't mean people aren't going to do it.

t. learned Java with Eclipse

can you do your assignments in typescript?

>What? Node.js is a runtime with some extra libraries for being run as a server. It's not a language.
You are formally correct, though it's not unusual for people to talk about Node.js as a language for a number of reasons. This is really not a worthwhile argument, if it makes you feel better just think "modern strict mode Javascript with node.js libraries running on an interpreter with a REPL (not a browser)".

>So saying that extra libraries are implemented in C++ isn't that much of a selling point.
The point I was making is that programs written in Node.js often run very quickly because they're really calling C/C++ functions under the hood.

>You don't need to shit on JavaScript in order to praise Node. Yes, some old features of JavaScript were bad, but those practices aren't really taught anymore, so I think most new JavaScript code being written these days is already strict mode compatible.
You are correct here as well. Javascript has certainly come a long way and the practices have been improving steadily since Douglas Crockford published his book (Javascript The Good Parts) in 2008 (many others contributed to the modern state of Javascript both before and after Crockford as well, he just seems prominent in my mind).

For a long time I thought Javascript was a shitty easy language for brainlets due to the limited amount of it I saw in browser code. A few years back I decided to sit down and learn it and found it really confusing. It wasn't until I started looking into Node.js and modern Javascript practices that it started making sense. In my opinion it's actually a really good language with a complicated history and a lot of bad impressions.

IDE's have their own learning curve. People who only program with text editors struggle with getting IDEs to do what they want them to do. On the other hand people who only program with IDEs seem to learn how to use the IDE in lieu of learning how to use the programming language.

are you fucking idiot brainlets?Learning the difference between lvalue and rvalue takes what, 30 seconds?

I learnt C++ in 1 week, and by week 2 I was proficient enough in it, but keep in mind I have alot of knowledge from C/x86 and arm to Java/Python/C#/JS(typescript too).

A good programmer can learn any language within days, beginners firstly should focuse on low elvel theory and algorithms/data structures.

>Learning the difference between lvalue and rvalue takes what, 30 seconds?
And then you need to understand lvalue and rvalue references, universal references, std::move and std::forward, copy and move ctor and assignment...
It's a lot of stuff that simpler languages just don't have to deal with.

Top university refers to research.

I always love how these top universities bait rich kiddies into paying absurd sums to fund their research while none of their researchers will even interact with the students unless they go for a phd and have luck.

Anything of what you said can be learned within minutes, with a simple google search.

You just dont know how to learn.

>tfw people at my university keep talking about how we're starting to become a really good research university but I'm just a lowly undergrad who doesn't do research.
It's kind of okay I guess.

>normies don't know how to learn
ftfy

Sure senpai, there's also iterator invalidation, accidental dangling pointers, heap corruption.
It's something for which a managed language will print a nice error message.
Don't get me wrong, I know cepples but I wouldn't make a programming newbie spend hours yelling at a compiler.

JS was probably chosen because of its real world value and functional aspects.

People just realized OOP was a terrible idea.

anyone betting this is because the new affirmative action niggers are having a hard time?

JS's functional aspects are a complete load of shit. So's its OOP for that matter.

Why is it a load of shit? From experience it's a big step up from Java and C++. It's no Haskell but it's comparable to Python.

You forgot to add either a newline char. or a std::endl.

Functional programming in any language with no way of enforcing immutability is a joke . Like all things in JS, it's a tacked-on and rushed afterthought.

Enforcing immutability is going too far for what JS and Python use cases.

Give me one good reason why immutability should be used for a typical functioning web app front end and back end. It really does not make much of a difference.

public is available outside of its class and static allow to call it without initializing object

I'm not that guy but why do either of those apply to main?

>public
The JVM is outside your class, and it needs some entrypoint into your program.
>static
No objects exist when your program begins executing.

That's sweet honey
Now come downstairs
Your tendies are ready

shut the fuck up you fucking faggot

Pajeets are Java fanboys.

Any book recommendations for modern JS?

I'm not glad for JS, but I'm glad Java is gone

void main() { printf("Hello world!"); }

This is the most elegant Hello World possible. It's simple, and compiles in GCC. Prove me wrong.

>void main()
Meh. I don't like declaring any main except int main(int argc, char **argv)

>alert('Hello, world!');
>app
WAKE ME UP INSIDE

>Say sorry, Sup Forums
youtube.com/watch?v=1JZGFjufJEY

Java has one of the worst Hello Worlds desu.
Here's a good one
print("Hello World!")

not with WebAssembly here.

I wish this was like that scene in Annie Hall, only Bjarne Stroustrup were standing in line instead of McLuhan, so he could hear you say that and then smack you down.

>Not using Scheme for introductory programming
Burger education, everyone

Scheme was a good learning language; I used it in my first semester of my CS degree (in the US btw). I didn't mind it, but a lot of students weren't psyched.

Also, maybe it's just me, but I feel like I see SICP posted about less these days.

class HelloWorld {
sayHello() {
console.log("Hello World")
}
}

const { sayHello } = new HelloWorld();

sayHello()


you can be autistic in Javascript too pajeet.

node.js isn't its own language, you pajeet

>JS
Should've at least chosen Python, not some incoherent browser scripting language.

Theory A has always been more popular than PL shit in US I think.

>Theory A
>PL shit

What?

>a bad mindset on how code actually works
Explain. Code "works" in JS just the same way it does in C.

Now do the simple one-line hello world in Java.

>js

fucking really? this is why stanford is a joke

t. caltard

Theory A is algorithms and complexity and Theory B is logic and semantics which generally includes more programming language stuff.

This desu, I thought the top cs schools would all move to Python as intro lang.