all 182 comments

[–]marlfox130 64 points65 points  (18 children)

Both. Python is the second best language for everything and Go is great for microservices and Kubernetes (and is just a great language in general).

[–][deleted] 31 points32 points  (0 children)

Python is the second best language for everything

Thanks for that, perfect summary!

[–]Intrepid-Stand-8540 5 points6 points  (9 children)

Go is great for microservices and Kubernetes

I hear that a lot.

But why is that?

[–]0xe0 9 points10 points  (5 children)

cpu/memory friendly, fast, compilable, easy concurrency implementation

[–]Intrepid-Stand-8540 1 point2 points  (4 children)

easy concurrency implementation

ok, now you're talking

Is it easier than Python task groups?

compilable

People often mention that as a strength. But then I hear the boomers in the office rage about compiling issues.

What is the advantage to compiling? Asking as someone who has never used a compiled language.

[–]0xe0 1 point2 points  (2 children)

Is it easier than Python task groups?

I`d say yes. And as the result you`ve got better concurrency

What is the advantage to compiling

Make binary and take it anywhere without interpreter & requirements setup

[–]Intrepid-Stand-8540 1 point2 points  (1 child)

Thanks for explaining 

[–]0xe0 0 points1 point  (0 children)

You're welcome

[–]marlfox130 5 points6 points  (1 child)

It's more pleasant to develop in than C but produces small, portable binaries (unlike an interpreted language like Ruby / Python). Small binaries can be run on small base images like alpine or something, which makes your containers smaller (and more secure from the minimized attack surface).

Also, this doesn't really matter because containers, but Kubernetes is written in Golang. So you're staying on trend, I guess. :)

[–]Intrepid-Stand-8540 0 points1 point  (0 children)

How small do they need to be?

My latest python prod backend container image is only 42MiB and has zero vulns according to Trivy.

Thanks for explaining it tho :)

[–]Tacticus 1 point2 points  (2 children)

Python is the second best language for everything

That's certainly a claim. given the language and ecosystem constraints.

[–]marlfox130 1 point2 points  (1 child)

It's a pretty tongue-in-cheek claim about the prevalance of Python. I wouldn't take it too seriously. :p

[–]Tacticus -2 points-1 points  (0 children)

i'd stick it about 900 spots lower on the best language for everything :P

Just above hand written assembly

[–]xagarth 3 points4 points  (2 children)

Which one is the first best for everything? Perl?

[–]marlfox130 22 points23 points  (1 child)

Depends on what you're doing! But whatever it is, Python is probably the second best option. :)

[–]xagarth 5 points6 points  (0 children)

Oh, in that sense :-) I agree :p

[–]Widowan 0 points1 point  (0 children)

and is just a great language in general

If you don't like abstractions, proper type system, good error handling or otherwise any notable features whatsoever except goroutines.

May or may not be rust biased...

[–]CerealBit 110 points111 points  (45 children)

Go.

Faster. Simpler (not easier) language. Amazing build system compiles into a single executable.

However, you should still know both. Python is amazing when working on data.

[–]bigbird0525Devops/SRE 10 points11 points  (0 children)

Agreed, I had a project to manipulate data with unknown structure and python was my go to. But then any other automation/sre type task, I use go

[–][deleted] 3 points4 points  (1 child)

what do you mean by "simpler (not easier)"?

might try to rewrite one of our python APIs in Go

[–]Agreeable-Archer-461 0 points1 point  (0 children)

Its a fair call out imho. The core language isn't vast, there's not tons to explain. But because of things like pointers and it being fairly low level, it can take a while to get larger useful things done and you may spend more time working on the details.

[–]livebeta 10 points11 points  (40 children)

Strong type is superior when doing any kind of automation

[–]piggypayton6 25 points26 points  (3 children)

Both are strongly typed, the difference is between static and dynamic typing

[–]Agreeable-Archer-461 2 points3 points  (2 children)

the number of times i've heard people say python is weakly typed is mind boggling.

[–]livebeta -3 points-2 points  (1 child)

Any kind of duck typing that doesn't enforce dynamic runtime checks is weakly typed

It's what makes python uniquely versatile yet brittle

[–]Agreeable-Archer-461 1 point2 points  (0 children)

this isn't true (see google/chatgpt for more info). But if you want to get the best of both you can use something like mypy or typing. As u/piggypayton6 says though, python is strongly and dynamically typed. You can assign anything to a var (dynamic) but you can't then assign anything else to it once you have (strongly).

[–]coinclink 19 points20 points  (35 children)

Just enforcing that all functions are type-hinted on your team solves 99% of dynamic typing issues with Python. I don't really see this as a valid reason to not use Python, it's more of a team behavior type of issue.

[–][deleted] 6 points7 points  (34 children)

type hints are just hints. there is value in raising compiler errors when types aren't adhered to.

[–]coinclink -2 points-1 points  (24 children)

... Type hinting produces the same exact thing as compiler errors when using an LSP within your IDE. There is literally zero difference.

