DEV Community

Developing like a pro, on Windows

Erebos Manannán on July 11, 2019

So it seems to me like a lot of people don't seem to value Windows for development. There seems to be a lot of misconceptions about it's capabiliti...
Collapse
 
erebos-manannan profile image
Erebos Manannán

After the latest Windows Terminal release I've completely switched to using it, it is pretty good - only the lack of proper settings menus is annoying, and the configuration file format could be better. But I really don't even feel like touching the defaults, so that's less of an issue.

Unfortunately win-get is a sad joke though.

Collapse
 
roryo profile image
Rory O'Connell

Regarding screenshots MS is replacing the old snipping tool with a much better one, snip and sketch: microsoft.com/store/productId/9MZ9...

Other random things. The largest barrier to entry for getting comfortable with PowerShell was actually editing the command line. New versions of PowerShell set up well-known unix aliases (ls, cp, md etc) to their pwsh equivalent. However, actually editing and navigating the cli is awkward. pwsh 5.0 and up supports emacs (default bash) and vim keybindings. Set-PSReadLineOption -EditMode Emacs (or Vim if one likes vim style cli editing) and you're off.

Chocolatey supports a userland install so you don't need a UAC elevated shell. However it warns, rightly, that most Windows programs don't like userland installation. You could instead create a sudo like pwsh alias. The base command is Start-Process -Verb runas -ArgumentList "list of arguments" commandname. From there one can make a sudo function.

There's loads of powerful functionality with Powershell in the MS provided Powershell Gallery as well.

MS is quite the different company now than it was 5-10 years ago. New projects are almost always open source, the Windows 10 model is a modern SAAS model, they care about things other than windows. It's a strange, yet good time.

Collapse
 
tttaaannnggg profile image
tang

A couple weeks back, I spent a day setting up an Ubuntu 18.04 VM for MERN stack development + Postgres + Docker. I've automated the whole provisioning process via Vagrant, so it's super easy to get started. If you're interested, the repo's here! I'd love to hear your thoughts / if there's anything that could be added to improve it, I'd like to know!

Collapse
 
erebos-manannan profile image
Erebos Manannán

Personal preference: Switch from Ubuntu to CentOS or anything else and you'll have a more reliable system that is worthy of deploying to production using the same tooling as well 😃

Also there's a lot you can do with the Vagrantfile still to set up e.g. shared folders, have the IP be predictable, etc. .. mine have typically been more like 5x as long as that to make them solid.

For some better more reliable provisioning, use something like Salt Stack or Ansible over Bash - they can do a lot of things better and e.g. scale to manage larger environments much more easily.

Good start though! 👍

Collapse
 
tttaaannnggg profile image
tang • Edited

Cool! Ansible is on the roadmap for me. I'd love to learn it, as well as learn a little more about the linux ecosystem. What should I be looking for in a distro, if you don't mind me asking? And is there any chance I could have a look at one of your vagrantfiles to get a sense of how you're doing it?

Thread Thread
 
erebos-manannan profile image
Erebos Manannán

Well, most of the good ones are in closed repos, but this is more towards the direction I typically have used: github.com/lietu/pydashery/blob/ma...

Thread Thread
 
tttaaannnggg profile image
tang

Thanks so much!

Collapse
 
fashanic profile image
Fashanic

This how-to tutorial demonstrates how you can locate programmer settings in Windows 10 and explains what you can do with them.

Many of the more powerful programs, tools, and utilities accessible Windows 10 are secured behind disabled preferences and a labyrinth of configuration menus. In previous Windows versions, electricity users needed to research where to locate and apply those settings changes. Also Windows update stopped working. In Windows 10, users may reach lots of the power tools through programmer settings. For the most part, the Windows 10 operating system from Microsoft works how most users expect it, and need it, to do the job. Web browsers open sites, productivity programs like Office 365 create files, emails are sent and received, messages are exchanged--everything works just like it's supposed to work. However, for many power users, that is simply not enough.

Collapse
 
wilfred210 profile image
Wilfred210

There are many system errors which reduces your computer speed like virus, system errors and many more. So, before turning into pro window user you must be knowing the simple tasks of windows like how to remove virus, how to fix digital tv tuner device registration application error then think about increasing level.

Collapse
 
emma profile image
Emma Goto 🍙 • Edited

