I’m looking for a programming language that can help me build a desktop application for Windows, macOS, and Linux that’s not big but not small either. Additionally, I’d like to be able to build a website with the same language. I’ve been considering Ruby, Python, Golang and JavaScript. Python seems to be mainly used for scripting and ai, so I’m not sure if it’s the best fit. JavaScript has a lot of negative opinions surrounding it, while Ruby sounds interesting. Can anyone recommend a language that meets my requirements?

19 points

Python can do both scripts and desktop apps no problems

permalink
report
reply
15 points
*

But use type annotations everywhere and make sure your code is always checker clean (with checkin or PR CI hooks). And don’t turn off any lint checks through laziness, e.g. docstring checks. Even for a solo dev it’s always worth having everything typed, checker clean, and docstrings (even if they only effectively say “this thing really is what you’d assume”). It all saves time and effort in the long and even medium term.

I’ve worked on serious large scale Python projects and frankly it’s been very pleasant and productive, but only with the above conditions.

permalink
report
parent
reply
2 points

But what about websites.

permalink
report
parent
reply
10 points
*

I’m writing a web app on Python + HTMX. Little to none javascript involved.

If it’s something simple you can check out FastAPI. For more complicated projects involving data models and relationships, check out Django.

permalink
report
parent
reply
3 points

May I recommend Litestar over FastApi?

permalink
report
parent
reply
1 point

I’ve heard a word or two about htmx. How’s that? Any recommendations on how to start a first project with it?

permalink
report
parent
reply
7 points
*

So many websites out there are built on Django, Flask, etc. (YouTube must have spent a decade using Python, Instagram, Threads etc. all use Python and optimize as they need).

permalink
report
parent
reply
4 points
*

It can do back ends with django and flask but the only choice for front ends is javascript or something like htmx

permalink
report
parent
reply
4 points

Javascript

WASM

permalink
report
parent
reply
1 point

Yeah but be prepared for a lot of pain if you want to distribute your app. Python tooling/infra is abysmal.

permalink
report
parent
reply
1 point

True

permalink
report
parent
reply
10 points

To be fair, all three can probably do what you’re asking for, in building a desktop application. So the real question comes as which flavor of language do you want to write. The only language of the three I can’t speak on is Ruby, as I haven’t used it.

Python is a “scripting language”, but by that token technically so is Javascript. It’s an immensely popular language due to its simple syntax, yet complex features as you get better with it. Python can build large-ish applications: web apps, desktop apps, terminal apps, and yes also of course AI, bulk data processing, etc. For GUI applications, I’ve personally used pyqt (4? 5? 6?)

Much of the same can be said for Javascript. As you said, there are “negative opinions” about JS, but everyone has their opinions (most factually-based) on the goods and bads of languages (although, yes, JS does get more negative opinions than others). Yet, Javascript is still a widely used language, and you’ll probably end up needing learning it anyway if you decide to go into web development.

What I personally suggest is this:

  • See the learn x in y minutes pages for Python, Javascript, and Ruby. Make sense of the quick-tour of the languages.
  • Make a simple project using each of the three languages. Something that just reads something from STDIN, does some work, prints stuff, as an example. This helps you get to know the basics of the syntax, tooling, and quirks of a language, and helps you narrow down which language you’d like to be working further with.
  • Pick one of the languages you’re leaning in favor of and go build your application. If you come to a point where you feel like the language you choose is no longer suitable for what you wanted to do, you can always retry with another language, and then you will know at least a fair part of more than one language.
permalink
report
reply
3 points

I think I’ll just focus on learning one thing at a time to get a better feel for the basic concepts, rather than worrying about what’s the best approach and then try out some, thanks a lot for the response! It really helped me decide to just get started instead of dwelling on the details.

permalink
report
parent
reply
10 points

All three are scripting language. Don’t touch JavaScript, but consider typescript instead. Your requirements are vague, but python should probably be your first choice. It honestly does not matter which one you choose

permalink
report
reply
8 points

I think it would help narrow things down if you described what kind of website you want to build.

permalink
report
reply
8 points

There’s no answer to this. All can do what you want in varying degrees. With Opal you can compile Ruby to JavaScript for your frontend for example. Or with electron you can use JavaScript as desktop application.

You gotta say much more about the actual requirements to make any meaningful comparison.

permalink
report
reply

Programming

!programming@programming.dev

Create post

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person’s post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you’re posting long videos try to add in some form of tldr for those who don’t want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



Community stats

  • 3.6K

    Monthly active users

  • 1.6K

    Posts

  • 26K

    Comments