Discuss Scratch

9gr
Scratcher
1000+ posts

js or python

i use js
which one is better tho
Pufferfish_Test
Scratcher
500+ posts

js or python

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

This is my signature, and appears below eeevvvveeerrrryyy post I write
Try out Ocular



Good evening. I am a gerbil. Are you a gerbil? I know I am. Gerbils are possibly the most important beings in the universe; they are super intelligent and they eat carrots so we don't have to.
If you are reading this, you're probably thinking one of 3 things:
  1. This dude's not a gerbil, he's a pufferfish/human/bison/whatever other organism/inanimate object you mistakenly believe I am.
  2. Why am I reading this????????
  3. I'm hungry
The first one is INCORRECT, and I'm going to have to ask you not to spread that false rumour.
The second one is a valid question, and one that has no satisfactory answer other than that you're really ,really, really bored.
As for the 3rd one - so am I. You're not alone.
DipLeChip
Scratcher
1000+ posts

js or python

python best js cannot compete

stop fuming and start loving :p
Maximouse
Scratcher
1000+ posts

js or python

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).


This is Maximouse's signature. Learn more about signatures.
ninjaMAR
Scratcher
1000+ posts

js or python

I like python better because I find it easier to learn and use

Last edited by ninjaMAR (March 1, 2021 22:12:46)

gosoccerboy5
Scratcher
1000+ posts

js or python

Javascript is better than python on infinity counts

Maximouse
Scratcher
1000+ posts

js or python

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.


This is Maximouse's signature. Learn more about signatures.
SlenTheOoof
Scratcher
93 posts

js or python

I really don't know. Js is easier in my opinion.

Hi! I'm SlenTheOoof! I'm an avid scratcher who makes games and animations, and any anything else. Be sure to check out my profile and projects, and maybe leave a follow, It's free! Scratch On!
gdpr5b78aa4361827f5c2a08d700
Scratcher
1000+ posts

js or python

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
Scratcher
1000+ posts

js or python

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.)


This is Maximouse's signature. Learn more about signatures.
gdpr5b78aa4361827f5c2a08d700
Scratcher
1000+ posts

js or python

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
Scratcher
1000+ posts

js or python

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).


This is Maximouse's signature. Learn more about signatures.
gdpr5b78aa4361827f5c2a08d700
Scratcher
1000+ posts

js or python

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
Scratcher
1000+ posts

js or python

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
}
gosoccerboy5
Scratcher
1000+ posts

js or python

Would javascript be a better language if it weren't for old browsers and scripts forcing backwards compatibility?

Maximouse
Scratcher
1000+ posts

js or python

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.


This is Maximouse's signature. Learn more about signatures.
gdpr5b78aa4361827f5c2a08d700
Scratcher
1000+ posts

js or python

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
Scratcher
1000+ posts

js or python


i use arch linux (btw) with the linux zen kernel and enjoy writing silly things in silly languages using silly frameworks
uwv
Scratcher
1000+ posts

js or python

Pufferfish_Test wrote:

although python has a package for everything
npm go brrrr

i use arch linux (btw) with the linux zen kernel and enjoy writing silly things in silly languages using silly frameworks
gdpr5b78aa4361827f5c2a08d700
Scratcher
1000+ posts

js or python

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

Powered by DjangoBB