AmbiguousChaos
AmbiguousChaos

Golang, Java or Python

If you are a technical lead or a senior engineer or someone with enough context. How would you decide which language to use for the new application you are writing. What are the factors to consider ?

18mo ago
pareshan
pareshan
Cred18mo

I faced this problem couple of months ago when I started a project. At the core, I use the following principle. "Slow solution is better than No solution"

I was torn between C++, Rust and Python. So I sat down, had an honest discussion with myself on what I need.
I opened up a register and wrote down the requirements, they were:

  • fast
  • low memory footprint
  • cross platform with easy deployment
  • easy to understand code
  • easy to refactor, scale or test
  • good third party dependency manager

Then I wrote down pros and cons of each language, in context of my requirements :

Python Pros & Cons

  • Easy to code and understand.
  • Relatively best dependency management, pip.
  • Fastest for prototyping and experimenting.
  • Faster onboarding and development sprintds.
  • Relatively easy cross platform deployment.
  • Easy to test using pytest.
  • Have recent 2 YOE with latest Python version.
  • Nice logging and CLI support
  • Great community with good debugging support
  • Slow
  • High memory footprint
  • Stupid variables design (call by ref not value)
  • No pointers
  • Type unsafe with only linting
  • Pathetic binaries generator, pyinstaller
  • I absolutely despise lack of curly braces

C++ pros & cons

  • Can be made fastest with careful usage
  • Low memory footprint
  • Perfect variables and memory management
  • God loving pointers
  • Type fucking safe
  • Great compilers available for all major platforms
  • Incredible community with debugging support
  • Have most YOE with it and personal bias
  • Easy to test using doctest
  • Good logging and CLI support from third party
  • Bites you in the ass for compiler errors
  • Painful cross-platform deployment using CMake
  • Slow onboarding and development
  • Not good for prototyping and experimenting
  • Relatively worst third party dependency integration. Your dependency may work on one platform or architecture. It gets tough to integrate components using CMake and handle CMake version conflicts.
pareshan
pareshan
Cred18mo
  • Have to actually dig out good libs to use and spend time understanding their docs.
  • Not so easily readable at first glance but can be improved massively.
  • Requires absolutely massive boilerplate to work with.
  • I'd be spending writing code for several dependencies and build systems (cmake) than working on core functionality.

Rust Pros & Cons

  • Newest thing in the market
  • Best thing between C++ and Python
  • Overcomes several shortcomings of C++
  • Good package manager
  • Easy to understand
  • Easy to code
  • Awesome variables
  • Awesome memory management
  • Pointers <3
  • Type fucking safe
  • Incredibly fast
  • Would learn new stuff
  • Third party libs not as rich as pip or cpp
  • Got no working experience
  • Have no idea on how to structure scalable project in this lang
  • Would have to spend time learning it.

I ended up selecting Python. 4 months in and I am so far happy with my decision.
Do I hate the language? Yes. Do I miss curly braces? Yes. Is this fast to develop? Yes. Is the application slow? Yes. But does app exist publicly? Yes.

I released my v0.1 within 1 month, with C++. I am sure it would take double or triple time of it.

I did not choose Rust since I want to fight only one battle at a time. Me vs core problem. Not me vs core problem & foreign syntax.

We are lucky that we develop software that can be repaired and made faster during development. Whatever we do is not set in stone and we don't have to discard and demolish everything if I find some fundamental mistake. We have VCS.

Although, I thought out and brainstormed everything I could on paper about my application before writing a single line of code. There are several things that you only realise while you are in development.

With python I am in relative ease of tackling development problems fairly quickly.

I will try to extract all the possible juice from Python while I reach v1.0 (have that in roadmap). I am planning on exploring mypy, codon and mojo. And thankfully, things are looking hopeful.

pareshan
pareshan
Cred18mo

Still, If I feel there is more to do and realise that I'm limited by the language.

I can switch to C++ and just release v2.0.

By this time, it would be tad easier for me to code as I would only have to deal with one problem. Syntax.

Since I've already solved the business problem, It would be fairly quick for me to catch up with Python codebase with C++

As a perfectionism patient, this tradeoff of logical discussion helps me move out of my analysis paralysis.

Thanks for reading. Ignore grammer, I'm half asleep at the moment.

BladeRunner007
BladeRunner007

Learn Java first. Its evergreen and you'll learn a lot. Then move to GoLang, it has taken over west and many Indian companies are

Discover more
Curated from across
GooglingInJob
GooglingInJobB2B SaaS9mo

Java springboot or Golang for Node devs

Hi guys, I am currently working in a SAAS startup as a backend Engineer. Tech stack: MERN, AWS, little bit of GenAI now.

I know most big companies use Java springboot for their backend, so I'm thinking to learn it is I want to switch la...

MrBlunt
MrBluntStealth17mo

DSA guide for exp nodejs dev

I am actually a nodejs developer 2 yoe . I feel that Javascript is not sort of ideal language to learn and practices dsa and competitive programming. Except Javascript, I am not good in any pgm language. Can anyone guide me which langu...

DisgustingKohlrabi
DisgustingKohlrabiOracle2mo

Java backend vs Node js

I’m currently weighing the decision between using Java and Node.js for backend development, particularly in the context of projects with strict deadlines.

I’d love to hear your experiences and insights on this topic.

5.1K views
Lord
LordSamsung24mo

Future of Golang

What's your thought on Go as a language. Is it used widely like Java/python? Now a days I see many companies are asking for Go.

#tech #Software #engineering

stranger
strangerStealth17mo

LLD preferred Programming Language

I have generally observed that all system design discussions and tutorials (like youtube channel of Gaurav Sen, Concept and Coding etc) uses Java. My concern is that I work in NodeJS and try to implement the same in JS. I can also lear...