[HN Gopher] Why I develop on Windows
___________________________________________________________________
Why I develop on Windows
Author : shortrounddev
Score : 51 points
Date : 2023-04-28 20:37 UTC (2 hours ago)
(HTM) web link (blog.shortround.dev)
(TXT) w3m dump (blog.shortround.dev)
| revskill wrote:
| apt-get install package-<version> is a nightmare, because it's
| hard to know which version is the correct one.
| chaxor wrote:
| Yeah, it's so awful - and IMO windows solves this problem
| really well.
|
| You just don't ever get to build anything - so problem solved!
| :)
| opan wrote:
| Look into guix and guix pack.
| snvzz wrote:
| >apt-get install package-<version>
|
| It's apt install these days.
| spyremeown wrote:
| I wish it was just a matter of the `-<version>` thing... Debian
| metadata (control, rules...) and its build system (sbuild,
| rebuild) is arcane and feels old. Having to maintain a Debian
| feed is a major PITA.
| Swalden123 wrote:
| Regarding NodeJS and being cross platform, why didn't the company
| just use path.join?
| deathanatos wrote:
| Because developers are _lazy._ I 've given up the fight that is
| "use the language's features for path manipulation" in code
| review at this point. People just wanna string concat.
| deathanatos wrote:
| > _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 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.
|
| > _that "CRT" shader_
|
| Okay ... that's _not_ what CRTs looked like. Like, the curve
| seems way overdone compared to my memory, and IIRC the "lines"
| affect was really only visible on TV/camera. I have no memory of
| noticing it IRL, and I spent plenty of time at a command prompt.
|
| (E.g., this random example -- https://i.redd.it/1s3ny22b2va51.jpg
| -- matches my memory pretty closely.)
|
| (Also there were flat screen CRTs, but those were relatively late
| to the game and were rapidly obsoleted by actual flat screens.)
|
| Edit: but also I want to play a round of Hack1 with that shader.
|
| 1i.e., quest for The Amulet of Yendor; you might know the newer
| incarnation, NetHack, but I didn't play that until flat screens,
| I think; the CRT time would have been on Hack.
| justeleblanc wrote:
| > 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.
| overthrow wrote:
| It is true.
|
| https://stackoverflow.com/questions/40794287/cannot-write-
| to...
|
| https://www.howtogeek.com/wp-
| content/uploads/2018/11/img_5be...
| systemtest wrote:
| I had a bug last week. Some people on the team had certain
| files missing in ZIP-files generated by our back-end. So I
| downloaded the ZIP-files from the back-end and it worked fine
| for me. Asked them to sent me the ZIP-files directly, worked
| fine for me. I had no clue why it didn't work for them but I
| knew that they ran Windows. So I installed Windows 10 in a VM
| and as it turns out, having "=>" in the filename causes Windows
| to ignore those files when extracting a ZIP-file.
| majormajor wrote:
| Yeah, that looks like it's simulating the rolling lines that
| could show up in a _video_ of a CRT, which is just an artifact
| of the camera and display both refreshing in similar fashions
| /at similar rates but usually not being locked to each other. A
| similar fixed lined/brightness gradient on a still photo is an
| artifact of a snapshot vs the persistence of vision effect that
| makes the screen look uniformly bright.
|
| Some people were more sensitive to CRT flickers than others but
| it didn't look like that, even at 60hz (a low rate for a PC
| monitor). It was more a flashing-the-whole-screen-on-and-off-
| constantly effect; the effect of moving lines in videos move
| _far_ slower than 60hz.
| matthewmorgan wrote:
| Could they keep the files in WSL and run their IDEs in Windows?
| aprilnya wrote:
| not sure about other IDEs, but VSCode has very good WSL
| integration for doing this iirc
| Kye wrote:
| You can type code inside a WSL shell and get a VSCode
| configured to work inside it.
| deathanatos wrote:
| IIRC, they were cloning in WSL, but AIUI at the time, WSL is
| still subject to the requirements Windows imposes on
| filenames.
|
| (I'm not a WSL expert, so I could be wrong here.)
| hparadiz wrote:
| WSL2 resolves these issues by creating a virtual disk
| instead of sharing the ntfs partition with Windows. Frankly
| though the fact that I had to type that sentence out is
| ridiculous.
| opan wrote:
| I believe colons being forbidden in filenames is an NTFS
| limitation and not Windows itself, but the specific whole
| filenames you can't use are probably part of Windows.
|
| This colon thing has come up for me in the past when giving
| people access to a GNU/Linux file server with movies stored
| with colons in the names. I think using SMB or NFS on
| Windows, the files just didn't show. I refused to rename
| the directories for this one guy and instead copied the
| files to a second spot for him to grab. I really appreciate
| and enjoy putting colons in filenames and would not easily
| give it up.
| lucb1e wrote:
| > I know a lot of developers who will opt to do all of their
| scripting in python these days, even putting #!/bin/python3 at
| the head of a script so that it runs through the shell.
|
| ...which is exactly what you're meant to do.
|
| This is not an example of how bad Bash it, it shows that you
| didn't understand what Bash is. It's expected to use various
| languages to write code on Linux, nobody wants you to do things
| in a language that wasn't made for the task.
|
| Imagine you had to use Python on the shell and, any time you open
| a terminal, needed to import os and do something like
| print(os.path.glob("*")) instead of just opening a terminal and
| typing "ls" to get your directory listing. Different tools for
| different jobs.
|
| Also the point they try to make about bash looking like a foreign
| language and having weird syntax. Yes, that's the thing: it's a
| very specific thing called _a shell_ , not just any old
| programming language that you're _meant_ to use for things that
| are not shell scripts. If Python feels more natural to you, _that
| 's probably what you should be using_. Don't feel like you need
| to use Bash for bigger tasks than a few lines of code for no
| reason other than because you're on a system that has it.
| cryptonector wrote:
| > > even putting #!/bin/python3 at the head of a script so that
| it runs through the shell.
|
| Uh, not, in that case the shell is not involved at all. The
| kernel implements shebang and will automatically start the
| interpreter, whatever it is, without having to go through the
| shell.
| galleywest200 wrote:
| I thought we were supposed to be using `#!/usr/bin/env python3`
| and not `#!/bin/python3`?
| silverwind wrote:
| Defintely, `#!/bin/python3` will not work inside venvs, I
| suppose.
| askvictor wrote:
| There _is_ Xonsh, which is Python based shell.
| lucb1e wrote:
| To be fair to OP, I would then go on to label these people as
| equally ignorant:
|
| > A lot of people coming from the Unix-like world of macOS and
| Linux don't tend to know [PS]. Many people don't know it even
| exists at all. When I mention the Windows Terminal to people,
| they think I'm talking about the Windows Command Prompt, a
| crappy little program
|
| I know that PS and the new terminal is not the same as cmd.exe,
| and that it has advantages like passing objects through pipes
| instead of stringly typing everything the way that sh-like
| shells work. But that's about the extent of it. (The powershell
| command names though, oh boy, even Java method names are better
| than that.)
|
| > PowerShell also runs on Unix-like systems through PowerShell
| Core
|
| I forgot about that. If anyone's interested in this, you may
| also enjoy learning that you can now run Windows Defender on
| Linux! And Internet Edgesplorer! The software we've all been
| waiting for, according to the Microsoft press release :D. These
| things amuse me to no end, but more seriously, getting to know
| PS better and trying out this object passing system does sound
| interesting.
|
| Similar to how C# is secretly my favorite language, but it's
| just not well supported on Linux (mono and .netcore with
| monodevelop or the electron app called "VS Code" are just not
| the same as the Windows experience, e.g. Windows Forms and the
| real Visual Studio being huge omissions for me).
| doorhammer wrote:
| > The powershell command names though
|
| Just wondering if you're talking about command name length or
| something else?
|
| Asking because it comes up a lot and almost all the common
| commands have idiomatic short/terse versions (gci for Get-
| ChildItem, etc).
|
| No shade, though. No reason you'd know if you don't have a
| reason to know it.
|
| Would love to hear if I'm making the wrong assumption and
| it's something else you're talking about. I personally really
| love powershell, but also get why people love bash. I'm still
| pretty comfortable with bash because I work in *nix systems
| mostly, so it makes sense for me to know it, whereas the
| reverse (with ps) isn't really true for most devs
| justeleblanc wrote:
| It's just a knee-jerk reaction people have in any thread
| where powershell is mentioned. "Hur hur long command
| names." Doesn't bring anything to the discussion.
| doorhammer wrote:
| Yeah, it can definitely be kind of a meme, but also I've
| never had a bad time bringing it up in good faith. A lot
| of people don't even realize it's a knee-jerk meme
| response to them. OP also doesn't seem to just be MS
| bashing, and I think there's a reality that the typical
| linux/macos dev just doesn't have a compelling reason to
| sink time into vetting PS, whereas I had a reason to
| learn it and ended up really digging it.
|
| But I do get what you're saying and think it's a common
| meme that's often unhelpful
| lucb1e wrote:
| Yeah that's basically it, so thanks for mentioning
| abbreviations! I knew they had some aliases (e.g. ls, curl)
| but not that it was commonplace because any powershell
| tutorial uses the long form and capitalizes everything
| (indeed I don't interact with PS a lot). It all feels very
| design-by-committee. Not sure whether it's a good thing
| that guides never use the short form: long more readable,
| but the specific choices of words give me weird vibes and
| run off blog-width line lengths. OP shows that nicely with
| the bash version fitting on ~60% of the line (on my screen)
| but the PS version running out of the line.
|
| A lot has been written about naming things and brevity
| versus clarity, and while I sit very firmly on the
| programmer's side as opposed to the math people side
| (single letter variable names, in weird fonts or languages
| if they (surprise!) run out of standard letters), I think I
| am more of a bash person than a java person in terms of
| naming things. Word-ish commands like pushd, kill, read,
| etc. (taking some bash built-ins here as opposed to
| external programs) seem a lot nicer to me than either very
| long commands or acronyms where you basically still have to
| know the long form to remember it. I'd never have guessed
| that spps stands for stop-process yet that's the portable
| powershell form of 'kill'.
| smoldesu wrote:
| Yeah. Reading the 3-pipe solution in bash versus 4-pipe
| solution in Powershell felt like it was verging on parody.
| Yes, these object-oriented features are nice - but they're
| something of a self-imposed problem on an OS that's designed
| like a database. Even the tools we use to parse JSON in bash
| aren't all that bad, if you can keep yourself grounded in the
| world of text processing.
|
| I'm glad that the OP has a workflow that they like, but I'm
| not really convinced the grass is greener on the other side.
| I've used a lot of shells, Powershell doesn't really wow me
| that much anymore.
| emodendroket wrote:
| 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.
| doorhammer wrote:
| > Similar to how C# is secretly my favorite language, but
| it's just not well supported on Linux
|
| C# is not-so-secretly my favorite language (though Clojure is
| a close second) and I use it pretty often on macos/linux.
|
| IDE wise have you given Rider a try? Imo it's a totally
| viable Visual Studio replacement for most C# dev, though not
| as nice for all workflows or related tech.
|
| Worth looking at if you haven't. It's not free, though, so
| that can blow depending on your tolerance for licensing. I've
| personally had an all-products pass with jetbrains for awhile
| now, so doesn't bug me, but ymmv
|
| I also get a lot of mileage out of C# notebooks in VSCode.
| Honestly, I use C# for a ton of my daily scripting because I
| built up so many utility scripts over the years in LINQPad on
| windows, and they were pretty trivial to port
| emodendroket wrote:
| On the C# IDE front, Rider is excellent on all platforms
| (even on Windows I prefer it over VS), and a lot of
| production C# software is now running on Linux. It's not
| limited the way it used to be.
|
| For PS, the other thing is I think people hear "object-
| oriented shell" and think every command has to be custom-
| built to interface with all the others and isn't pluggable
| like standard pipes, but that is untrue.
| andylynch wrote:
| There was a time when Internet Explorer was possibly the best
| UNIX browser. We ran it on Solaris.
| jmbwell wrote:
| Complaining that bash on macOS is old is valid, but it doesn't
| seem relevant here. If you're just going to use Powershell on
| Windows anyway, then surely bash doesn't matter on either
| platform.
|
| More relevant in my view is how well the workstation you use
| supports interacting with your build system. In many
| organizations, the actual build environment is only ever going to
| be Debian or alpine in a container, in which case, it doesn't
| really matter which computer you have on your desk. If all your
| building happens remotely on a cloud instance, it hardly matters
| at all.
|
| So by all means, use whatever computer you want. The great thing
| about the current era of computing is how little depends on the
| computer for getting work done. The author's Chromebook story
| makes this point perfectly. Use what you have or what you like or
| what you can get, and get on with life, I say.
| selectodude wrote:
| Mac OS switched to zsh a couple releases ago due to bash being
| GPL 3 so the shell isn't old anymore and installing bash is as
| easy as brew install bash.
| chrisweekly wrote:
| The default OS-provided shell is irrelevant; anyone who cares
| an iota about DX on their dev machine is going to set up
| their terminal and shell from scratch anyway.
| m463 wrote:
| wrt relevance and relevance...
|
| macos used to be relevant, but now (like the jackling house)
| all the unix underpinnings have been left to rot.
|
| [1] https://en.wikipedia.org/wiki/Jackling_House
|
| By the way, macos bash is technically in violation of the GPL,
| as it doesn't ship the source for rootless.h (no, not the x
| file by the same name)
| pedrogpimenta wrote:
| Yeah he says because you have to update bash he prefers using
| WSL2. As if you don't have to install that???
| lionkor wrote:
| I dont really see the answer to the question in the article,
| maybe I missed it.
|
| You can use PowerShell on Linux. You can use vcpkg on Linux (very
| well, even). You can learn C++ and you wont need the `_In_` and
| whatnot. If you use WSL2 for your development, are you even
| developing (fully) on Windows?
|
| What you can't do is really own a copy of windows (any recent
| one), and have the freedom to decide what tools you will use.
| There is nothing protecting your system from locking you out of
| any setting, at any point, and requiring you to buy a different
| key, subscribing, giving them your data, or whatever else.
| [deleted]
| hesdeadjim wrote:
| After 8 years on macOS, I was forced into developing on Windows
| back in 2015 when I was making a VR game. WSL1 hit at exactly
| that time and once I suffered through setting up the environment
| on ConEmu (Windows Terminal nowadays is _wonderful_ ), I never
| looked back.
| caleblloyd wrote:
| 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.
| pcthrowaway wrote:
| 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 perhaps slightly more
| verbosity ( export
| MYSQL_HOST="MyHost.com"; export MYSQL_USER="MyUser";
| sh -c 'echo "using $MYSQL_USER@$MYSQL_HOST"' ) sh
| -c 'echo "using $MYSQL_USER@$MYSQL_HOST"'
|
| outputs: using MyUser@MyHost.com using
| @
| thomasjb wrote:
| 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
| causality0 wrote:
| Telling ChatGPT to write you a powershell script and then
| explain what every part of it does makes learning it really
| fast. It's super handy. Powershell scripts have solved so many
| time consuming problems for me, like having one-click shortcuts
| for changing my desktop resolution or fixing all the file names
| in a 20TB media archive.
| newprint wrote:
| 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.
| cyberbanjo wrote:
| Just to corroborate from the opposite direction, I have run
| exclusively Linux on my personal machines for nearly a
| decade, and I started a new job where I get to use
| PowerShell, and it's really amazing, the amount of
| grep/tail/head (or Get-ChildItem/Select -First/-Last) I have
| to do is so much less, it feels so much less klunky. Probably
| the only thing I don't like more so far is Get-Help, because
| it doesnt put you into a pager with search, it just dumps to
| text. EDIT: apparently I need Help not Get-Help for paging
| EDIT2: and I hate that PowerShell doesn't support
| readline/emacs keybindings
| AaronFriel wrote:
| I've followed a different path, but I've come to the same
| conclusion. Along my path, picking up languages like Haskell or
| Node early on meant using Linux. So since high school I've always
| had _a_ Linux machine available, but preferred to use Windows as
| the user interface.
|
| Two thing I can say for any naysayers who use a Mac and do
| devops, backend development etc.:
|
| 1. Are you sure your environment that matches your deployment
| environment? Do you have confidence your server code runs the
| same on an Apple Silicon Mac as the (very likely) x86-64 and
| Linux environment your users use?
|
| 2. Have you ever noticed how shell scripts on Mac often... don't
| work the same on Linux? The way to fix that is of course use
| Homebrew, and, while brew has gotten leagues better, the quality
| pales in comparison to even Debian testing, Ubuntu main, or Arch
| and others.
|
| As a devops engineer for many years, #2 was death by a thousand
| cuts. If I could, I'd have replaced every Mac user's userland
| with GNU coreutils from brew without their permission.
|
| To square the circle of preferring Linux systems and Windows' UI,
| I've done just about every approach you can imagine to make that
| work, from syncing folders via rsync, to ssh or nfs mounted
| filesystems. I've used Virtualbox and VMWare and Hyper-V to
| locally run the Linux environment. There have been a few
| different X window managers and remote desktop tools, but none of
| them have been great.
|
| WSL1 is where things really began to turn around - what an
| interesting project to make the NT kernel work as a Linux kernel.
| It didn't quite pan out, but that was OK.
|
| WSL2 made major changes to how WSL worked, and now I can now run
| Kubernetes, Docker, 3d applications, machine learning (stable
| diffusion), have a real Linux shell and userland.
|
| WSL2 is a true game changer for quality of Linux development on
| Windows. Being able to `docker run` Stable Diffusion or Llama or
| what-have-you is incredible.
|
| I can imagine a PopOS - or another vendor-backed Linux OS - might
| persuade me eventually to shed Windows. In the meantime, I don't
| feel like I'm making any compromises.
| hparadiz wrote:
| Your shell scripts on Linux don't even work the same way as the
| docker image based on ubuntu. Resolving those issues is just
| part of the job.
|
| I recently had this issue where my version of SSH was too new
| compared to that the servers were running and I was getting
| issues about the cryptographic algorithm being mismatched.
___________________________________________________________________
(page generated 2023-04-28 23:01 UTC)