js or python

id: 489569

category: Advanced Topics

posts: 561

9gr 9gr loading
i use js
which one is better tho
It depends on what you want to do. Python is great for data mangling, as I like to call it, but if you want to share it with other people, it can be difficult compared to js - js can just be run in the console in any site (yes, I know, csp but that's an exception), and can often also be run on a server using node.js, whereas to run python you need to install python, or find a virtual machine (a repl or glitch project maybe) that you can download it on. Js is capable of making some pretty complex graphics when combined with html, something which you can't do particularly easily with python. If course, the syntax is completely different, and isn't really comparable; most people find python's syntax easier at first, but I find that more complex syntax is really confusing, whilst I find js' syntax makes more sense and is more consistent - to a certain extent.
In the end, there isn't one that's better. It's all down to personal preferences.
although python has a package for everything
DipLeChip DipLeChip loading
python best js cannot compete
Maximouse Maximouse loading

Pufferfish_Test wrote:

Ijs can just be run in the console in any site (yes, I know, csp but that's an exception), and can often also be run on a server using node.js, whereas to run python you need to install python
There is a Python interpreter written in JavaScript. It also has a console.

Pufferfish_Test wrote:

Js is capable of making some pretty complex graphics when combined with html, something which you can't do particularly easily with python.
There are so many graphics libraries for Python – tkinter is even a part of the standard library.

Pufferfish_Test wrote:

If course, the syntax is completely different, and isn't really comparable; most people find python's syntax easier at first, but I find that more complex syntax is really confusing, whilst I find js' syntax makes more sense and is more consistent - to a certain extent.
Python's syntax is stricter, which means it's much harder to not notice that you did something wrong. In JavaScript many common mistakes, such as missing semicolons, don't make the syntax invalid but may cause it to behave differently (automatic semicolon insertion). Python also enforces correct indentation. The JavaScript syntax isn't bad, but I think C-style syntax in general is relatively ugly compared to Python because it uses so many different symbols.

Pufferfish_Test wrote:

In the end, there isn't one that's better. It's all down to personal preferences.
although python has a package for everything
True.

An important advantage of Python you didn't mention is its standard library – you can do a lot of things without even installing a package. The modules it contains include:
  • Text processing
  • Working with text encodings and binary data
  • Date and time calculations
  • Various data structures
  • Mathematical operations
  • Functional programming
  • Working with files
  • Serializing Python objects
  • SQLite
  • Different data compression formats
  • Reading and writing CSV and similar file formats
  • Parsing command line arguments (although I would recommend using a library for that)
  • Log files
  • Using functions written in C
  • Threads
  • Multiprocessing
  • Asynchronous I/O (unfortunately not as good as JavaScript promises)
  • Networking
  • JSON
  • Media types
  • Base64 encoding and decoding
  • HTML
  • XML
  • Interacting with web browsers
  • CGI
  • WSGI
  • Working with URLs
  • HTTP requests (again, a library is recommended instead)
  • FTP, IMAP, SMTP etc. protocols
  • SMTP servers
  • UUIDs
  • HTTP servers
  • IP addresses
  • Working with some media files
  • Converting between color systems
  • gettext
  • Turtle graphics
  • Graphical user interfaces (tkinter)
  • Working with various language features (e.g. bytecode files)

You would need a library to do most of these things in JavaScript (or implement them yourself).
ninjaMAR ninjaMAR loading
I like python better because I find it easier to learn and use
Javascript is better than python on infinity counts
Maximouse Maximouse loading
Another reason why Python is better is strict input handling. In JavaScript division by zero returns infinity, accessing an attribute that doesn't exist returns undefined and trying to concatenate a string with a number converts it to a string. In Python all of them are errors, which makes sense because these typically aren't things you want to do, and if they are explicit is better than implicit.
SlenTheOoof SlenTheOoof loading
I really don't know. Js is easier in my opinion.
potatophant potatophant loading
Personally I prefer JS (but C# better than than both of them… combined.). Python has wierd syntax and if you want other people to run your program, you'll either have to bundle python with it, have it download at install-time, or just have them install it.
Maximouse Maximouse loading

potatophant wrote:

C# better than than both of them… combined.
C# is a compiled language, you can't compare it with Python or JavaScript.

potatophant wrote:

Python has wierd syntax
I don't know why people say this. Python's syntax looks much cleaner than C-style syntax.

potatophant wrote:

If you want other people to run your program, you'll either have to bundle python with it, have it download at install-time, or just have them install it.
You can run Python in a web browser, as I mentioned in a previous post.
(If you want to make a standalone application in JavaScript, you need to bundle node.js, a web browser, or both with it.)
potatophant potatophant loading

Maximouse wrote:

You can run Python in a web browser, as I mentioned in a previous post.
(If you want to make a standalone application in JavaScript, you need to bundle node.js, a web browser, or both with it.)
ElectronJS and react-native are extremely simple to build for both the web and native
I don't know why people say this. Python's syntax looks much cleaner than C-style syntax.
This is a matter of opinion, I prefer C(++/#) and Java style syntax
C# is a compiled language, you can't compare it with Python or JavaScript.
Its still a language though, just like c and c++ and there are lots of benifits of a compiled language, and im just stating my preffered language
Maximouse Maximouse loading

potatophant wrote:

Maximouse wrote:

You can run Python in a web browser, as I mentioned in a previous post.
(If you want to make a standalone application in JavaScript, you need to bundle node.js, a web browser, or both with it.)
ElectronJS and react-native are extremely simple to build for both the web and native
So Python isn't? PyInstaller is simple to use too, and its output is relatively small (Python itself is only about 4 MB).
potatophant potatophant loading

Maximouse wrote:

potatophant wrote:

Maximouse wrote:

You can run Python in a web browser, as I mentioned in a previous post.
(If you want to make a standalone application in JavaScript, you need to bundle node.js, a web browser, or both with it.)
ElectronJS and react-native are extremely simple to build for both the web and native
So Python isn't? PyInstaller is simple to use too, and its output is relatively small (Python itself is only about 4 MB).
JS is easier, doesnt mean python isnt easy
ninjaMAR ninjaMAR loading

Pufferfish_Test wrote:

It depends on what you want to do. Python is great for data mangling, as I like to call it, but if you want to share it with other people, it can be difficult compared to js - js can just be run in the console in any site (yes, I know, csp but that's an exception), and can often also be run on a server using node.js, whereas to run python you need to install python, or find a virtual machine (a repl or glitch project maybe) that you can download it on. Js is capable of making some pretty complex graphics when combined with html, something which you can't do particularly easily with python. If course, the syntax is completely different, and isn't really comparable; most people find python's syntax easier at first, but I find that more complex syntax is really confusing, whilst I find js' syntax makes more sense and is more consistent - to a certain extent.
In the end, there isn't one that's better. It's all down to personal preferences.
although python has a package for everything
You can run scripts online by making a post request to https://webpython.ninjamar.repl.co/api/runpy
Post request
{
    "script":"print('hey')"
}
Response
{
    "script":"print('hey')"
    "output":"hey"
     "timestamp":123456789
}
Would javascript be a better language if it weren't for old browsers and scripts forcing backwards compatibility?
Maximouse Maximouse loading

gosoccerboy5 wrote:

Would javascript be a better language if it weren't for old browsers and scripts forcing backwards compatibility?
Possibly, but in this case it would probably removed and replaced with something new.
potatophant potatophant loading

Maximouse wrote:

gosoccerboy5 wrote:

Would javascript be a better language if it weren't for old browsers and scripts forcing backwards compatibility?
Possibly, but in this case it would probably removed and replaced with something new.
Notably WebAssembly
uwv uwv loading

Pufferfish_Test wrote:

although python has a package for everything
npm go brrrr
potatophant potatophant loading

uwv wrote:

Pufferfish_Test wrote:

although python has a package for everything
npm go brrrr
nobody prefers margarine
notoriously pedantic magistrate
note per minute
napping panda missionaries
nearsighted prank master
nerdy pun mavens
uwv uwv loading

gosoccerboy5 wrote:

uwv wrote:

Javascript has played us for absolute fools
snip
I hope that's sarcastic
it is not

uwv wrote:

gosoccerboy5 wrote:

uwv wrote:

Javascript has played us for absolute fools
snip
I hope that's sarcastic
it is not
see told u js bad

potatophant on another topic wrote:

js bad
9gr 9gr loading


nodejs python MAD (Michigan Algorithm Decoder)
wait theres a programming language called mad lol
JavaScript is used for web development, Python is used for games, software, and other things.

To be a programmer you need to use something like:
C, C# or C++
Python

To be a web developer you need to use:
HTML
CSS
JavaScript

uwv wrote:

Pufferfish_Test wrote:

although python has a package for everything
npm go brrrr
npm isn't that great and python has better built in libraries than js

potatophant wrote:

Maximouse wrote:

gosoccerboy5 wrote:

Would javascript be a better language if it weren't for old browsers and scripts forcing backwards compatibility?
Possibly, but in this case it would probably removed and replaced with something new.
Notably WebAssembly
Atm wasm still needs js to run in the browser/in node/deno, and it needs to be compiled, which I don't really think is where development is going these days. Also the point of wasm is that it's sandboxed so I doubt we'll get any form of i/o or dom within the near future (next 5-10 years probably). Feel free to prove me wrong when we get a fully unsandboxed standalone wasm environment with dom and i/o that requires no build steps in 3 years.

-Digital_Designer- wrote:

JavaScript is used for web development, Python is used for games, software, and other things.

To be a programmer you need to use something like:
C, C# or C++
Python

To be a web developer you need to use:
HTML
CSS
JavaScript
Javascript is still a programming language, therefore you can be a programmer using js - especially as you can use node or deno server side.
That's kind of offensive saying that js programmers aren't proper programmers
Also many other things can be used for web development, including php and webassembly.
Maximouse Maximouse loading

Pufferfish_Test wrote:

Also many other things can be used for web development, including php and webassembly.
And Python. Almost any programming language can be used for server-side development.

-Digital_Designer- wrote:

JavaScript is used for web development, Python is used for games, software, and other things.

To be a programmer you need to use something like:
C, C# or C++
Python

To be a web developer you need to use:
HTML
CSS
JavaScript
Python?
Games?
not realy

Maximouse wrote:

Pufferfish_Test wrote:

Also many other things can be used for web development, including php and webassembly.
And Python. Almost any programming language can be used for server-side development.
I meant client side web development… but that's very true
It's a shame that the days of java applets in tge browser are gone… then I would have said that java was the best out of python and js
before es6 js was bad
In fact I'd still say that java's one of the best programming languages out there
But that is not the point of this thread so I'll stop discussing java
Maximouse Maximouse loading

potatophant wrote:

Python?
Games?
not realy
There are games written in Python, but the engine itself is typically written in C, otherwise it would be too slow.
9gr 9gr loading
To be honest, I prefer javascript over python.
because I am more proficient in lua and javascript can be used client and server side, just like lua

potatophant wrote:

-Digital_Designer- wrote:

JavaScript is used for web development, Python is used for games, software, and other things.

To be a programmer you need to use something like:
C, C# or C++
Python

To be a web developer you need to use:
HTML
CSS
JavaScript
Python?
Games?
not realy
true

-Digital_Designer- wrote:

JavaScript is used for web development, Python is used for games, software, and other things.

To be a programmer you need to use something like:
C, C# or C++
Python

To be a web developer you need to use:
HTML
CSS
JavaScript
Javascript is a programming language.
Maximouse Maximouse loading

9gr wrote:

javascript can be used client and server side, just like lua
Python can also be used client and server side.
9gr 9gr loading

Maximouse wrote:

9gr wrote:

javascript can be used client and server side, just like lua
Python can also be used client and server side.
But python is colons and uses import stuff, it just doesn't look right
Maximouse Maximouse loading

9gr wrote:

Maximouse wrote:

9gr wrote:

javascript can be used client and server side, just like lua
Python can also be used client and server side.
But python is colons and uses import stuff, it just doesn't look right
Modern JavaScript also uses import.
9gr 9gr loading

Maximouse wrote:

9gr wrote:

Maximouse wrote:

9gr wrote:

javascript can be used client and server side, just like lua
Python can also be used client and server side.
But python is colons and uses import stuff, it just doesn't look right
Modern JavaScript also uses import.
But i normally don't use that in javascript for libraries. I just use npm for nodejs
rip I ran out of reasons
ninjaMAR ninjaMAR loading

9gr wrote:

Maximouse wrote:

9gr wrote:

javascript can be used client and server side, just like lua
Python can also be used client and server side.
But python is colons and uses import stuff, it just doesn't look right
JS uses brackets
9gr 9gr loading

ninjaMAR wrote:

9gr wrote:

Maximouse wrote:

9gr wrote:

javascript can be used client and server side, just like lua
Python can also be used client and server side.
But python is colons and uses import stuff, it just doesn't look right
JS uses brackets
It looks better to me

ninjaMAR wrote:

JS uses brackets
Personally, brackets look more structured and solid to me, instead of depending on whitespace for your program to run properly.
Imagine minifying a python program.
Maximouse Maximouse loading

9gr wrote:

But i normally don't use that in javascript for libraries. I just use npm for nodejs
rip I ran out of reasons
How do you use npm packages without import?

gosoccerboy5 wrote:

Personally, brackets look more structured and solid to me, instead of depending on whitespace for your program to run properly.
Whitespace is a more visual way to indicate nesting.

gosoccerboy5 wrote:

Imagine minifying a python program.
There is no reason to do that because you can use bytecode.
while True:
 print("Python is the best!") 
while (true){
console.log("or is JS the best?")};
I'm biased towards Python but….
Python is MUCH EASIER THAN JS. print is much more understandable than console.log, I mean….. eurghhh.
ninjaMAR ninjaMAR loading

Rendangbike2 wrote:

while True:
 print("Python is the best!") 
while (true){
console.log("or is JS the best?") 
I'm biased towards Python but….
Python is MUCH EASIER THAN JS. print is much more understandable than console.log, I mean….. eurghhh.
You forgot the closing bracket

ninjaMAR wrote:

You forgot the closing bracket
See?
Yes, JavaScript is a programming language, I already know this.
ninjaMAR ninjaMAR loading

Rendangbike2 wrote:

ninjaMAR wrote:

You forgot the closing bracket
See?
I do

Rendangbike2 wrote:

while (true){
console.log("or is JS the best?")};
Um.. shouldn't that semicolon be inside the curly bracket not outside

Rendangbike2 wrote:

ninjaMAR wrote:

You forgot the closing bracket
See?
*makes a mistake in the code*
*blames it on the language*
uwv uwv loading

-Digital_Designer- wrote:

JavaScript is used for web development, Python is used for games, software, and other things.

To be a programmer you need to use something like:
C, C# or C++
Python

To be a web developer you need to use:
HTML
CSS
JavaScript
i can make games with javascript smh
9gr 9gr loading

uwv wrote:

-Digital_Designer- wrote:

JavaScript is used for web development, Python is used for games, software, and other things.

To be a programmer you need to use something like:
C, C# or C++
Python

To be a web developer you need to use:
HTML
CSS
JavaScript
i can make games with javascript smh
snake
potatophant potatophant loading

9gr wrote:

uwv wrote:

-Digital_Designer- wrote:

JavaScript is used for web development, Python is used for games, software, and other things.

To be a programmer you need to use something like:
C, C# or C++
Python

To be a web developer you need to use:
HTML
CSS
JavaScript
i can make games with javascript smh
snake
unityscript also (sucks but works)
uwv uwv loading

9gr wrote:

uwv wrote:

-Digital_Designer- wrote:

JavaScript is used for web development, Python is used for games, software, and other things.

To be a programmer you need to use something like:
C, C# or C++
Python

To be a web developer you need to use:
HTML
CSS
JavaScript
i can make games with javascript smh
snake
there was one time i started recreating minecraft in javascript, i havent finished