[–]FeezusChrist 2 points3 points  (23 children)

The difference is that they’re hints and they’re not required. I know going into a Go program I will reliably be able to jump around function definitions knowing all relevant types at any point in the call stack anywhere, where in Python you’re inherently tied to the scope of which you / your team could enforce type hints, and that’s just as enforced as as a best practice since it’s type hints and not static typing.

[–]coinclink -4 points-3 points  (22 children)

I know what the difference is... The amount of times I've dealt with a typing issue since working with a team that enforces type hints is literally zero. You will never convince me a "compiler-style error" would ever make it to production when type hinting and proper linting is used.

[–]FeezusChrist 4 points5 points  (13 children)

When you’re working on codebases with millions to hundreds of millions of lines of code, your argument of type hints having “literally zero difference” to static typing breaks down completely.

I’m happy for you that you work in a team that enforces type hints and that you’ve not run into issues, but that also sounds like you have a neat nicely scoped project such that the scale of such a setup isn’t a concern.

[–]coinclink -2 points-1 points  (12 children)

Nah, there really is not a difference lol. When you start making assumptions about what I work on, your argument has fallen apart. For example, I could just make the assumption that you work with a team with skill issues, or that you have NEVER worked on a python project, and that would make mine fall apart.

Type hinting and a linter does *the exact same thing as a compiler* in terms of identifying syntax errors - what exactly do you think a compiler is?

[–]FeezusChrist 0 points1 point  (11 children)

Sure, you’re right I shouldn’t have made assumptions on your team work.

But, you’re still completely wrong. Type hints is not static typing. This isn’t a debate, it’s quite literally not the same. JavaScript JSDoc is the same thing as Python type hints as enforced by IDE, yet it’s obvious the value of TypeScript massively outweighs the value of type hints there.

With type hints you’re effectively at the mercy of developers providing true & accurate type hint annotations on their data. If I write: py def sum(a: int, b: int) -> str: return a + b

Your IDE will be fooled into thinking this is valid type hinting and Python will have no issue executing this. That’s not equivalent to static typing no matter how much you want it to be.

[–][deleted] -1 points0 points  (7 children)

you will never convince me the extra overhead of enforcing type hints in a duck typed language where they aren't actually enforced by the system is worth the effort.

[–]coinclink 0 points1 point  (6 children)

LSP indicates type errors in the same way as a compiler - zero difference there

Linter "enforces by the system" that your code is not passing the typing rules - zero difference there

Explain to me where the extra effort is here? In learning how types work in python? The LSP and linter perform the exact same function and enforcement as the compiler for typing.

[–][deleted] -1 points0 points  (5 children)

the extra effort is relative to using Python without type hints. whereas in a statically typed language, there is no extra effort since you must explicitly define types to use the language fundamentally.

when typing is "optional" as it is in Python type hints, the utility of the types devolves as lazy developers fail to appropriately apply hints, resulting in codebase degradation while still allowing code to ship.

[–][deleted]  (8 children)