I use WSL occasionally myself. I did have trouble with using VS Code though, since the VS Code installation was in the Windows part of the machine and so hot reloading wouldn't recognise that I had modified the file until I did a touch from the Linux terminal on the file I had changed. Looks like there's an extension for that now which should fix things.

Collapse
 
erebos-manannan profile image
Erebos Manannán

Yea, one of the issues with WSL is that they've failed with the filesystem implementation and it doesn't really work well on either side of it.

I've had more luck with e.g. VirtualBox shared folders mounted on Vagrant VMs and other syncing solutions when I need that to work.

Collapse
 
bovermyer profile image
Ben Overmyer

It's worth noting that WSL2 fixes this problem. A Linux kernel ships alongside the Windows kernel in the next update for W10.

Thread Thread
 
erebos-manannan profile image
Erebos Manannán

Unfortunately WSL2 also requires Hyper-V from what I read, and I can't even begin to imagine what issues that will have in addition to the known compatibility issues with other hypervisors and, at least I'd expect, some performance issues.

Thread Thread
 
bovermyer profile image
Ben Overmyer

To be fair, developing on Windows is like cooking on an electric range. Technically you can do it, but it's far from ideal.

Collapse
 
ferxohn profile image
Fernando Gomez Perera

Hello!

I really loved your article!

Personally I use Windows because I simply like it, and also because all of the things that I can't do very well on Linux like gaming or using software like Tableau. And it's amazing that it's not necessary to give up some of the excellent things that Linux offers just because we use Windows thanks to tools like Scoop.

One question: I've been using Docker for Windows with Hyper-V for few months, and I haven't had any problem with other software (apart from the fact that it's not possible to run other hypervisor software at the same time). I also have a lot of games installed on my computer, and I tend to play them randomly.

I'm curious: What kind of problems did you have with Hyper-V? In fact, I feel that Hyper-V runs better than VirtualBox in general.

Thank you :)

Collapse
 
erebos-manannan profile image
Erebos Manannán

I've not had the patience to try Hyper-V in ages because it had compatibility issues with everything I actually needed. I'll probably need to give it another go at some point in the near future on one of the computers which has less importance to me.

Collapse
 
ferxohn profile image
Fernando Gomez Perera

I tried to use Ubuntu with Hyper-V few years ago and it was enough for me to gave up Hyper-V completely in favor of Virtualbox for many years. But when I tried the new optimized version of Ubuntu for Hyper-V and started to use Docker, I ended up using it again. So you can give it a chance.

I still don't try to use other Linux distribution with Hyper-V, but I'm thinking seriously to try it and see if Hyper-V is truly better now or not.

Thread Thread
 
erebos-manannan profile image
Erebos Manannán

Well I'm not particularly interested in running anything directly with Hyper-V, as mentioned I care about compatibility and I need VirtualBox for compatibility with other teammates regardless of if they're on Win, Lin, or Mac.

The only two things that I can imagine I might benefit from with Hyper-V is the potential improvements with WSL2 (but I so rarely use WSL anyway that I'm not particularly excited about it), and possibly better or possibly worse Docker experience (Docker Toolbox for Windows works just fine, as does minikube).

I can imagine a lot of potential issues with it though due to the way it's been implemented so I'm not really particularly excited about trying it out, and Microsoft's own acknowledgements sound quite worrying:

Hyper-V limitations

Thread Thread
 
ferxohn profile image
Fernando Gomez Perera

Interesting 🤔 I didn't considered that. Now I understand why you don't want to use it.

Maybe I'm the one who needs to try Docker on Virtualbox after all.

Thank you so much for the information 😊

Thread Thread
 
erebos-manannan profile image
Erebos Manannán

So I've actually been trying Hyper-V a fair bit in the past month or so, and well.. Initially I was kinda happy with it, it seemed like things were working great, and there were a few neat features I didn't have on other systems, but things did not stay all that good.

Even though there's been big claims made that VirtualBox 6 fixes compatibility with Hyper-V, turns out nobody actually thinks this in practice. VirtualBox community itself only suggests disabling Hyper-V as a solution to the compatibility issues that crop up, Microsoft pretends the problem doesn't exist and ignores questions regarding this.

When you have Hyper-V enabled, you cannot launch VirtualBox VMs, when you try to launch VMs on Hyper-V, they don't work as well. I have to this day been unable to launch the most basic desktop Linux distro's live DVD image with Hyper-V, and it's becoming a significant blocker for my daily activities that I can't use virtualization the way I need and I'm about to disable Hyper-V from all my computers again.

If you know for a fact that you will never need to launch a custom Linux VM and just use the couple of things that are known to work on Hyper-V like Minikube and Docker desktop, then yes, it works. If you want anything else, you should still stay far away from Hyper-V.

Thread Thread
 
ferxohn profile image
Fernando Gomez Perera

I haven't seen your last reply until now.

Since we started this conversation a year ago, I left Hyper-V completely in favour of VirtualBox, and it was the best decision I could make.

In fact, thanks to your article I started using almost all of the tools and tricks you mentioned (I'm still learning how to use the other ones for my daily work), and my life got easier.

Recently I was considering on giving a try to the new WSL2 to use the new integration with Docker Desktop, because some configurations inside Docker Toolbox sometimes are difficult to achieve. So that's why I returned to your article, and after reading your last reply I came to the conclusion that maybe it isn't worth the effort.

WSL2 sounds cool, but it's even more frustrating to enable and disable Hyper-V every time for being able to use other tools like Vagrant. Also, I've discovered that Hyper-V was in fact affecting the performance of my computer while gaming, so that was another reason for me to switch to VirtualBox.

Maybe I would give WSL2 a try when the GPU compatibility arrives (most of my work is related to Data Science, so that's why I'm curious about it), but for now I think it's better to stick with VirtualBox, and I'm not disappointed at all: It works amazing, it's easier to create new environments with Vagrant and erase them while maintaining the Vagrantfile for future references, and VirtualBox doesn't consume resources when you don't use it. I've also read that the integration with Hyper-V really sucks, and that maybe it will never change.

Thanks again for your comments! They are still very helpful.

Thread Thread
 
erebos-manannan profile image
Erebos Manannán

I just recently spent some time optimizing things for myself, and ended up setting up Linux with Dockerd server on another machine accessible in my LAN, which boosts my docker build times massively, halving the time it takes for me to test my docker builds compared to me running Docker via minikube with minikube docker-env, and solves all my issues with port forwarding and forgetting to run minikube start or minikube docker-env in the active shell etc. as well.

I wish there was a better way, but as long as Docker insists on primarily supporting Hyper-V on Windows, Microsoft insists on WSL2 using Hyper-V, and making Hyper-V have all these very unwelcome issues, it seems there is not .. but either way, I'm pretty happy with how things are now, faster builds, no Hyper-V to poison my system 😄

Collapse
 
kevlandry profile image
kev-landry

Or use Cmder.

Collapse
 
markwoo59617147 profile image
mark wood

Nice post. I was checking continuously this blog and I’m impressed! Very helpful information particularly the last part ?? I care for such information a lot. I was looking for this certain info for a very long time. Thank you and good luck. printer not activated error code 20

Collapse
 
ebourgess profile image
Elias Bourgess

To be honest I can't see any use case suitable for me to use Windows on my development machine. We use Macs with vagrant installed at our office and for my personal use, I use linux.

Others might find Windows more useful to them than Linux since they are used to using it, and after reading that article it will be even easier for them to use Windows.

This is a great read and I loved reading it, the only problem for me with windows is that it is a proprietary software, and the only proprietary software I use, since I can't find better tools are Jetbrains tools

Collapse
 
erebos-manannan profile image
Erebos Manannán

I totally understand being against proprietary tools, though for me personally I just don't have the time anymore to work with tools that aren't proprietary if a more productive proprietary tool exists. So often OSS just fails to meet the same kind of quality and ease of use as is often required from proprietary tools for them to stay in business.

I use Slack over IRC, I use Azure DevOps over Jenkins, I use GitKraken over Git CLI/SourceTree, JetBrains over Eclipse, Photoshop over Gimp, and yes, Windows over Linux.

The post wasn't really supposed to be a "why not Linux/MacOS", but I can elaborate here that my reasoning is not just because I've always used Windows or something. I started with MSX and Commodore 64, and I've used an incredibly large number of various OSes, hobby and professional, even ran QNX for my main desktop for maybe a year, and I always long for something BeOS -style but actually modern to become available (Haiku OS seems to be sticking to the old roots a bit too much maybe).

I've been a heavy Linux user since around mid-90s, and I used to really love it for desktop when I had near infinite amounts of time to tweak it to my liking, but really now I just don't have time to even install a reasonable distro and set it up working well. There's always some kind of issues.

Either it just doesn't boot because the kernel fails to detect something about my hardware that it requires boot flags for, or the drivers just don't work perfect and my fonts look off, I get a sluggish desktop, or my laptop locks up if I try to put it to sleep.

Then I try to get software to work on it, nothing quite works out of the box. I have to either find a version the distro guys bothered to build which tends to be old or somehow limited or customized so it's annoying, or I'll just have to install the dependencies myself and figure out how to get their custom downloads or manual builds working.

Or then I try snap and realize that the distributed version is still broken and now there's just 50 hoops for me to loop through to try and fix it for myself.

And always there's a risk that the next thing I install requires some updated version of some package that other things don't yet support quite and the whole thing explodes.

And that's with a reasonably good package manager like yum, if you end up using a Debian based distro (or anything else with apt) you'll just randomly end up with your /boot full of ancient kernel images so you can't run an update anymore and you have to figure out how to manually clean it up, or it'll just be helpful and completely uninstall your kernel.

I would really love to be able to use Linux or something like that, but really it boils down to the fact that I just don't have the time to.

Collapse
 
faurehu profile image
Faure Hu

Thanks for writing this. I've been wanting to rediscover Windows after having switched to Linux as soon as I learned programming. So even though I used Windows during most of my life, I only know it as a end user and not a developer. Lately I've been curious to know about the fundamental differences between UNIX and Microsoft philosophies, and I have discovered that even though there are plenty of UNIX guides for Windows users, there's few articles like yours explaining technical Windows features to UNIX users.

Small question though, when you complain about driver issues in Linux, is this in pre-built machines such as laptops or Apple hardware? I haven't had a driver issue in my Arch machine for ages and I believe it is because I checked every component was supported for my intended install.

Collapse
 
erebos-manannan profile image
Erebos Manannán

When I say "driver issues" it ranges from everything to just official GPU drivers to laptops. I typically have to go to Nvidia themselves to install their drivers, and then when I want to update them I need to find a way to get into the terminal without X running to install them, and so on. If I buy a laptop I buy it because it has great specs for me, not because someone has spent massive amounts of time certifying that it's compatible with Linux. It's really rare I have no issues with Linux, with laptops basically unheard of.

The fact that there are multiple wiki pages like this tells you there's clearly problems all over: wiki.archlinux.org/index.php/Lenov...

This also reminds me of the fact that security features like Secure Boot are often not easy to keep enabled when you set up Linux, and the prerequisite for booting an installer typically is to first disable them.

Collapse
 
erebos-manannan profile image
Erebos Manannán

Well, in short - yes, it is, because even if these things might take a bit more effort to set up once, everything else just works so much better 🙂

Some more detailed explanation of my experiences in another comment: dev.to/lietux/comment/d0ho

Collapse
 
pyxelr profile image
Pawel Cislo

When it comes to the screenshot tool, I highly enjoy ShareX.

It's frequently updated, and probably it's the most feature-rich software across all the platforms.

Collapse
 
erebos-manannan profile image
Erebos Manannán

Seems pretty good, gotta give it a try - thanks for the tip!

Collapse
 
philhosoft profile image
Philippe Lhoste

One of the first things I install also is a clipboard manager. Currently, I use CopyQ, powerful and scriptable.
For automation, there is AutoHotkey, but some people might prefer AutoIt.

Collapse
 
omigtito profile image
Miguel Machado Pacheco

There are only 2 things that I "don't" like about Windows

The way docker works (performance)
AND
That Windows does not recognize "Book" fonts xD

Collapse
 
erebos-manannan profile image
Erebos Manannán

There's two different ways to run Docker on Windows, under Virtualbox, and Hyper-V - I believe they work fairly differently, and both are customizable for CPU, RAM, etc. shares. What issues did you have with it?

No idea what are "book fonts", maybe you'd like to give an example.

Collapse
 
harimohanbisht profile image
Hari Mohan Bisht

Very helpful article. Thanks Janne

Collapse
 
markel profile image
Markel F.

Some help for your next goals! I use AutoHotKey and Lua Scripting for many things 😊. Super useful for automating things 😁.