[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

Stanford drops Java for JS. https://www.neowin.net/news/sta

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 204
Thread images: 13

File: js.png (10KB, 1052x1052px) Image search: [Google]
js.png
10KB, 1052x1052px
Stanford drops Java for JS.

https://www.neowin.net/news/stanford-university-dumps-java-as-an-introductory-programming-language
>>
>>61503685
And with the IoT, JS will replace C for low-level programming

Say sorry, /g/
>>
>>61503685
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.
>>
>>61503749
>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.
>>
>>61503685
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)?
>>
>>61503685
great. bigger demand for backend people with brains means bigger salary for me. thanks standford!!
>>
>>61503781
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.
>>
>>61503797
>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.
>>
>>61503749
hello world is always shit and will teach you nothing in every language.
>>
File: WVQ7Ovp.jpg (978KB, 1536x2056px) Image search: [Google]
WVQ7Ovp.jpg
978KB, 1536x2056px
>>61503685
Pajeets are taking over Stanford
>>
>>61503824
Someone didn't get accepted at Stanford.
>>
>drops Java
thank fuck for that

>for JS
...oh
>>
>>61503820
Java is the definition of a non-elegant programming language. Why bother people with it is beyond me.

Consider a C++ hello world:

#include <iostream>

int main() {
std::cout << "Hello world!";
return 0;
}


Much more elegant. There's actually an entry point to a program. You can actually write pure procedural code. Why teach OOP before even teaching basic procedural logic? No wonder you people end up all messed up.
>>
>>61503749
>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
>>
>>61504051
the program is the fucking class, moron.
>>
>>61504061
yes
>>
>>61503898
Elegance is for brainlets
>>
>>61503685
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.
>>
>>61504142
>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.
>>
>>61504142
>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.
>>
>>61503820

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.
>>
>>61503781
>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
>>
>>61504251
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()
>>
>>61504334
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.
>>
>>61503824
Because white americans are too fat and too dumb to outsmart Asians and Kebabs.
>>
>>61503685
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.
>>
File: football.jpg (107KB, 1237x902px) Image search: [Google]
football.jpg
107KB, 1237x902px
>>61503685
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.
>>
>>61503898
>Operator overloading in an introductory code sample
C++ fans have Stockholm syndrome
>>
>>61504753

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.
>>
>>61503685
Isn't java and JavaScript basically the same thing?
>>
>>61503685
>as-an-introductory-programming-language

they'll still teach it

they teach every language from python to C++
>>
>>61504772
>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
>>
File: I fucking told you so.jpg (44KB, 499x460px) Image search: [Google]
I fucking told you so.jpg
44KB, 499x460px
>>61503685
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. https://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.
>>
>>61504798

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.
>>
>>61504785
subsets of javascript and c are pretty close
>>
>>61504823
> and master it very quickly

that shows how fucking incompetent you are

