Hacker News new | past | comments | ask | show | jobs | submit login

My first job out of college was working at Epic Systems as a mostly Windows sysadmin. It was a fascinating (and great!) experience. I've never seen such an advanced Windows sysadmin setup before.

I only briefly touched upon EMRs and the MUMPS/Cache stuff they did there. However, I also learned PowerShell to a much deeper level than probably 99% of Linux folks ever do. We did TDD, code review, CI/CD pipelines for fucking PowerShell. It was painful right up until the point where I internalized the Tao of PoSH, and then I realized that PowerShell actually rules for readability and maintainability when you have people who know what they're doing.

HNers by and large don't understand the economics of PowerShell. There is a very low supply of competent PoSh devs on the market, and even fewer interested in credibly signaling their proficiency, but a very high demand for them, because a lot of places still run everything on Windows, and guess what's installed on virtually all of them? I've even been able to take on a few consulting gigs that boil down to "take our 100,000 line un-version-controlled PowerShell monstrosity hacked together over the last 13 years and turn it into something we can actually understand, please".




> PowerShell actually rules for readability and maintainability when you have people who know what they're doing.

Isn't that true for all programming languages ever devised by mankind?

> HNers by and large don't understand the economics of PowerShell. There is a very low supply of competent PoSh devs on the market, and even fewer interested in credibly signaling their proficiency, but a very high demand for them, because a lot of places still run everything on Windows, and guess what's installed on virtually all of them?

I don't see what point you're trying to make.

The fact that Microsoft decided to push PowerShell on virtually all versions of windows it ships only reflects a Product decision by Microsoft to push a Microsoft-only tool. It also shows Microsoft's decision to not offer the same level of support for any other alternative.

Where's the economics in that?

I also don't understand your broader comment on economics. Are you depicting it as a good or bad thing?


>Isn't that true for all programming languages ever devised by mankind?

The guy literally just mentioned MUMPS.

https://thedailywtf.com/articles/A_Case_of_the_MUMPS


That article is true but hardly fair. MUMPS has the "blessing" of early success dating back to the bygone era of punchcards. We all point and laugh at the single letter keywords now because a candle [0] now has more RAM than a database server did at the time. Would Crockford have been around to write "MUMPS, The Good Parts" in the middle 1970's we might all be using a general purpose programing language with built-in persistence to a no-SQL document store.

0. https://news.ycombinator.com/item?id=39169048


Re/ the economics: It's okay, many people don't get a formal course in this stuff. First look at the graph with two lines on https://en.wikipedia.org/wiki/Supply_and_demand. Notice that the y-axis is P for Price.

Now imagine first off what happens to Price when you shift the downward sloping curve forward. That is what economists call the demand curve. Does Price go up or down?

Finally, imagine what happens to Price when you shift the upward sloping curve backward. That is what economists call the supply curve. Does Price go up or down?


One would hope, but alas! Perl was notorious for being write-only back in the day.

PoSh is closer to read-only for most devs. If someone makes sure to write things out the long way (or uses a linter to do this) it's very easy to grok. Actually learning to write it is the tricky bit.


> One would hope, but alas! Perl was notorious for being write-only back in the day.

I don't agree that's a valid rebuttal, as the operative word is the weasel copout "know what they are doing".

> PoSh is closer to read-only for most devs.

A read-only language is a language with a serious expressiveness problem. In contrast with, say, Python, which you need to go way out of your way to write code that's hard to understand.


>the weasel copout "know what they are doing"

Let's try a precise quality comparison, more for fun than anything. We have established someone knowing what they're doing makes any comparisons meaningless. I imagine you would agree with me that someone who "only kind of knows what they are doing" is even less helpful (what do they know? what do they not know?). So our last option is someone who does not know what they're doing, at all - they've never programmed before in their lives.

How many minutes of study would it take for them to decipher what a PowerShell program taken at random from the world of all programs written and used by human beings is actually doing? How about a Python script? How about a Perl program?

