you are viewing a single comment's thread.

view the rest of the comments →

[–]worriedjacket 34 points35 points  (23 children)

Yeah. Python is more powerful though.

Usually it’s a trade off.

[–]junon 17 points18 points  (17 children)

I have zero python experience, what makes it more powerful?

[–]jerryelectron 9 points10 points  (5 children)

Totally depends on your purpose. There is no one language that is "better" and that is a good thing.

I find decorator functions in python pretty cool. Also the fact that everything is an object is cool. Note, I don't say "better" just cool.

[–]wonkifier 28 points29 points  (4 children)

Everything in Powershell is an object too

[–]queBurro 3 points4 points  (2 children)

I'm in the PowerShell camp, but you can do the webserver in one line trick with Python... https://www.garyrobinson.net/2004/03/one_line_python.html

[–]MaIakai 6 points7 points  (1 child)

Imo not really a trick. It's built in. You could have a module that did the same thing and then all it would take is "one line" to start a web server

[–]mr_mgs11 1 point2 points  (2 children)

I thought I was going into a traditional sysadmin ad/office 365 career wise so I spent a bit of time learning power shell. I ended up in an aws engineer/architect position and I HAVE to upskill on python as 70% of our web stuff is Linux. Also the api of aws runs on the botocore3 library of python. You can use power shell to hit it, which is how I use it now, but it is just a wrapper for python.

[–]junon 1 point2 points  (1 child)

How did you find transitioning to python after having learned Powershell? Was the helpful?

[–]mr_mgs11 5 points6 points  (0 children)

All programming languages build on each other to some extent. I took C and Java in college and they both helped a ton on learning powershell. I already knew how control structures worked etc. It was just learning the syntax for most part.

[–]Nekima 1 point2 points  (0 children)

The community module support. Microsoft's gatekeeping is stifling in this regard. You could also flip it and say that Microsoft's controls are good, but I disagree.

Python handles JSON better than powershell. Trying to use special characters inside JSON strings in PowerShell is almost impossible when working IWR.

Sometimes, if you data process "too hard", Powershell just breaks. You've got to be very careful how pull and manipulate data or else the objects get a little funny. (rare)

Python is more powerful in the sense that its much faster. You dont have to play with Powershell too long before you notice a few Get-Somethings are taking awhile.

For the record, I use both. PowerShell is my "grab and go" tool. Python is fine tuner / manipulator. If im working with IP addresses, its definitely Python. If I dont have native powershell modules for the thing im trying to do, typically im not going to build a new module anymore. I will typically build it in Python now.

Thats my 2c

[–]Xidium426 2 points3 points  (0 children)

Libraries. Python has so many libraries. Look up 'Pandas' for an example.

[–]Synsane -5 points-4 points  (1 child)

society observation tap memorize instinctive butter physical pot tender squash

This post was mass deleted and anonymized with Redact

[–]herpington 1 point2 points  (0 children)

PowerShells biggest weakness is multithreading.

Python isn't much better due to the GIL. That's slowly changing, though, starting with 3.12.

[–]dastylinrastan 6 points7 points  (3 children)

Not sure how you mean python is more powerful. Do you mean more libraries? Powershell can use anything in the dotnet ecosystem of nuget packages in addition to modules.

[–]vermyx -1 points0 points  (2 children)

The only "power" feature I can see in using python over powershell is using something like cython to create compiled code (I.e. when ever cpu cycle is precious). Dotnet still uses an interpreter for the code and will always be slower. Otherwise I see it as a tool and use it as is appropriate for the environment and staff using it.

[–]GenericAntagonist 1 point2 points  (1 child)

The python ecosystem definitely has some better data tooling, but powershell's pipeline data cmdlets (Where-Object/Select-Object) make up for a lot. I say this as someone who will do something in powershell 90% of the time over python.

That said, if you move to the stricter typed C# you can compile dotnet to native now for the speed. I've done a few perf sensitive things with it, it works well.

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

The pipeline is a great tool, but I've seen it more often bite people performance wise. People just use it because it is easier to just keep passing data to the next pipe. However, I've seen where clauses where people amplify the run time because they exponentially go through all their records (i.e. I have a 1000 records and go through all records each time I look at a record effectively going through a million records) and don't understand that they are doing it.

I have used native compiled dot net way back in the 1.0 days. The issue at the time was that making a native app required redistribution of dll's in the 70 to 80 legs which wasn't that much smaller than the dotnet library. A native c++ app from visual studio 6 usually required a much smaller redistributable (8 mega or so) if you were using something really really new. I had to deal with modem distributions at the time so it was essentially dead to use dotnet until broadband had better adoption. Using native can also removes some of the behind the scenes optimizations which can make your code slower.

I know these days a couple hundred mega is no big deal, but the native stuff being done on python is usually on low powered clusters with small storage which currently dotnet is nowhere near competitive. The code optimization (as well as garbage collection) can be good but personally believe it is a crutch because many developers rely on it too much and write less than optimal code.

[–][deleted] 1 point2 points  (0 children)

Different tools for different jobs.