mastering anything takes time, there are no shortcuts
>>
>>61504858
A brainlet won't master anything, thou shalt powerful brain master in weeks.
- A. Einstein
>>
>>61504815
> it's exactly like html in quirks mode
So probably more of a browser-company problem than a language problem?
>>
File: doge much faggot very fuck you.jpg (11KB, 221x225px) Image search: [Google]
doge much faggot very fuck you.jpg
11KB, 221x225px
>>61504963
>> 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.
>>
>>61503685
Modern students too dumb to lear some decent language.
>>
>>61503898
>"cout" and a overloaded operator
>elegant
HAHAHAHAHAHAHABHAHAHAHAHAHHAHAHAHAHAHAHAHAH
>>
>>61503797
1. MIT
2.Stanford
3.Harvard
4. California Institute of Technology
5. University of Cambridge
yeah
>>
>>61503898
>int main() {
>int
>integer main() {
>>
>>61503749
What does public static mean/do?
>>
>>61503749
>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.
>>
>>61503749
this is fucking terrible for learning
even C has a better hello world
>>
JS is a horrible language, at least Java teaches you rigor.
>>
>>61503749
Why not just
"Hello, World!"
? Why all the boilerplate for such a simple program? Java is ugly as sin and far too verbose.
>>
>>61504772
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.

>>61504798
That's stupid too, you can get the basics by reading and practicing a few days.
>>
>>61503749
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.

>>61504815
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.
>>
>>61508286
>learning a language with an IDE
worst advice you could give desu
>>
>>61508327
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?
>>
>>61508286
>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.

>>61508327
>>61508353
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.
>>
>>61504858
>>61508094

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.
>>
>>61508597
>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.
>>
>>61503797
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.
>>
>>61508662

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

You just dont know how to learn.
>>
>>61508675
>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.
>>
>>61508726
>normies don't know how to learn
ftfy
>>
>>61508726
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.
>>
File: 1499339541033.jpg (56KB, 620x850px) Image search: [Google]
1499339541033.jpg
56KB, 620x850px
JS was probably chosen because of its real world value and functional aspects.

People just realized OOP was a terrible idea.
>>
>>61503685
anyone betting this is because the new affirmative action niggers are having a hard time?
>>
>>61508957
JS's functional aspects are a complete load of shit. So's its OOP for that matter.
>>
>>61509022
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.
>>
>>61503898
You forgot to add either a newline char. or a
std::endl
.
>>
>>61509049
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.
>>
>>61509147
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.
>>
>>61506707
public is available outside of its class and static allow to call it without initializing object
>>
>>61509825
I'm not that guy but why do either of those apply to main?
>>
>>61510584
>public
The JVM is outside your class, and it needs some entrypoint into your program.
>static
No objects exist when your program begins executing.
>>
>>61504772
That's sweet honey
Now come downstairs
Your tendies are ready
>>
>>61503820
shut the fuck up you fucking faggot
>>
>>61503848
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.
>>
>>61512006
>void main()
Meh. I don't like declaring any main except
int main(int argc, char **argv)
>>
File: 1495999951162.gif (912KB, 240x176px) Image search: [Google]
1495999951162.gif
912KB, 240x176px
>>61503685
>alert('Hello, world!');
>app
WAKE ME UP INSIDE
>>
>>61503709
>Say sorry, /g/
https://www.youtube.com/watch?v=1JZGFjufJEY
>>
>>61503749
Java has one of the worst Hello Worlds desu.
Here's a good one
print("Hello World!")
>>
>>61503709
not with WebAssembly here.
>>
>>61504772
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
>>
>>61513875
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.
>>
>>61503749
class HelloWorld {
sayHello() {
console.log("Hello World")
}
}

const { sayHello } = new HelloWorld();

sayHello()


you can be autistic in Javascript too pajeet.
>>
>>61504815
node.js isn't its own language, you pajeet
>>
>JS
Should've at least chosen Python, not some incoherent browser scripting language.
>>
>>61513875
>>61514261
Theory A has always been more popular than PL shit in US I think.
>>
>>61516546
>Theory A
>PL shit

What?
>>
>>61503781
>a bad mindset on how code actually works
Explain. Code "works" in JS just the same way it does in C.
>>
>>61515270
Now do the simple one-line hello world in Java.
>>
>js

fucking really? this is why stanford is a joke

t. caltard
>>
>>61516560
Theory A is algorithms and complexity and Theory B is logic and semantics which generally includes more programming language stuff.
>>
>>61516370
This desu, I thought the top cs schools would all move to Python as intro lang.
>>
>>61503685
>be located in silicon valley
>realize that even at a place like Standford undergrad is basically useless
>teach kids the skills needed to get a job
>a high amount of jobs that are in the valley are for js

seems like they are doing right. If you need anything more you can specialize and learn that language
>>
>>61516652
It's not like Java is some pinnacle of computer science.
>>
>>61503824
>being not white makes you bad
This is what failures at life believe
>>
>>61516652
>Stamford is now basically just a run-of-the-mill bootcamp
>>
>>61504815
What the fuck did I just read? Why do people write so confidently about things they know little about?
NodeJS and Javascript are the same language.
Javascript has never been "complicated".
There are no "bizarre bugs" in Javascript. The only really weird behavior has to do with easily avoided type casting that you never actually have to encounter if you don't want to.
Strict mode makes relatively minor changes that don't fundamentally adjust the core of the language in any way.
>>
>>61509147
>with no way of enforcing immutability
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze
>>
>>61504142
Kek good schools teach high level languages first, with the goal of teaching programming concepts rather than individual language idiosyncrasies (cornell, mit - python, stanford - JS now)
>>
>>61517219
["10","10","10"].map(parseInt);
> [10, NaN, 2]
>>
Jesus cripes, this thread is full of people who barely know anything about Javascript.
>>
>>61517265
This is trivial to understand if you understand how map and parseInt work. Map provides the array index as the second argument to the callback. The second argument to parseInt defines the number base.
This doesn't really trip up anybody who's been writing Javascript for more than a few days.
>>
>>61517295
>This doesn't really trip up anybody who's been writing Javascript for more than a few days.
You are mistaken about that.
>>
>>61517265
Cont. If you want the behavior you expect, just do this:
["10", "10", "10"].map(x => parseInt(x, 10));
>>
>>61517265
By not using a lambda, map passes in both the value and index for the arguments to parseInt (in that order). parseInt(string, radix) so you really are calling:

parseInt("10", 0)
parseInt("10", 1)
parseInt("10", 2)
>>
>>61517307
Fair enough. It doesn't trip up any person of software dev-level intelligence who's been writing JS for more than a few days and has encountered the parseInt function once or twice.
>>
>>61517322
Do you really think I posted this snippet of code without knowing how it works?
>>
>>61517323
Still mistaken.
>>
>>61517344
I just fail to understand what makes you think this is a negative of JS as a language.
>>
>>61517265
this is a common mistake new programmers make. you should read the documentation, but the gist is that when map is given a function that takes two arguments, it applies the default callback parameters — value, index, array.

so when you pass the object ["10", "10", "10"], map sees parseInt takes a second argument and it also sends over the index (0, 1, 2). so parseInt gets called as

parseInt(10,0); // yields 10 because 0 is a special case.
parseInt(10,1); // breaks, resulting in Not a Number.
parseInt(10,2); // yields 2, because "10" in base2 is 2.

this isn't a "bizarre bug" any more than programming languages have bizarre bugs just because you didn't read the language docs and got confused when they didn't do what you assumed they would do a priori.
>>
>>61517369
I don't remember making a statement of that sort.
>>
>>61517266
>there was an exception so I'm going to stop without telling you what or where
>t. javascript runtime
all you need to know to pass judgement
>>
>>61517344
I wouldn't put it past a random anon to do so
>>
>>61517379
True. Why'd you post that code, then?
>>
>>61515270
big misconception on your side here...
sayHello won't have a context in your example. you've basically proven that you don't understand what classes in JS are. great job
>>
Stanford proson experiment (Zimbardo etc.)

Nuf said
>>
>>61517344
i think we're all responding to you because you seemed to be trying to use this as an exhibit of a "bizarre bug" in javascript. it's not a bizarre bug. either make your criticism more specific or don't comment in programming threads.
>>
>>61517387
It's a bizzare behavior that will take by surprise anyone who works with map in other languages. Also bizzare how parseInt(?,0) works and parseInt(?,1) does not.
>>
>>61517404
>or don't comment in programming threads
Make me.
>>
>>61508597
>A good programmer can learn any language within days, beginners firstly should focuse on low elvel theory and algorithms/data structures.
Not sure I agree. Depends what you mean by "beginners". I think that most total beginners should focus on a fast-iterating interpreted language with easy access and a great ecosystem. Something like JS or Python works well. Then after a few weeks or months of fucking around, they should learn algorithms, data structures, low-level stuff, what compilers do, and so on. The thing is, it's hard to learn the latter stuff if you haven't spent some time fucking around and getting your feet wet first.
Personally, I started with Python, but after I had been fucking around for a few months I got interested in lower-level stuff, learned C, and spent about a year obsessively reading about all sorts of CS topics, the history of programming languages, and so on.
>>
>>61517383
it's a pretty well-known question on stack overflow with a handful of duplicate questions, each with lots of attention. it seems most likely that some anon who didn't like javascript when he woke up this morning just now googled "javascript weird annoying" and found a result that seemed reasonable enough, then pasted that in here, thinking it would be a persuasive criticism of js.

so, i guess what i'm saying is that "i wouldn't put it past a random anon" is generous of you. unless someone proves me otherwise, i assume a well-known snippet of code on 4chan is just a snippet that person found on google for the first time 2 minutes earlier, which they don't understand at all.

if one has spent more time thinking about this than that, then prove it to me by adding more commentary than the most superficial copy/paste of just the problem code. explain why you think this is the wrong way to apply parameters, or how you would do it differently. but i'm not going to assume much of a post that doesn't give me much reason to go out on a limb for them
>>
>>61517420
this isn't a threat. it's advice. like "you're wasting everyone's time — including your own — by posting here". if you just want to waste everyone's time, then okay cool. you've wasted a few minutes of the time of a bunch of people whose time is collectively worthless. i guess that's a pretty cool accomplishment.
>>
KILL IT WITH FIRE
>>
>>61517452
Hello. I'm the anon that posted the code snipped. I don't dislike Javascript. Thanks.

>>61517471
Mate, this in entirety is the purpose of 4chan.
>>
The only correct option for an introductory programming course is Pascal.
>>
>>61517452
Yeah the first entry when you google the code snippet is StackOverflow lol. I'd like to see some legitimate weirdness in Javascript beyond differences in design choices (which I know is out there)
>>
>>61517482
>Hello. I'm the anon that posted the code snipped. I don't dislike Javascript. Thanks.
i mean this honestly and not at all as a rhetorical question: why did you post anything at all?
>>
>>61503685
Is there any fucking reason to attend an Ivy college anymore?

At this rate, they're not going to have any prestige left.
>>
>>61517540
Networking
>>
>>61517540
>stanford
>ivy
>>
>>61517540
Almost any change from Java including JS would be an improvement.
I guess /g/'s dislike of poo in loo Java code monkeys is overpowered by their dislike of web dev hipsters.
>>
File: 1412767308947.gif (2MB, 250x220px) Image search: [Google]
1412767308947.gif
2MB, 250x220px
>>61517551
>Wanting to "make friends" with pozzed rich kids
>>
>>61517265
Even if this code worked, writing code like this is esoterism and should be avoided.

The right solution to this is:
var result = new Array();
for (num in ["10", "10", "10"]) {
result.push(parseInt(num));
}


This code is maintainable.
>>
>>61517579
I know someone who was doing Biomedical engineering, decided to switch to Computer Science in their second semester of Freshman year (no prior experience beyond 1 course, mind you), and immediately got an internship at IBM because of someone they knew. Shits real
>>
>>61517530
You were so all fired up about defending javascript from anonymous bullies so I felt it was fitting to post it.
>>
>>61517610
>map is not maintainable
are you ok
do you have brain damage
>>
>>61517579
>not wanting a good career
>>
>>61517611
>>61517644
I'll pass.
>>
File: 1488908757173.jpg (26KB, 275x295px) Image search: [Google]
1488908757173.jpg
26KB, 275x295px
>>61517610
>map
>esoteric
>>
>>61517643
>>61517663
Congratulations on finding a way to show off how smart you are, too bad you'll be out of jobs because no one hires people who produce obfuscated code.
>>
File: 1482717465946.gif (328KB, 1000x773px) Image search: [Google]
1482717465946.gif
328KB, 1000x773px
>>61517699
Too obvious.
>>
>>61517699
Fascinating.
>>
>>61503749
>concept of classes
Not inherent for computers
>concept of flow control
This phrasing is ambiguous and retarded
>concept of streams
No it doesn't and this is not inherent for computers
>everything makes sense
>public static void String[] args System out

You have 5 lines available for your example program in js but you intentionally only use 1

alert('hello world');
alert('goodbye world');


This would show the most important part of an imperative language. The instructions are executed in the order they are written.
>>
>>61517699
Dude, on the off chance that you're not baiting... almost no-one does "new Array()". That would be far more likely to confuse people than map.
Just do this:
["10", "10", "10"].map(x => parseInt(x, 10));

(or, if no arrow functions are available, do the same but written out using "function() { ... }" syntax.
>>
>>61517719
Sure thing, Spock.

>>61517711
>mix of silly memes and chinese cartoons
Cringey.

>>61517741
>no-one does "new Array()". That would be far more likely to confuse people than map
It's pretty self explanatory, almost plain English really.
>>
>>61513011
people will just run node in webassembly
>>
>>61517741
As a non-js programmer that confuses me since anon said map passes value and index.
Shouldn't you need to unpact x?
>>
>>61517265
['10','10','10'].map(Number)
>>
About to take an entry level Python class for my first CS class at uni. Good or bad?
>>
>>61517757
I don't know what shithole you are a part of, but map is not obfuscation.
>>
>>61517643
>>61517663
>>61517711
>>61517719
>>61517741
>>61517819
He's right though, map is so confusing that people don't even know why it doesn't work as expected in this classic example >>61517265.
>>
File: 1471721024910.jpg (70KB, 557x513px) Image search: [Google]
1471721024910.jpg
70KB, 557x513px
>>61517540
I don't know if it's just me, but I notice the quality of education in general is declining across the board in colleges and universities over the past 10 years.
>>
>>61517832
Map is not confusing, and the example is not classic - classic map does not supply tho arguments, which is exactly what is causing the confusion.
>>
>>61517832
But it's parseint not working
>>
>>61517832
That's clearly not a classic map. Map should pass the element alone.
If you want both do something like map(enumerate(array), f)
>>
>>61517819
>>61517849
It is to most programmers, and companies can't afford to employ only geniuses. So in the real world developers must write code everyone can understand, therefore, all your instances of map would have to be converted into loops before being accepted into a commit.

>>61517854
>>61517865
See, you guys can't even agree on what's the cause of the issue! Whether it's map or parseInt, nobody cares!

The customer doesn't give a fuck who's to blame, he just wants his software to work.
>>
And thus Stanford becomes even more of a joke.
>>
File: 1492583809841.jpg (81KB, 800x533px) Image search: [Google]
1492583809841.jpg
81KB, 800x533px
>>61517877
>It is to most programmers, and companies can't afford to employ only geniuses. So in the real world developers must write code everyone can understand, therefore, all your instances of map would have to be converted into loops before being accepted into a commit.
In the real world, you need to write readable and maintainable code according to modern coding convention and current best practices. Unless the coding convention has changed where map function takes in additional arguments, then their point still stands.
>>
>>61517877
It must be sad to work for the company that relies on its programmers being retards. I use map in my code and it passes code review without issues.
>>
>>61517877
>See, you guys can't even agree on what's the cause of the issue! Whether it's map or parseInt, nobody cares!
It's clearly map. ParseInt should of course accept two arguement in case you want to parse a non base 10 number.
>>
>>61517906
>It must be sad to work for the company that relies on its programmers being retards.
I only care about my paycheck.

>I use map in my code and it passes code review without issues.
Good for you.
>>
>>61517925
Company that pays a good amount does not have to rely on its programmers being retarded. If you cared about your paycheck, you'd be in a company that treats its programmers better.
>>
>>61517779
>map passes value and index
It does. But when using the "fat arrow" (=>) functions, you can write the argument without parentheses around it if you're just going to use one argument.
Traditional-style JS function that writes the arguments to the console:
function(x, y) {
console.log(x); console.log(y);
}

Fat arrow function that uses both arguments:
(x, y) => {
console.log(x); console.log(y);
}

Fat arrow function that only needs the first argument:
x => {
console.log(x);
}
>>
>>61517877
>So in the real world developers must write code everyone can understand, therefore, all your instances of map would have to be converted into loops before being accepted into a commit.
That's completely ridiculous. Every JS programmer with more than a few months under his belt understands map without much difficulty. Using loops instead would be confusing and unusual. The vast majority of popular modern JS libraries use map or other high-level iteration constructs, not loops.
>>
>>61517947
>Company that pays a good amount does not have to rely on its programmers being retarded.
1- Just because someone isn't on the same level as you, doesn't mean they are retarded. The minute you start realizing that, not only you'll be able to start developing some level of humbleness, but also you'll realize everyone starts somewhere and you were also "retarded" at some point.

2- Company pays me well, but at the end of the day, what matters is profit. Expensive genius programmers who can use map are great, but they are hard to find and expensive. I can hire 10 pajeets for the same price and get much more shit done and earn a lot more money for the company and meet my fucking quarterly quotas and win a fucking massive bonus.

>If you cared about your paycheck, you'd be in a company that treats its programmers better.
We treat our programmers just fine. You're the one calling them retarded.
>>
>>61517977
You'd be surprised. You clearly are not familiar with the market. Most programmers I interview haven't even heard of parseInt, let alone map.
>>
>>61517984
>Expensive genius programmers who can use map
No, mate, you are retarded. Being humble is nice, and I am humble when there is call for it, but a statement like that makes you a literal retard.
>>
>>61518002
>You'd be surprised. You clearly are not familiar with the market. Most programmers I interview haven't even heard of parseInt, let alone map.
What language does your company mostly develop in? I have a hard time believing it's JS. If it was, you'd know that map is much more common than parseInt, so it would be more surprising to find a JS programmer who doesn't understand map than one who doesn't understand parseInt. After all, it's pretty rarely that there's actually any need to parse a string into a number, compared to how often one needs to iterate.
>>
>>61518022
Primarily Delphi, but some JavaScript is required since our software is based on Atosed IntraWeb.

We don't use any fancy "map-rich" frameworks.

>>61518021
Whatever.
>>
>>61518021
It's hard for me to imagine anything that would be more expensive than hiring JS programmers so dumb that they don't understand map.
>>
>>61518046
It all makes sense. A pascal programmer. Of course you find map intimidating. Let me guess, you also are afraid or horrible unmaintainable regular expressions?
>>
>>61518080
Congratulations on feeling superior. Congratulations on making less money.

>also no I'm not intimidated by either of these, I grew up on fucking Perl, but I'm a manager now and not a fucking lowly coder anymore
>>
>>61518115
>not even a programmer

It gets better and better.
>>
>>61518123
>can't read
>>
>>61518115
Dude, we're just trying to tell you that "map" is not an advanced language feature. If your JS coders don't understand "map"... if you use "new Array()"... you're writing JS code that looks like it's from 2007 and it will probably be hard for anyone outside your company to understand it.
>>
>>61518125
You are a manager. Your past is of little relevance. You stopped your development and the technology is marching forward.
>>
>>61518137
And I'm telling you the real world is not theoretical, but practical.

>>61518141
Wow. Awesome. Kudos on keeping up with it. Would you like maybe a medal or something?
>>
>>61518150
Well, I guess I get it if your coders mostly write other languages and only occasionally JS.
>>
>>61517952
So it just ignores the rest of the tuple?
>>
>>61518150
I didn't do anything really, it was you who came up with "Expensive genius programmers who can use map".
>>
>>61518166
That's true of most coders. JS is a primary language only for node hipsters.

>>61518205
So you're not expensive or a genius? How come you feel entitled to behave so smugly superior then, you arseweed?
>>
>>61518253
I am expensive, and difficulty of someone else understanding the map function is correlated with my worth.

Think about the advice you're giving. Here, let me rephrase it using more honest language:

> you should not use map because when you are hired into a shitshop with me as your manager to solve problems that only dumb novice programmers can solve, your code does not confuse those dumb novice programmers
>>
>>61518150
I'm not that guy but theoretical map, as in category theory, does not do this two-argument non-sense. Coming from a theoretical computer science background that shit confused the fuck out of me in Javascript.
>>
>>61516684
It's literally what SJW's believe
>>
>>61518284
This "shitshop" probably makes more money than wherever you work at, kiddo.
>>
>>61518200
Yes, although fundamentally there's nothing special to => about that. It's just what all functions do in JS. You don't need to call a function with the same number of arguments that are defined for it. So for example, if have a function called 'f':
var f = function (a, b, c) {
..do something..
}

I can call it like so:
f(1)

And when the function runs, the variable "a" inside the function will have the value 1, and the variables "b" and "c" will simply have the value "undefined".
Arrow functions in JS are for the most part just syntactic sugar for old-school functions. Which means that
var f = function (a, b, c) {
..do something..
}

can be rewritten as:
var f = (a, b, c) => {
..do something..
}

But let's say I want to write some other function, "g", and it should only take one argument. With regular functions I would do:
var g = function(a) {
..do something..
}

With arrow functions I can do:
var g = (a) => {
..do something..
}

, but I can also just leave off the parentheses for convenience and do this:
var g = a => {
..do something..
}
>>
>>61518342
1. You have no idea what I do and how much I am paid.
2. You yourself admitted that you pay your programmers pennies, 10 pajeets for the price of 1 proper programmer.

You shitshop might make a lot for its boss. How is that relevant for a programmer that you're giving your advice to?
>>
File: 1488818687435.png (75KB, 194x300px) Image search: [Google]
1488818687435.png
75KB, 194x300px
>>61518115
>Congratulations on making less money.
>>
>>61518370
I see. I think I prefer arity must match unless you explicitly set parameter as optional.
>>
>>61504051
When I did my course that was like the first hour of a class let alone an entire class man, but besides that i found c# was easier then java though from a beginner stand point.
>>
>>61504051
It does make sense from the language standpoint to have every compilation unit to be a single class. This provides for an extremely simple compilation unit definition.
>>
>all these people shitting on Java
You'll come running back when you need your AbstractBeansFactoryFactoryNode.
>>
>>61504815
>reddit spacing
>tl;dr
Yeah nah, fuck off. You have absolutely no idea what you're talking about.
>>
>>61503685
html is the greatest language ever created it connects all languages together like the human heart
connects the head and feet. HMTL is the life blood of any and all languages ,from now till the end
of time all languages will start and end with HTML the mother of programming languages.
Before the creation of HTML programming was seen as some thing for the nerdy and highly intalagent
html was and is the driving force in connecting the programming legends with the common masses,
the simplicity in which HTML was created means that any console pesent normie can learn it in a matter of hours.
Of all languages html is probably the easest to pick up girls with, for example if you were to
teach a tipical normie women java, C or python she would probibly hey fastrated and confused and quit and you would be left alone
how ever if you were to teach her HTML the mother language she would find its simplicity quite calming
and inviting HTML will bring out her motherly instinct with its innocent and simplistic demeaner HTML.
HTML is so efficent in pick up women if bill cosby had desided to learn it our childhoods would slightly more entact.
HTML is the best language for braggibg rights being the first of you friends to be able to code in html is a major
acomplishment they will great you with envy when you tell your parants you can code for the first time they will say they are proud and mean it
how ever if you say to your friends i can code in C++ or JQUERY they will most like say "well i can code in PYTHON so get off your high horse man"
and your parants will say "thats javascript whats that?" then they will say they are proud and not really mean it
how ever will have a fake forces smile of their face/s.
>>
>>61520746
>>61520796
samefag who doesn't know how to use whitespace or newlines
>>
>>61504785
Aren't*
Thread posts: 204
Thread images: 13


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.