Most complete programs are short. Most complete programs do not use complicated data structures or algorithms. And most complete programs do something relatively simple, but useful to the writer. So one would expect T(PoSh) < T(Python) < T(Perl). I sympathize if that makes you groan.

Now, how many minutes of study would it take for them to write and use a PowerShell program, versus a Python program, versus a Perl program? Our hypothetical knows-nothing person is statistically probably running Windows, to start. That cuts down on the time needed to fiddle with installation - PowerShell is right there, whereas someone totally new to this could easily lose a week just trying to get either of the other two installed and running for the first time. That's probably going to swamp the calculation.

After they've got it installed, they will likely spend a lot of time Googling or GPT-ing around for code that already does what they want. This is likely to be straightforward no matter which of the 3 we're working with. But they will almost certainly need to tweak it somewhat to get it to perform exactly what they want to do. This is going to be tough in any of the above languages. The readability of PowerShell would probably let this person figure out how to tinker with it relatively quickly.

After they've written a few useful programs already, sure, they might want to switch to something else - but probably not; most people have better things to do with their time than rewrite something that already works. More importantly that moves them from "doesn't know anything" to "kind of knows what they're doing", which is not a category of people we can reason about in general - although, if we were to reason about this person in particular, it seems reasonable to suspect that whatever tool they started with would be the tool they would stick with, especially now that they've paid the one time cost of actually getting it installed and working on their computer.


> most people have better things to do with their time than rewrite something that already works

These people just went from "never programmed before" to "knowing how to program" - I doubt people that made an investment like this would "stop to the first tool" because "it works". Sure, they might not rewrite something that works, but they would wonder "is there a better tool to do the job?"

You can of course target "what is the minimum I can do on this and then be able to focus on my job" and never worry about other issues (could I have done more? could I have done better? is it extendable? is it maintainable? etc.) but that is more about how you view "your job". If you are a doctor and your job is "heal patients" then learning another programming language is not your job. If you are someone maintaining some tool written in a specific language, then learning another programming language is not your job. If you are a software engineer that can solve multiple problems, wondering if you should know another programming language is part of your job.


The only exceptions are the ones that are specifically designed to be horrible. Like Brainfuck.


>HNers by and large don't understand the economics of PowerShell.

That's not true ...

PowerShell is the "lingua franca" for Windows system administration, I think everyone understands that. Much of the power of Powershell isn't the syntax (which is unnecessarily cumbersome), but rather that most core windows system services have PowerShell bindings.

Powershell isn't a tool you would use for Linux scripting and administration, because it isn't ubiquitous the way bash is.

So what exactly is your point? That Linux administrators adopt PowerShell? Or are you arguing a strawman that HNers advocate for using bash in Windows?


The reason why we use Bash on Linux is because it’s ubiquitous. Even though my terminal is ZSH, all my scripts will be Bash because I can trust it to run on any system.

Same goes for Windows, I want to make sure those scripts can be run without having to install anything. Powershell is there, and it’s powerful.

I’ve got a job to do, and a problem to solve.


Python is better for anything complicated. Even though Bash is ubiquitous, it's kind of a pain in the ass, and it's actually not that portable since there is no real "standard library", and everything basically depends on system tools being installed and/or configured in a particular way.


python is also extremely fragile compared to something compiled

just setting up the python env to run the "script" requires a ton of bash (or simpler python)

of course it's true in all cases that if you know what's your supported/required/target environment is, then just a few lines of bash/python is enough. but the wider the spectrum of complexity one must handle the more it pays off to front load said managing, and distribute a compact and powerful program with few dependencies and as minimal complicated bootstrap steps as possible.


Amusingly for projects of medium complexity, Powershell is probably comparable or better than Python, on Windows, especially for sysadmin type stuff.

Powershell actually had optional typing from day 1 but unlike mypy & co, it's actually checked. As in, types were optional, you didn't have to write the down in the code, but if you did add them, using the wrong types would error out.

Powershell also has great integration with .NET so almost every .NET library is available if you need it and the deployment story is ok - Powershell needs to be installed and you can bundle everything else you need.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: