Live data from Hacker News

Why I develop on Windows

blog.shortround.dev

61–70 of 187 posts

Re: Why I develop on Windows

#62

Earlier quoted context omitted.

> There's a "aux.rs", also a verboten filename in Windows. That's not true. > And then there were some that differed only in case, which honestly I don't know how we manage that, as the non-Windows side is macOS, and yet roughly once per year someone introduces two files, same name, differing case into the repo. Sounds like a crappily maintained repo.

It is true. https://stackoverflow.com/questions/40794287/cannot-write-to... https://www.howtogeek.com/wp-content/uploads/2018/11/img_5be...

And for the historical explanation for why these filenames are special even with an extension, see https://devblogs.microsoft.com/oldnewthing/20031022-00/?p=42...

"Suppose you wanted the listing file to go straight to the printer. [...] So you typed “PRN” as the filename. Now, the assembler doesn’t know about these magic filenames. So the assembler will try to create the file “PRN.LST” and then start writing to it. Little does the assembler realize that the output is actually going to the printer."

Windows path handling is full of special cases and subtle gotchas. See https://googleprojectzero.blogspot.com/2016/02/the-definitiv... for a very detailed list.

Re: Why I develop on Windows

#63

From everything I've heard about Windows turning into user-hostile bloatware over the last few years, nothing in this post seems like a good enough reason to use it. Perhaps it's Stockholm syndrom, but I honestly like my Unix-y tools (bash, jq, awk) at this point Also, regarding this example { $Env:MYSQL_HOST = "MyHost.com"; $Env:MYSQL_USER = "MyUser"; java -jar myprogram.jar; } You can do the same thing in Bash with…

At least one subtle difference, is a bare scope block like TFA has, will print out everything in it instead of the output you would expect, where as Bash behaves more like Invoke-Command -ScriptBlock {}.

Compare:

  PS /home/me> {
  >>     $Env:MYSQL_HOST = "MyHost.com";
  >>     $Env:MYSQL_USER = "MyUser";
  >>     java -jar myprogram.jar;
  >> }

    $Env:MYSQL_HOST = "MyHost.com";
    $Env:MYSQL_USER = "MyUser";
    java -jar myprogram.jar;


  PS /home/me> Invoke-Command -ScriptBlock {
  >>     $Env:MYSQL_HOST = "MyHost.com";
  >>     $Env:MYSQL_USER = "MyUser";
  >>     java -jar myprogram.jar;
  >> }
  Error: Unable to access jarfile myprogram.jar

Re: Why I develop on Windows

#64

> If the software is written well, it will be sufficiently cross-platform and modular enough Yes … well … We brought on via acquisition a bunch of Windows devs. It turns out we can't even clone the repository onto their laptops: some files in the repo have ":" in the filename, which is forbidden. There's a "aux.rs", also a verboten filename in Windows. And then there were some that differed only in case, which honest…

Disclaimer, I dont use the crt shader, I just thought its cool that you can do that

Re: Why I develop on Windows

#65

Powershell, an inferior shell to Bash and an inferior scripting language to Python. But probably quite useful for administering corporate windows instances.

I personally disagree on both accounts. Bash is gibberish to me and the year I had to dev python professionally was miserable

Re: Why I develop on Windows

#66

Earlier quoted context omitted.

If the long command names bother you so much most have short aliases, but it's worth remembering that the short ones are cryptic and not that instructive if you're not already initiated.

It's not that bad. I'm mostly balking at the idea of `ConvertFrom-Json | ForEach-Object { $_.name }` being any easier to remember than `jq '.[].name' -r`. Both examples seem to "convert" text to JSON with a parser, it's like arguing over the difference between awk and catting into grep. Neither really seem more advantageous than the other.

I find the former much more self-explanatory than the latter but, for instance, can't ForEach-Object be written as for?

Re: Why I develop on Windows

#67
post #4

I keep on seeing all this talk about Powershell, and it's inspiring me to maybe learn some, although I've already commenced pursuit of skill in bash and python

After 3 decades working on Windows, I recently got into Linux and stared learning bash through "The Linux Command Line, 5th ed." book and watching youtube videos. Powershell is so much nicer and a lot more productive to work with compared to bash. Unlike the bash commands that returns strings, Powershell commands return objects. Working in any OOP language and Powershell feels very natural.

What’s the dirs -v, pushd and popd equivalent in PS?

Re: Why I develop on Windows

#68
I actually kind of agree with the point about PowerShell but I suppose the problem is everyone is so used to bash scripts that they've forgotten how many annoying pitfalls they have and how cryptic they are to anyone not used to writing them. A lot of resistance to PoSh is just about it being something different.

Re: Why I develop on Windows

#69

Earlier quoted context omitted.

If the long command names bother you so much most have short aliases, but it's worth remembering that the short ones are cryptic and not that instructive if you're not already initiated.

It's not that bad. I'm mostly balking at the idea of `ConvertFrom-Json | ForEach-Object { $_.name }` being any easier to remember than `jq '.[].name' -r`. Both examples seem to "convert" text to JSON with a parser, it's like arguing over the difference between awk and catting into grep. Neither really seem more advantageous than the other.

How I'd normally write that command in PS:

`$someJsonText | convertfrom-json | % name`

the `| % [property name]` is shorthand for pulling out some root level property on an object in the pipeline

(just for reference; not really trying to prove any point)

What I personally like about PS in this case is that the syntax of the operation feels very consistent with the rest of powershell, but that's not a dig against jq (I use it a lot when I'm on macos); just my subjective impression, and not an objective claim of quality.

Re: Why I develop on Windows

#70

PowerShell 7 can be installed on Linux and MacOS! Native too, not like cygwin bash. Around the same time that came out, so did WSL so I never really learned PowerShell because now it's so easy to run real bash on Windows.

> Native too, not like cygwin bash.

Are you suggesting that cygwin's bash is not "native"? It isn't installed by default, obviously, but it is a native Windows executable, as are the other command-line tools generally installed with it.

Post reply on HN