+ 8

Which language is better python3 or JavaScript for backend??

16th Feb 2020, 12:54 PM
Frivolous
Frivolous - avatar
90 Respostas
+ 20
[Part 1 of 3] Chandan Soni This thread is going to be better in your personal feed. I wish it could remain in Q&A. However, you simply won't get a clear answer as most will respond based on their limited personal experiences and biases with one over the other or get lost in the pedantic nuances between these choices. *Although I'm marking this for deletion,* I'll post my own opinion and experience which you can take or leave. From my anecdotal experience as a seasoned professional software engineer for the past 24 years, I would pick Javascript over Python for any project beyond that of a simple utility script. For clarification, NodeJS is the generally accepted reference for differentiating server side Javascript from Javascript that runs in the browser. NodeJS is the server side runtime for JS where as the browser is the clientside runtime for JS. Anyone who still thinks of JS as a client side language is simply mistaken. [UPDATE] *mfd removed by Fox.*
17th Feb 2020, 6:35 AM
David Carroll
David Carroll - avatar
+ 17
[Part 3 of 3] Anecdotally speaking, many trusted devs I talk to generally share the following concerns for Python: - Python code bases get ridiculously more difficult the larger it gets. - Relatively poor performance in stress tests, especially when attempting to run asynchronous tasks. - Bad experiences with Python in past projects. - Fundamental limitations for scoping support create a ripple effect of awkward language design decisions that will simply never be undone. Ex: - no block level scoping - lack of explicit variable declaration - access modifiers as an afterthought - While Python has a few cool unique language features, it feels very dated for missing many features found in other scripting languages. If I had more time, I could go much deeper into details. This link covers much of what I would list and is echoed when talking with many other experienced professionals in my network. https://softwareengineering.stackexchange.com/q/15468 Take it or leave it. Just my 2 cents. 😉
17th Feb 2020, 7:42 AM
David Carroll
David Carroll - avatar
+ 14
[Part 2 of 3] From a capabilities standpoint, NodeJS can be used to build simple to complex utility scripts, console apps, micro services, web servers, RESTful services, mobile apps, desktop apps, games, be used for machine learning, etc. Recently, we conducted an internal poll within my current company across 2 dozen or so dev teams who operate with full autonomy in tech stack selection. I was surprised to learn that not a single team is willing to use Python beyond the occasional prototypes and simple scripts used for various utilities, automation, and DevOps related tasks. This seems to be consistent among my wide network of professional developers across many different companies across many different job markets throughout many countries. (continued...)
17th Feb 2020, 7:13 AM
David Carroll
David Carroll - avatar
+ 11
Sonic I too have read many articles "claiming" Python to being prominently used in many large companies. It's one of the reasons I've reached out to many developers in my network to figure out what I've not seen myself. After realizing everyone else I've spoken to about this have been just as confused, we all started questioning the validity of these claims. I suspect the claims are mostly from students, nontechnical "tech" journalists, or writers who mistakenly lump core application development in with DevOps and Data Science scripts. I think the rampant adoption of Python in universities combined with a few high profile companies who have embraced Python at one time or may just be stuck supporting it has built this massive hype machine that won't stop. TIOBE Index simultaneously reflects and further perpetuates this hype of massive searches on Python. Too many articles place too much weight on TIOBE Index as a primary indicator. That said... (Response to Sonic continued... )
17th Feb 2020, 8:11 AM
David Carroll
David Carroll - avatar
+ 7
[Part 2 of Response to Sonic] I fully acknowledge my own experience is merely an anecdotal observation that could just be isolated within my own narrow bubble. I even acknowledge this anecdotal bubble includes the observations of roughly 25 very experienced software developers and architects across 18 to 20 companies and maybe 4 times as many if you include our collective past employers and side contracts from the past 5 to 10 years. This is still anecdotal if you extend this to the general collective feedback shared by many other developers to those in my immediate network. I would still consider TIOBE Index to be far less credible as an indicator for predominant use in application development over all. Rather, I would spend some time reviewing the results of a report reflecting the frameworks used on the top 10K, 100K, 1M, and 11M websites based on data collected from webcrawlers. https://www.similartech.com/categories/framework
17th Feb 2020, 8:53 AM
David Carroll
David Carroll - avatar
+ 7
We eventually rewrote it using NodeJS in a fraction of the time and effort with massive performance gains. Your Comment: "Python is ideal for large project as it can do anything that can be done using PHP while node.js lacks the clean coding standard." My Response: The challenges I'm referring to regarding large projects isn't based on what can be implemented, but rather that coordination of multiple developers merging their respective pull requests and the inherent complications that come from such merges over time. While this is inherently challenging for any language, it's a nightmare for Python in too many ways to enumerate here. The bugs that slip in from the most seemingly harmless merges based on white space is where the nightmares stem from. (continued...)
17th Feb 2020, 9:44 AM
David Carroll
David Carroll - avatar
+ 7
Regarding the "clean coding standards" I'm not sure if you are referring to architecture standards like Clean Code and SOLID Principles or if you are making a general reference to some coding standard like PEP 8. If you are referring to the Pythonic Code Standards, this is where I will say it's a matter of preference. People either love it or hate it. I personally am not a fan for many different reasons that would be too off topic. The basic premise for me is my teams typically evolve our coding standards as they make sense for the team. Regardless of the standard we choose, it's about our choices and preferences. With Python, the philosophy of one way, which is often contradicted in the conflicting naming conventions across different libraries, core devs, and timelines. I'm not criticizing the discrepancies as these are to be expected. I just can't blindly follow standards that were created by some council or the BDFL just because they said so. Again, this is a matter of preference for me. 😉 Anyway...
17th Feb 2020, 9:57 AM
David Carroll
David Carroll - avatar
+ 6
It is not necessary to compare which is better. For Python, you can use Django. For JavaScript, you can use Node.js They can achieve the same results.
16th Feb 2020, 1:00 PM
Gordon
Gordon - avatar
+ 5
Mirielle👽 // Node.js accesses all server variables variables require('dotenv').config(); const serverVars = process.env
17th Feb 2020, 3:47 AM
Gordon
Gordon - avatar
+ 5
Content I love to see. I think I'm going to stop fuelling my indecision and suspend forthwith, any more "Python or Node.js" searches on the internet. After reading David Carroll's post, I feel justified in my decision to learn JavaScript/Node. Now I'm just looking forward to completing my Udemy Node.js course and start building stuff! ✌️
17th Feb 2020, 7:55 AM
Chuks AJ
Chuks AJ - avatar
+ 5
Mirielle👽 I can only speak from my personal experiences working with both languages. I'll try to respond to a few of your comments using specific examples from a small slice of my own experiences. Your Comment: "Well node.js will only be be best free when compared with python in web application development." My Response: While I've done a lot of web application development in NodeJS over the years, that might represent only half of the types of development I've done in NodeJS. A few examples of services and console apps in NodeJS I'm referring to are: - File extraction from HAR files. - Image processor for a number of media file conversions like, EPS to SVG to PNG to resized PNG. - Scanning over 100 SVN repos via SVN client commands to refresh course XML files in MongoDB GridFS based on comparison of commit revision numbers. - This was originally prototyped in Python. We spent much effort hacking around the limitations of the GIL and various alternative work arounds. (continued...)
17th Feb 2020, 9:25 AM
David Carroll
David Carroll - avatar
+ 4
ChillPill yeah, this is the case for most "which is better" questions.
17th Feb 2020, 1:49 AM
Sonic
Sonic - avatar
+ 4
David Carroll I'm just curious to know why so many prominent companies have chosen to use Python on their back-end and in globally used web sites. Is it due to the "Python when you can and C when you must" mantra or something like that, although I can't recall exactly where I heard that?
17th Feb 2020, 7:25 AM
Sonic
Sonic - avatar
+ 4
David Carroll very interesting discussion indeed. It's a bit sad when threads like this get mfd'd as I feel that others in the future can also glean some facts from them, even if any 'truths' are concealed amongst the myriad of opinions here backed by articles from so called tech journalists. As to the BDFL, I heard that Guido has had one or more stints at Google. I wonder if the Python hype at big tech has got something to do with that as well. However I also recently heard that Facebook had a lot of trouble with Python during some scaling-up activities, although I don't know if this is Django related or not. As to collaboration, I wonder if more Python friendly merge tools (with better contextual treatment of white space) will help in larger projects in the future.
17th Feb 2020, 10:46 AM
Sonic
Sonic - avatar
+ 3
Mirielle👽 What is "the interesting thing that Python can do and JavaScript might fails to do"?
16th Feb 2020, 2:18 PM
Gordon
Gordon - avatar
+ 3
Chandan Soni You are welcome. If you proceed with Node.js, after learning Node.js, learn Express.js, then learn body-parser, then ejs, then mongoose. After that, you can build database applications and RESTful API.
16th Feb 2020, 2:29 PM
Gordon
Gordon - avatar
+ 3
Mirielle👽 Thanks for sharing your experiences. I'm only speaking from my own real world experiences on teams with some talented developers. These are the general consensus we have and it may not be accurate. Hopefully I was able to shed some light on where I'm coming from. Now... I must sleep. 😉
17th Feb 2020, 10:00 AM
David Carroll
David Carroll - avatar
+ 3
David Carroll Yes you need to sleep 😁 This thread is going from bottom to top. Simple answer was there is no comparison between python3 and JavaScript Because Python is server side and this can be use as back-end and JavaScript is client side which cannot be use as back-end.
17th Feb 2020, 10:13 AM
A͢J
A͢J - avatar
+ 3
JavaScript is not (fully) made for backend programming. You could use PHP because it is the most used website backend programming language. I recommend it. But as you have asked for Python, you can actually use that too. There are some frameworks of Python made only for backend web development. Such as Flask, Django etc. If you are a beginner, I recommend Flask
17th Feb 2020, 11:25 AM
Ahnaf
Ahnaf - avatar
+ 3
First you will check your requirement and after choose python and js. MY Opinion python is best and i am also use python.
18th Feb 2020, 7:27 AM
Syed Ahmed Raza Shah
Syed Ahmed Raza Shah - avatar