Hacker News new | ask | show | jobs
by jiggawatts 1976 days ago
> Honestly I prefer the bash way of $yaml | yaml2json(.exe) | convert-fromjson

I always prefer native support, but that's just me. I recently even wrote a converter for DNS bind zone files because they're such a pain to deal with as "text" files.

> Why do I need to type .SYNOPSIS above here, and yes that extra line is too many

Because there are other sections as well.

Consider yourself lucky! If you're writing binary modules in C#, the automatic help generation is missing. Instead, you have to use a hideous legacy XML-based help system nobody asked for. There are thankfully generators available now that plug into the Visual Studio build system, but in the past you literally had to author these by hand.

> I wish there was a version of powershell that was static checked like typescript for javascript.

Don't we all?

Set-StrictMode adds some static checks (not enough IMHO), and there are also linters available. If using VS Code, you get a bunch by default.

Fundamentally, once I start getting too frustrated by the weak typing, I realise that I'm writing software, not scripts. I simply crack open Visual Studio and start writing C#...

> Why this is not the default behavior

PowerShell conceptually is nearly perfect at a high level. It was originally called the "monad shell", and that design pedigree still shines through.

Unfortunately the implementation has many gaps that are as yet unresolved.

I was hoping PowerShell Core would fix everything, but it only fixed a few things (parallel foreach finally!) while leaving simple things like break-on-exception on the table.

Nonetheless, having worked with both Bash and PowerShell, I hugely prefer the latter because of that purity of vision.