Discuss Scratch
- Discussion Forums
- » Advanced Topics
- » js or python
- Janinainfa
-
Scratcher
100+ posts
js or python
i use jsI use both, although Python is better
which one is better tho
- misaPuding
-
Scratcher
1000+ posts
js or python
I think it is (because, well, think about what you would imagine if you don´tr know anything about C and JS. “Log ”hi“ into console” vs “cout ”hi“”)I don't think it's better than std::cout.print is much more understandable than console.log, I mean….. eurghhh.console.log(“hi”) better than System.out.println(“hi”) or std::cout << “hi” at least
- Raihan142857
-
Scratcher
1000+ posts
js or python
the point of programming isn't to be easy for beginners. imo python's simple syntax is what makes it so badI think it is (because, well, think about what you would imagine if you don´tr know anything about C and JS. “Log ”hi“ into console” vs “cout ”hi“”)I don't think it's better than std::cout.print is much more understandable than console.log, I mean….. eurghhh.console.log(“hi”) better than System.out.println(“hi”) or std::cout << “hi” at least
- misaPuding
-
Scratcher
1000+ posts
js or python
I don´t know Scala, what does “val” do?In most languages, statements (such as if/else and switch) are used to select which code to run. But in newer and cooler languages, they can be used to return a value. One such language is Scala:These languages didn't get in on the “statements as expressions” idea, and as a result JavaScript doesn't have it, either.Please elaborate on the “statements as expressions” part, I don't quite understand
In Scala, the if/else statement can be used as an expression, so a separate ternary operator is not needed.But there are also cooler applications. For example, the “match” expression is like a cooler version of the “switch” statement. Just like the if/else expression, it can be used to return a value.val b = true val i = if (b) 3 else 2This is pretty neat because it prevents you from needing to write “j = ” a bunch of times, and from needing to declare the variable j separately from assigning it.val i = 2 val j = i match { case 1 => "one" case 2 => "two" case _ => "many" }
Another thing you can do is use blocks as expressions:Think of it as a very simple closure that has no arguments and returns the last expression.val f = 3; val i = {val j = 2; j * f + 3} // We only use j to calculate i
Overall, the point of being able to use statements as expressions is to be able to write in a more expressive style, with less boilerplate and a clearer relationship between the different calculations involved.
- Raihan142857
-
Scratcher
1000+ posts
js or python
It declares a variable.…I don´t know Scala, what does “val” do?
- AmazingMech2418
-
Scratcher
1000+ posts
js or python
Actually, a constant. var is for variables.It declares a variable.…I don´t know Scala, what does “val” do?
- 6d66yh
-
Scratcher
100+ posts
js or python
I would rather it have no terminal/commandprompt environment whatsoever. It is overly abstractive, extremely high level and very awkward.I think it is (because, well, think about what you would imagine if you don´tr know anything about C and JS. “Log ”hi“ into console” vs “cout ”hi“”)I don't think it's better than std::cout.print is much more understandable than console.log, I mean….. eurghhh.console.log(“hi”) better than System.out.println(“hi”) or std::cout << “hi” at least
- Steve0Greatness
-
Scratcher
1000+ posts
js or python
Front end or back end?
JS is best for front end things
Python would be best for the back end(better than php)
JS is best for front end things
Python would be best for the back end(better than php)
- gdpr5b78aa4361827f5c2a08d700
-
Scratcher
1000+ posts
js or python
Front end or back end?NodeJS is generally regarded as very good for backend, probably better than Python. Here's how I would personally rate the 4 following backend languages (from best to worst):
JS is best for front end things
Python would be best for the back end(better than php)
C# (ASP.NET Core)
Node.js
Python
PHP
- AmazingMech2418
-
Scratcher
1000+ posts
js or python
How about Go? (honestly though, C# for ASP.NET would not be the best universally, although it might be your favorite, because it isn't cross-platform. XD) Also, Java is used some (a huge pain though. XD), and Ruby has Rails and Sinatra, and I'm pretty sure Dart is used quite often for backend web dev too… Also TypeScript with Deno is another one to look out for, and ASP.NET can be done with VB too.Front end or back end?NodeJS is generally regarded as very good for backend, probably better than Python. Here's how I would personally rate the 4 following backend languages (from best to worst):
JS is best for front end things
Python would be best for the back end(better than php)
C# (ASP.NET Core)
Node.js
Python
PHP
- gdpr5b78aa4361827f5c2a08d700
-
Scratcher
1000+ posts
js or python
ASP.NET Core is cross platform, as well as being pretty fast and secure (primarily due to NuGet vs NPM), Ruby and Java I couldn't really categorise since I don't have that much experience, Dart I've never tried, and VB is probably not worth it since it'll soon be killed.How about Go? (honestly though, C# for ASP.NET would not be the best universally, although it might be your favorite, because it isn't cross-platform. XD) Also, Java is used some (a huge pain though. XD), and Ruby has Rails and Sinatra, and I'm pretty sure Dart is used quite often for backend web dev too… Also TypeScript with Deno is another one to look out for, and ASP.NET can be done with VB too.Front end or back end?NodeJS is generally regarded as very good for backend, probably better than Python. Here's how I would personally rate the 4 following backend languages (from best to worst):
JS is best for front end things
Python would be best for the back end(better than php)
C# (ASP.NET Core)
Node.js
Python
PHP
- PkmnQ
-
Scratcher
1000+ posts
js or python
At least it's there to be the middle-sized snowball in the process of learning big compiled functional snowballs.I think it is (because, well, think about what you would imagine if you don´tr know anything about C and JS. “Log ”hi“ into console” vs “cout ”hi“”)the point of programming isn't to be easy for beginners. imo python's simple syntax is what makes it so bad
Last edited by PkmnQ (May 10, 2021 10:15:35)
- gosoccerboy5
-
Scratcher
1000+ posts
js or python
Because you can use lambda as a temporary variable that's only needed in the function, as a callback (granted other languages may avoid callback h*ll in the first place), a closure (not too sure what those are). In Python, lambda is super limited. Why would you want to be limited?[View post]That's the point. Why use lambda when it's the same thing as just using “normal” functions?Lambda is a concept I just don't get in javascriptYea, cause python lambda is limited to one line
also, if bharvey saw this.. XD
(replying to https://scratch.mit.edu/discuss/post/5215729/)
then again, dart's lambda is superior above all, not even requiring the function keyword, or a clumsy =>
Last edited by gosoccerboy5 (May 10, 2021 15:11:13)
- Sheep_maker
-
Scratcher
1000+ posts
js or python
…If we're comparing syntax, then I would say Kotlin has an even simpler lambda syntax
then again, dart's lambda is superior above all, not even requiring the function keyword, or a clumsy =>
listOf(1, 2, 3, 4, 5).forEach { print(it) } val sum = { x: Int, y: Int -> x + y } val product = items.fold(1) { acc, e -> acc * e }
Last edited by Sheep_maker (May 10, 2021 17:55:01)
- adem1000
-
Scratcher
100+ posts
js or python
i use js
which one is better tho
if you ask me i will say both but if you have less time
i will say javascript but if you have more time i will say both
but i recommend java and C++(not javascript its “java” and javascritpt are different)
- adem1000
-
Scratcher
100+ posts
js or python
i use js
which one is better tho
if you ask me i will say both but if you have less time
i will say javascript but if you have more time i will say both
but i recommend java and C++(not javascript its “java” and javascritpt are different)
because java and C++ are used to make , apps , websites , web apps and more
and also learn a database language cause it is need for sending and reciveing data
- gdpr5b78aa4361827f5c2a08d700
-
Scratcher
1000+ posts
js or python
learn a database language cause it is need for sending and reciveing dataNo it's not. Modern NoSQL databases such as MongoDB don't use their own dedicated language.
- ajskateboarder
-
Scratcher
1000+ posts
js or python
First of all, are you talking about Node.JS or just plain JavaScript?
If you are actually debating this, then JavaScript would be better. The syntax is just more versatile and if there isn't something you can't do in JavaScript that is possible in any other language, you can call the program externally with ‘child-process’ and let the Python script return things.
If you are actually debating this, then JavaScript would be better. The syntax is just more versatile and if there isn't something you can't do in JavaScript that is possible in any other language, you can call the program externally with ‘child-process’ and let the Python script return things.
Last edited by ajskateboarder (May 11, 2021 15:22:51)

















