For Sysadmin/DevOps purpose, which is the most "interesting" language to learn first?
Python or Golang?
I plan learning both but don’t know by which should I start
Explanation welcome :smiling_ai:
(and share/boost/renote welcome too)
Follow

@duponin If this is your first programming language, I'd suggest neither -- both of these languages have some issues that e.g. leave out ability to specify constraints that are useful in reasoning (e.g. constness), so if any of them is your first language you need to figure out that such constraints are useful yourself.

If this is just "what would I want for sysadmin-like purposes", then I'd go with Go if you expect to be doing anything nontrivially concurrent, and would have no opinion otherwise.

@robryk my “first” programming language is Elixir and I would use it for any concurrent and reliable
Golang most advantages are statically linked binary and typing
While Python is for being quick and dirty

@duponin Ah, in that case you'll be familiar with large part of Go's concurrency paradigm, and will clearly see the places where it's weird.

Go's typing is.. weird? Large part of it is sort-of duck typing.

@duponin One thing that's not immediately obvious about is that as soon as you give something typed as an interface to someone, they can change their behaviour based on whether it happens to have some other method on it (so, if you use any interface type, we enter the world of duck typing immediately).

So, e.g. if you give someone an io.Reader, they can use RTTI to ask if it has a Frob() method, and change their behaviour based on this. It's also sadly considered acceptable to barely (in case of checking if a Writer is also a Closer to Close it if it is) document it or even don't document that at all (if checking whether a Writer has a ReadFrom method). This makes embedding a type (i.e. creating a struct with an unnamed field) ~always potentially dangerous, because you might be embedding some methods from the inner type that you'd have wanted to intercept if you knew of them.

Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.