StudieverenigingSTORM/knt

The backend debate: Python, Go, or something else?

Closed this issue · 5 comments

We need to pick a programming language to write the backend in. It has to be easy to use for backends (so no C), easy to learn, and popular enough to not discourage future students from touching the project.

Two very good languages would be Python and Go.

Python

Pros:

  • Known by virtually anybody
  • Heavily used in webdev
  • Large ecosystem of everything

Cons:

  • It's a scripting language
  • No type safety
  • So many libraries to choose from that you don't even know where to start (also a pro?)

Go

Pros:

  • Very simple language
  • Great tooling built in
  • Generates self-contained executables
  • Not a scripting language
  • Has type safety
  • Very popular for CLIs, container tooling (docker and friends), and network servers (see Google, Cloudflare)
  • Built in HTTP library and JSON and whatever you want

Cons:

  • Not as popular as python (but still very popular for doing networked applications)
  • "Rigid" at times, although very debatable (the whole tfw no exceptions, you have to check with an if every error condition stuff)
Siarl commented

I personally have no experience with GO so I might be biased. I would prefer Python since this language is used for quite some courses, so it's easier for people to get into fixing/updating this project in the future. With Flask we can create a simple backend.

vmcj commented

It might be my view only (but I think it is a good thing to specify in the project description based on the discussion..) but the K&T system should be easy for any STORMer to get into helping, this means that the frontend should be very simple to understand so the documentation & programming language should be simple. I would argue that the same holds for the backend as to make it semi mobile this should still be able to be run from the same machine OR completely going through the internet but with some simple basic/authentication.

So the languages to consider are those in the courses of:
introduction to programming (Python3? Java? C++)
WebTech (JS? PHP?)

Where I would say that we either go with TS or Python3, and Python will allow much more customizations if we actually want to hookup alarms etc.

Also given that we run this on an actual machine the overhead of python is not a problem.

Regarding the frameworks, we dont need a framework (it violates the "easy to get into" as someone has to read another set of documentation) as Flask is simple enough and extensive enough that you can create the needed user sections. Or something as SimpleGUI if you don't want to do webtech...

I agree Python3+Flask and web tech (with TS) is a sensible combination and it should be accessible to any STORMer.

The "Python allows more customizations" argument is also interesting.

I will leave this issue opened for a bit more if anybody has a different point of view but IMO it's good enough.

I vote Python as flask is pretty straightforward and I do agree that it should be easy for a STORMer to get into (and since a majority of us are CS students, it makes sense)

Decided to go with Python