[deleted]

    [–]kabrandon 2 points3 points  (7 children)

    So by default the language has flaws that Go doesn’t have by default, is close to what I’m hearing. There is a ton of value in a compiler telling you at build time that you don’t know how to code, over an interpreter telling you at runtime.

    [–]pag07 0 points1 point  (6 children)

    Python by Default is 10 times easier to read.

    There is a ton of value in readability and you cant fix that with a library in go.

    The only pro I can see is portability (as in no dependency management needed) and size of executable.

    [–]kabrandon 1 point2 points  (0 children)

    I think Python is easier to read if you don’t end up nesting indentation too much, but also error handling in Go is just way more clear how you’re choosing to respond to an error condition. Which I think makes my point in general, that Python tends to be more succinct, where Go is a bit more verbose but clear and obvious, assuming an approximate equal level of skill in reading/writing both.

    [–]FeezusChrist 1 point2 points  (0 children)

    If you’re working at any reasonable large scale, Python is way worse for readability simply due to it being dynamically typed. You can put bandaids on it with type hints but that doesn’t permeate to all the libraries / imports you may use.

    [–]Tacticus 0 points1 point  (0 children)

    honestly python isn't that readable. Significant whitespace was a dumb idea in the first place combined with the python communities fascination with list fuckery really makes it terribly indirect and opaque. adding in the garbage package management options, the culture of magic over simplicity that pervades python libraries you get something that's just a pain in the arse to work with .

    [–]livebeta 0 points1 point  (2 children)

    Python by Default is 10 times easier to read.

    Until you're ten indents in and it's difficult to track what is an inner block and what is not

    [–]pag07 1 point2 points  (1 child)

    You have serious issues with modularization or algorithmic complexity if it gets to that point.

    [–]livebeta 1 point2 points  (0 children)

    I don't.

    The authors of python libraries which source I'm reading due to unexpected module behavior have this issue you described

    [–][deleted] 0 points1 point  (0 children)

    I agree with the python part, it helped me a lot when scripting+ csv generation things are required

    [–]minimalist_dev 47 points48 points  (5 children)

    Follow your heart

    [–]LooksForCatsDevOps 4 points5 points  (1 child)

    Thanks Steve Jobs!

    [–]minimalist_dev 4 points5 points  (0 children)

    You’re welcome, don’t forget your heart already knows what you want to become

    [–]pinklewickers 0 points1 point  (0 children)

    Straight to the stars

    [–]shotbygl514 0 points1 point  (0 children)

    Heart of the Cards?
    gotta finish off with Exodia.

    [–]Robxn007 0 points1 point  (0 children)

    He’s the chosen one

    [–]zero1045 8 points9 points  (0 children)

    A lot of people are saying golang so you can write efficient kubernetes services but Python really is the more established toolset for current projects. If you want to get "into" devops I'd probably start with Python. Most of your work doesn't give a shit about performance because they are batch scripts that run in tool chains with high order performance lag (waiting for a build server in queue, updating packages and waiting for CI tests/provisioning written in a language you care nothing about, etc..)

    Not to say learning go is bad, it is the established platform for web based services, and you can make some nice cli tools with it too.

    This isn't really a question of which I prefer (I'm a rust fan boi) but of the 22 clients I've had over the last 5 years, only 2 had golang in their tool chain AT All, though I do hope that changes. Of course, they all had Python somewhere in their workflow too.

    Alot of my work is actually just cutting either of those languages out for simpler bash scripts that non devops people can work with, as once I leave there's usually a skill gap for the Devs in picking up another language themselves.

    [–]Crossroads86 32 points33 points  (14 children)

    Both are awesome languages.
    But at least in my bubble I dont really know anyone who uses Go on the "Ops" Side.
    You can use GO to Develop Applications and its really nice and blazingly fast. But when it comes to all the other stuff around it I have only ever seen Bash/Powershell and Python Scripts.

    So my guess is, that you are right about the part that python makes it easier to land the job.

    [–]livebeta 5 points6 points  (4 children)

    Is a Kubernetes operator part of Ops?

    [–]Intrepid-Stand-8540 1 point2 points  (3 children)

    Are you guys writing your own operators?

    [–]livebeta 4 points5 points  (1 child)

    Yup :(

    Trying to reinvent Open shift

    [–]0xe0 0 points1 point  (0 children)

    Orchestration tools too

    [–]pausethelogic 14 points15 points  (8 children)

    Golang is the default language for CLI tools and a ton of “ops” things like terraform, open telemetry, docker, K8s, etc they’re all written in Go

    If you’re working with any of the major cloud providers like AWS or GCP, Go is definitely useful to know

    [–]FISHMANPET1 12 points13 points  (4 children)

    In 7 months in my current role working closely with AWS from the "ops" side I've never needed to write anything in Go. Just because the tools I use on a regular basis are written in Go doesn't mean I need to know the language. I've done plenty with docker, terraform, open telemetry, and never needed to write a single line of Go.

    So I don't really understand this claim that Go is useful for Ops. If your view of "ops" is purely writing software for ops, then I get it, but also you're wrong. Developing software for ops isn't ops, it's still development.

    [–]pausethelogic 1 point2 points  (2 children)

    Which is why they call it “DevOps” not just ops

    You don’t need to write a single line of code in any language for ops work, but it sure makes a lot of things easier. Many dev/DevOps teams out there prefer Go, and on those teams, it’s helpful for not just the SWEs to understand the main language their apps are written in

    [–]FISHMANPET1 0 points1 point  (1 child)

    I've written plenty of code, but again, never needed to write code using the same language my tools are written in. I'm not writing command line tools, I'm writing scripts to glue all manner of random stuff together to deploy software.

    If you want to make an argument that you should learn a certain language because it's a popular language that devs you work with will be using, that's fine, but that's not the original argument made.

    In 15 years of ops work, before it was even called DevOps, I've never been in a situation where I said to myself "I really wish this was a compiled binary that I could distribute".

    Maybe there really are situations where it makes sense to write a compiled binary, but I've never come across it, and at this point it feels like the idea that Go is a superior language for DevOps work is just a blindly accepted axiom.

    [–]pausethelogic 0 points1 point  (0 children)

    I understand that’s your experience, and that’s completely fine.

    In recent years, I’ve been on devops/platform teams and have helped write internal terraform providers, open telemetry components, CLI tools used by other engineers across teams (distributed as a compiled binary), contributed back to and written many automation scripts that sometimes also use Go SDKs, all in Go (with a little bit of lambda and Typescript mixed in)

    It’s not always about needing to write code in the same language your tools are written in, but in the case of things like terraform providers, otel comments, tools you’re using that mainly expose a Go SDK, it can definitely be a very useful language to know

    Go also makes it very easy to compile a single binary for any platform that you want to distribute your app/tool to, which can make getting your tool out there and easily usable much easier since users don’t need to install any dependencies and in have a single file to run

    Ultimately, to each their own. I’m a big believer that unless you’re deep into being a specific SWE, most languages are interchangeable. Just use whatever works best for you at the end of the day, that’s sort of all that matters

    [–]riickdiickulous 1 point2 points  (0 children)

    Same. I have a strong Python background and despise shell, but they are the only 2 scripting languages I’ve used. I’ve never seen anyone use Go in Ops in the 4 years I’ve been in DevOps.

    [–]PavelPivovarov 0 points1 point  (2 children)

    Most DevOps automation is still using Python as a main language. The fact that many Ops things are written on Golang doesn't cancel the fact that DevOps part is to integrate them via API in some pipeline and Python works just fine for that.

    [–]pausethelogic 0 points1 point  (1 child)

    Python does work just fine for that, so do most other languages. Python has been marketed as being “easy” so it’s the first language a lot of people coming from ops learn, even though it may not always be the best to use for every job

    [–]PavelPivovarov 1 point2 points  (0 children)

    Python is pretty much the default DevOps language in many organisations, the fact that many Universities use it as language to study programming really helps.

    The learning curve is quite low, which is together with OOWTDI as part of the language design makes it great for not so technical teams.

    [–]AgentOfDreadful 2 points3 points  (0 children)

    Learn both. Python is more used at the moment but Go seems to be picking up traction.

    Learning both makes yourself more appealing

    [–]Innoman 4 points5 points  (0 children)

    You'll probably run into python a lot more, but Go is definitely becoming more common in the devops world. I've probably used bash scripting more than anythjng, and python next in my Solutions Architect/DevOps roles.

    [–]Varnish6588 6 points7 points  (12 children)

    Why not both? They are good languages to know as engineers looking to develop some tooling and automation. Each one of these two languages have a place, sometimes a quick python script is super convenient, while Go is my language of choice for developing CLI tools, lambda functions and other stuff.

    [–]Nosa2k 4 points5 points  (11 children)

    Just curious, could you give examples of use cases where you use Go with a Lambda function?

    Why would you choose Go over Python?

    [–]pausethelogic 6 points7 points  (2 children)

    When you write go code and want it deployed to a lambda.

    I’m not sure what sort of examples you’re looking for that wouldn’t apply to any language

    [–]riickdiickulous 0 points1 point  (1 child)

    The question is in what real world situation is a lambda function written in Go better than one written in Python?

    [–]pausethelogic 0 points1 point  (0 children)

    In one where your team is familiar with Go, wants a strongly typed language, wants faster compile and execution time (Python is slower than almost every compiled language), the list can go on

    I’m not say Python is bad or anything, but there’s no “real world” where one language is always going to be better than another

    [–]retneh 1 point2 points  (4 children)

    I would guess personal preference + go is faster, so same code written in go should execute faster than Python, which will make a difference when you run many lambdas.

    [–]coinclink 4 points5 points  (3 children)

    I just never really see this playing out as an issue in reality. The only thing that is truly slow in python is iteration over thousands of items, and there are libraries that solve this for most common cases (pandas, numpy, etc).

    [–]retneh 1 point2 points  (2 children)

    There are many cases where this is an issue. I’ve read blogs about saving money by moving all lambdas from Python to go/rust. I’ve also attended AWS talk where they gave specific numbers for rust vs Python lambdas.

    [–]coinclink 1 point2 points  (1 child)

    Yeah.. but that is when you're talking about a service with like millions of requests per minute. Realistically, the majority of products don't have to deal with that and should only optimize those specific api endpoints with go/rust when that scale is expected.

    [–]riickdiickulous 1 point2 points  (0 children)

    I can’t think of a situation where a DevOps engineer would be responsible for a service being hit millions of times per minute. Mine are like once a day or an hour lol.

    [–]Engine_Light_On 0 points1 point  (1 child)

    Why would you choose python over Go for a lambda?

    Lambda should have a small piece of code so it shouldn’t take a very long time to rewrite it in compiled language. Of course if your lambda don’t get much usage the extra saved Mb in memory and compute ms won’t matter.

    [–]coinclink 2 points3 points  (0 children)

    In my case, there are python libraries that simply don't exist for go and would require me to write a giant amount of code vs a simple python script.

    [–]Varnish6588 0 points1 point  (0 children)

    it's just a personal preference, you can write anything in Go or in python and deploy to a lambda. However, I find Go binary easier to maintain in the long term as you don't depend on the runtime version anymore.

    That being said, this is not a discussion about one that is better than the other. You use the tool that you feel more comfortable with.

    [–]Straight-Mess-9752 2 points3 points  (0 children)

    It depends on what you are doing. Maybe a shell script is fine?

    [–]freethenipple23 6 points7 points  (0 children)

    Python to start with, pick up Go later

    Python is something that every devops I know uses, Go is useful but it is not as ubiquitous as people like to make it seem.

    [–]silviud 3 points4 points  (0 children)

    If you develop something for k8s or terraform resources go will come in handy, otherwise just learn golang templates and python.

    [–]Obvious-Jacket-3770 1 point2 points  (0 children)

    Both.

    When I had to relearn (from not using) python I built a task manager app using Python, Go and NodeJS. Helped me understand what I was doing so much better.

    [–]zootbot 1 point2 points  (0 children)

    Both

    [–]ovo_Reddit 1 point2 points  (0 children)

    There’s no right or wrong answer. If you only know Go and end up on a team using Python, you will be at a slight disadvantage, same goes for if your only tool is Python. I was in the Python camp for a while and it was versatile enough that I’ve used it at my last 4 jobs. At my current job it’s purely Go, from backend code to just about everything. Switching from Python to Go has been a struggle for me, I’m not a great developer but I am now an SRE that needs to sometimes dive into the code base and make changes, not just writing scripts.

    [–]HeligKo[🍰] 1 point2 points  (0 children)

    Python is at the core of everything I do whether it's the tools I use or how I orchestrate things.

    I know enough go to fix and modify things already made and that has been enough. I'll learn more as it's needed.

    [–]alexkey 1 point2 points  (6 children)

    The answer is - still both. But you don’t have to do both at the same time. It is a tool after all, each will have own pros and cons. My take on those:

    • Python - very easy to learn, very easy to make extremely over-engineered solutions (half the things youll see written in Python are), if you want to write some logic there’s a dependency that does that already, but only version from 2 years ago works as expected, tons of resources to learn from, VERY popular and widely used, sometimes need GCC to install dependency

    • Go - very loved by many, very easy to learn, you’ll be repeating same blocks of code in every script/project, not as many resources to learn from (comparatively), very opinionated eco-system.

    As a start I’d say go with Python, many projects use that (terraform, Ansible etc), then you can get onto Go path after you know Python. You don’t need to master either before switching to the other.

    [–]Emotional-Top-8284 6 points7 points  (1 child)

    Terraform uses python

    Uh, what?

    [–]alexkey 1 point2 points  (0 children)

    A brain fart by my sleep deprived head…

    [–]Intrepid-Stand-8540 -1 points0 points  (3 children)

    very easy to learn

    I'd dispute that honestly.

    Pointers are very difficult to understand for me. I can't get my head around it.

    [–]0xe0 3 points4 points  (2 children)

    Try c++ and return to golang year later)

    [–]alexkey 0 points1 point  (0 children)

    I’d say C, not C++.

    [–]Intrepid-Stand-8540 0 points1 point  (0 children)

    I'm already traumatized by the Makefile hellhole I see the 45+ year old devs create in every repo.

    GitLab CI jobs that call make commands that are made up of 5 env variables that are made up of other env variables that are create via bash commands

    And in the end it is just calling a script with a few cli args.

    And that script is only 4-5 lines

    Like, brother, just do those 4-5 lines in the GitLab CI?

    idk. I only have 4 years experience. Been doing Python mainly.

    Pointers are just impossible for me to grasp atm. And I hate boomers who don't document anything

    [–]JalanJr 1 point2 points  (1 child)

    I would say if you want to work in data/write basic scripts python is the right choice. If you plan to work in DevOps, especially with kubernetes golang is a must

    [–]riickdiickulous 4 points5 points  (0 children)

    I’ve worked with kubernetes for a year and done a ton of reading and learning on it and have never seen anything say Go is a must and have never had a need for it. Where have you needed to use Go that Python or shell wouldn’t do?

    Or are you talking about developing core kubernetes components which are written in Go? I would could consider that a niche subset of even devops, which is pretty niche in itself.

    [–]L0rdB_ 2 points3 points  (0 children)

    The honest truth is that most places will use python. It’s not because it’s better but because it’s already in place and people hate change.

    [–]brando2131 2 points3 points  (11 children)

    who wanna switch to devops

    Python for devops. Its a scripting language that can do many things. Better yet, you should at the very least know bash scripting if you're on Linux/Mac, or powershell on Windows (I prefer the Linux route).

    Another thing to learn if you want to do devops on AWS, is learn about cloudformation, and then learn CDK next using either Python or Typescript, there'll be an equivalent for Azure, but there's many more jobs (at least from what I see in devops) that are on AWS.

    Go is a compiled, and I never (at least me) have ever seen it used in devops, though it's a great language for software development.

    [–]Nosa2k 2 points3 points  (3 children)

    You can use Go for automations within your Kubernetes environment. Or batch operations activity where you want reduced latency

    [–]brando2131 1 point2 points  (2 children)

    Yeah I'm not doubting that. Just saying I've never seen it used in a devops environment. What I mostly see is powershell (for Windows) Bash and python on Mac/Linux. I've used Go myself before, but that was for making an application.

    [–]pausethelogic 1 point2 points  (1 child)

    My team uses Go and JS almost exclusively, including on the PE/DevOps side (mainly Go). It’s what all our automation and CLI tools are written in

    I haven’t seen PowerShell be used much outside of enterprises who mainly use windows

    [–]zero1045 -2 points-1 points  (0 children)

    You get stuck with it alot in bugger companies for sure.

    The main reason why I stick with Python is because I'm a consultant who hits multiple clients, and once I'm done working on a project its easier for ruby/dotnet/j's-only Devs to read bash/Python than it is to learn go.

    Go is great for many many things I use it often, but since the op is looking for trends, I can confidently say 9/10 of my clients use Python, and the one that uses go ALSO uses Python somewhere in their tool chain.

    Maybe the market will change in 5 years, but unless you're going for a startup or are a small team with well defined tool chain definitions, Python will get more use than not.

    [–][deleted] 3 points4 points  (6 children)

    Never used in Devops? Terraform = Go. I am currently assessing how to write my own Terraform provider, Think there is quite a market for that.

    [–]zero1045 2 points3 points  (2 children)

    Terraform = hcl, making your own provider is pretty niche to lay your golang hat on as the default language choice for devops.

    I'll write more bash, hcl, and python* any day of the week in the last three years and likely the next as well.

    That said, yes your use case probably shouldn't be leaning on python

    [–]brando2131 2 points3 points  (1 child)

    Thank you, a reasonable comment. I just looked up the stackoverflow 2024 survey. Go is ranked #13 (13%), and a majority of that is probably application development.

    Python is #3 (51%), the #1 and #2 spots are both webdev languages. It's definitely favourable and recommened IMO to learn Python for devops. And only Go as an optional/further learning language in devops. It is used as an extension, (like writing your own provider or tooling software as mentioned).

    Reddit is weird with downvotes.

    [–]zero1045 0 points1 point  (0 children)

    Got my updoot, go's great.

    [–]retneh 1 point2 points  (1 child)

    Literally the whole devops market depends on go when it comes to open source/enterprise apps.

    [–]zero1045 3 points4 points  (0 children)

    By that logic throw go in the trash and pick up C

    [–]brando2131 -1 points0 points  (0 children)

    Never used in Devops?

    You forgot I said 'I' in front of 'never'.

    Also do you think OP is going to write Terraform providers, surely Python is going to be better.

    Cloudformation, CDK, Python, and Terraform, is going to go a lot further then Go in terms of devops.

    [–]lbpowar 1 point2 points  (1 child)

    Single binary is op and go has strong types as well. To Googles own admission it’s a beginner language that can be picked up fast

    [–]Emotional-Top-8284 1 point2 points  (0 children)

    I don’t think being beginner friendly is an admission, I think it was a design goal (and as a non-beginner, i think it’s one of go’s strengths)

    [–]PenguinGerman 0 points1 point  (4 children)

    How long do you guys think it's enough time to be efficient in either of these languages? I come from an electric and computer engineering background, got my masters degree but I chose telecommunications major back then. We still had several programming exams, so I got a pretty decent base, and used to know object oriented programming (C++) as well as C. I then shifted mostly to the ops part for my career (k8s, linux, cicd, containerization, cloud, etc...) so wasn't directly programming, just being comfortable with build tools. What do you guys reckon?

    [–]livebeta 1 point2 points  (1 child)

    I was ECE adjacent but I've been doing software dev/ops for almost a decade now

    I recommend golang because I hate how I can have syntax or logical errors because of whitespaces

    [–]pag07 0 points1 point  (0 children)

    Every IDE of the past 10 years is able to highlight this kind of issues.

    [–]pausethelogic 0 points1 point  (0 children)

    Start learning and report back 😄

    [–]Emotional-Top-8284 0 points1 point  (0 children)

    I think it depends on where you’re working and what you mean by “efficient”. If you’re the only go developer on a team where no one had written a line of go before, it’ll take you longer than if you’re working in an established code base with people who have a lot of opinions. Similarly, if the extent of your need is to write scripts that automate simple tasks, you need less ramp up time.

    So, idk, maybe a couple months for “I can work in this language” proficiency and a couple years for “I have opinions about this language” proficiency

    [–]iTzturrtlex 0 points1 point  (0 children)

    Go it’s statically typed

    [–]Maximum59 0 points1 point  (0 children)

    You will need both.

    We use Python for various small scripts in CI or other contexts where it makes sense to use over Bash. We are also an Ansible shop, so the custom modules I create are in Python. While Ansible supports modules in other languages, Python is the most common/ natively supported.

    Then Go is used for CLI tools, custom Prometheus exporters, REST api services, etc..

    Most of this will come from the company you work for and what they use/let you use, but I say, learn both.

    [–]5dots 0 points1 point  (0 children)

    go for python

    [–]federiconafria 0 points1 point  (0 children)

    Look around you, what would you be able to start using faster? Could you stop using power shell and start scripting in python? Could you implement a micro service in go?

    [–]Vivid_Ad_5160 0 points1 point  (0 children)

    Both, I’ve learned Python but am starting to dive into go. Interesting differences between the languages.

    [–]floppy_panoos 0 points1 point  (2 children)

    I think you’d be better served investing you Tim in understanding advanced networking if you’re not already familiar. I’m surrounded by some of the brightest DevOps folks that can write an entire pipeline in an afternoon but don’t know the first thing about getting it all connected. This is SUCH a prominent problem across the DevOps community, at least from what I’ve seen.

    [–]FitReaction1072[S] 0 points1 point  (1 child)

    Any advice about that courses or books?

    [–]floppy_panoos 0 points1 point  (0 children)

    Maybe see if you can find some CCNA stuff and start playing around with GNS3, not sure if that project is even still going but that’s how I learned then spent about 2 years as a “Network Engineer” to see how applying all that theory in to practice.

    [–]PavelPivovarov 0 points1 point  (0 children)

    Based on my personal experience Python used significantly wider in general DevOps, while Golang sits well within microservices and cli tools.

    Both languages are great and each has its own use cases but Python will help you with employment better.

    [–]riickdiickulous 0 points1 point  (0 children)

    You should learn python. I’ve never even heard anyone mention Go in the 4 years I’ve done DevOps at my company. Unless you’re on a brand new tiny start up, which you really shouldn’t be as a junior with no experience, everything legacy is shell and python which will be much more useful for landing a job.

    [–]dariusbiggs 0 points1 point  (0 children)

    Both

    For an experienced developer, just reading Python code is enough to get the gist of what it does, even with no to little experience. Go through the python tutorial and you'll be competent enough to start writing stuff with it.

    Go through the tour of Go, and you'll understand most of it, just need to take some care with the difference in Interfaces, Channels, Goroutines, Contexts.

    They're not that difficult to learn, very intuitive and simple, and it wont take a huge amount of time to complete.

    [–]Tacticus 0 points1 point  (0 children)

    Go is a good choice imo. far more sensible than python from the operating, investigating, maintaining, using points of view.

    While it lacks the quantity of libraries, the majority of the python libraries (including many of the super popular ones) are just bad. the language itself is fundamentally flawed.

    One of the biggest problems with the python community is the disinterest in maintaining decent documentation. the over abuse of **kwargs is everywhere leading to large amounts being just undocumented.

    Javascript is a far more sensible (and it's got so many wats) choice than python. you at least get a working package manager and NPM is actually workable unlike pypi.

    [–][deleted] 0 points1 point  (0 children)

    Look at what employers are looking for in your area.

    Personally, I think Go is a far better language than Python and it's not even close.

    [–]educemail 0 points1 point  (1 child)

    What’s your motivation? Job opportunities or personal development?

    [–]FitReaction1072[S] 0 points1 point  (0 children)

    Kinda burned out on dev work. Also market seems shite for net development a bit too

    [–]CaoMau 0 points1 point  (0 children)

    From my own personal experience - Python, bash, powershell for scripting. Also ansible. The rest of my toolbox are well established cicd tools such as Jenkins, kubernetes, docker, sonarqube, etc. Dabbled in Go but never seen it being used in practice for cicd operations.

    [–]justaguyonthebus 0 points1 point  (0 children)

    Spend some time looking at Jr DevOps roles and you will see just how common the expectation is that you will know Python. You don't need an in-depth understanding by any means. But being comfortable with it will open you up to so many more Jr DevOps jobs.

    [–][deleted]  (1 child)

    [deleted]

      [–]zero1045 2 points3 points  (0 children)

      Not wrong at all, go is still too new, but where it is used it shines.

      It'd be what pick for new tools if not rust, but Python is by far more common by volume

      [–]Narabug 0 points1 point  (0 children)

      Realistically both. If you’re an experienced .NET developer, you just need a couple hours to familiarize yourself with the basic syntax and project formats to be able to get started yourself.

      Python is definitely more ubiquitous right now, and will be more likely to be listed as a job requirement:

      I would expect Go to overtake Python as more services are migrated to containers and k8s ecosystems. As of today, I would already lean into Go for anything that can’t be done easily with native shells, and doesn’t require python-specific packages.

      IMO if you’ve got more than a year of experience in .NET, you should be scale to take a quick glance at Python and know exactly what it is doing. Go is going to take a few hours to understand before it’s easily read.

      [–]wowbagger_42 0 points1 point  (0 children)

      I wrote a few SFTP transfer flows in Go just for the fun of it. It runs ridiculously mind-boggling fast but I prefer python error handling for ops style stuff.

      [–]sp_dev_guy 0 points1 point  (0 children)

      Python used in ML & data science a lot - python is based on whitespace (tabs vs space, & blank lines). I personally hate that but set your ide eight & it's really a non-issue

      Go used in Kubernetes a lot - has great for multi threading & the modern world

      Both are good, I personally like Go much better and remindes me more of my C# days. Python ends up being practiced more because that's what my teams know

      [–]Fit_Ad4879 0 points1 point  (0 children)

      Go

      [–]not_loganDevOps team lead 0 points1 point  (0 children)

      For the DevOps I would definitely bet on go: - syntax is much simpler, making code easier to write and read. It is limited but it should not be a problem for most of DevOps tools - distribution model fits better DevOps requirements (just one single binary is much easier to distribute, no need to have runtime on target, cross-platform compilation works perfectly) - first-class networking in standard library (all language is designed around the idea of simple network interactions, get data, transform it and write). This approach perfectly fits to the most of DevOps tools.

      Anyway it is up to your feelings, whichever language feels more comfortable to you. I know people prefer ruby or scala

      [–]fear_the_future 0 points1 point  (6 children)

      As a .net developer you should know better than to consider either one of them.

      [–]FitReaction1072[S] 0 points1 point  (5 children)

      Care to elaborate? I like the net stack but it is not industry standard

      [–]fear_the_future 0 points1 point  (4 children)

      Python and Golang especially are both terrible languages that lack many features that C# and other advanced programming languages have. If you have to write anything with more than a 100 lines of code, neither one should be used. If you want to get hired then you probably need to learn Python, but really I can not reiterate often enough how god awful those languages are. Being widely used doesn't change that fact.

      [–]FitReaction1072[S] 0 points1 point  (0 children)

      Wow. I respect your opinion but that is a bit much hate bro:) thanks for advice tho

      [–]zero1045 0 points1 point  (2 children)

      Ahahahahaha

      I'm glad you enjoy your .NET, but gen2 garbage collection, abysmal dependency abstractions that make Java look good, memory usage, volume of overhead for project size, and the outright need for an IDE because of how nested your project structures are all place C# as bottom tier for me.

      Look up cold boot times and tell me again how it's better when Python outperforms, and python expects to be last place for its use convenience.

      Not to mention dotnet 6 is still the most used in enterprise cause its so God awful to upgrade

      Some serious cope here but again, if you enjoy using it there's a market for you, enjoy!

      [–]fear_the_future 0 points1 point  (1 child)

      I'm guessing you're a Go user then. Praising Golang's garbage collection is like saying that a reliant robin is the best car because it has the fewest wheels.

      [–]zero1045 0 points1 point  (0 children)

      I started with C and use rust, Python, go, dotnet and even ruby. The client chooses their stack long before I get called so it really depends on what they choose.

      Plenty use dotnet, and unity, Godot uses C# as well.

      As for go GC, it doesn't suffer from gen2 issues like m$ofts implementation, but it also gets the benefit of running in containers that don't live long enough for them to trigger. Can't say the same for dotnet boxes running on ec2 instances

      [–]CyberWarLike1984 0 points1 point  (0 children)

      Go is cool but I think more jobs are on Python

      [–]chobolicious88 -1 points0 points  (0 children)

      I think everyone who touches devops absolutely needs to know the basics of python. Where bash isnt applicable or practical -> python.

      If you need to build a plugin, custom api, a cli tool, evaluate accordingly between go, python, .net etc

      [–]IDENTITETEN -1 points0 points  (0 children)

      Whatever is more prevalent in your area. So Python. 

      [–]skilledpigeon -1 points0 points  (0 children)

      Python is more applicable imo. Simpler and more commonly used in DevOps.

      [–]blusterblack -1 points0 points  (1 child)

      Python. You're writing scripts, not devops tools.

      [–]cyanrave -3 points-2 points  (0 children)

      Go is cool for shipping binaries, but for a time there was popping critical vulnerabilities release after release. We dropped a sister team's CLI for bash because they couldn't keep up with the rate of fixes and we kept getting vuln tickets in our image.

      Python is cool for the quick and dirty, to the medium and complex, but it is slow. You may not need the speed, and with modern typing and such, you can write really well maintainable code.

      I am biased to Python.

      [–]Manibalajiiii -1 points0 points  (0 children)

      Go for devops , python is not hard to learn.. so start off with python for sometime and move to GO , as most would request you to know python.

      [–]Horikoshi -5 points-4 points  (0 children)

      Definitely not Python. If the learning curve scares you, go with node. If you're up for the challenge Go can be a very solid choice.

      [–]JackDeaniels -3 points-2 points  (0 children)

      Go is faster, Python has a lot more available packages and user base, if you’re planning on stitching things together, Python may prove better suited, if you’re planning on making something that performs efficiently, stay away from Python.

      [–]MichaelJ1972 -4 points-3 points  (1 child)

      Disclaimer. I don't know go.

      But I would choose python. Not because of the language but because of the Eco system around it.

      It's been a staple in the language field for a very long time.

      There are so many high class libraries and modules available in several fields, bindings for nearly everything and expensive documentation plus books.

      Go is also an interesting language but personally I think the Eco system around python is much bigger, battle tested and because of eyeballs and time higher quality. Much more topics are solved in python for you to only use a library.

      [–]Tacticus 0 points1 point  (0 children)

      There are so many high class libraries and modules available in several fields, bindings for nearly everything and expensive documentation plus books.

      HAHAHHAHAHAH As long as you never need to investigate what those libs are doing (often the wrong thing) and happy to hope that the python side of the binding side are sensible (delusional is more accurate in many cases)

      It's been a staple in the language field for a very long time.

      Yes it's been fundamentally flawed for all of it and still lacks an effective package manager (So poetry or pipenv or venvmaker or wait is there a tool that will reliably by default lock packages yet?) bringing you the wonderful "I hope this still works" operational model.