Developing on Windows 10 in 2019

This is not a Windows vs Linux thread. Thx

Hello everyone! I’ve been listening to a lot of software engineering podcasts lately, reading a lot of books on software development and software engineering, and following some folks on Twitter that are professional software engineers, programmers, software developers, insert preferred title here.

I have noticed common theme. Note, these talking points represent, in my opinion, a vocal minority. But this vocal minority is influencing the opinion of future software engineers.

  1. People seem to be misguided on the capabilities of modern Windows.
  2. People don’t understand the difference between a development environment and a production environment.
  3. The focus is on irrelevant details and information rather than the art and science of software engineering.
  4. People are primarily Mac fanboys that work with JavaScript.

Lets just get the brunt of this nonsense out of the way:

Windows does not perform as well at serving traffic on the Internet as a Linux operating system. *

* Cloud environments or solid networking hardware help – I.E. AWS Security Groups will process the traffic rules and then forward to your Windows host.

I don’t think it’s unreasonable to state that the networking stack is getting better on Windows. But, raw performance, Linux will win out, by milliseconds at least.

However, there are several tools and reasons available to use Windows as your primary development environment. Apple has dropped the ball as of late, formally being the de-facto computing environment for devs. Microsoft has capitalized on this ball dropping and offered an amazing suite of tools and SDKs to help developers do their jobs.

Those tools, as well as others, are what I’m going to primarily discuss here.

PowerShell Core

Latest Version at the time of this post.

Powershell Core AKA PowerShell version 6 is an open source, cross platform shell provided by Microsoft. PowerShell is not Bash, nor has it ever claimed to be. Yes, things are different in Bash than they are in PowerShell. Some concepts are the same or similar, but they are not the same tool. Getting upset that something doesn’t work in PowerShell like it does in Bash is like getting upset that something in Java doesn’t work the same it works in Ruby.

PowerShell Core has implemented a lot of the keyboard shortcuts that the *nix shells have. It’s also been stripped of a lot of the bloat and modules from PowerShell version 5. If a particular functionality in PowerShell Core doesn’t exist, you have a few options: Write your own in C# or PowerShell, import it from someone else, make a request in the GitHub repo, check to see if there is an official module or other cmdlet that will facilitate the functionality you are looking for.

PowerShell Core (and v5) can also serve as an interpreter. node, npm, python, pip, ruby, gem, javac, java, gcc, et al. work in PowerShell. Learning the ins and outs of the shell is going to take some practice and elbow grease. But, you will instantly increase your productivity on a Windows environment, I promise you.

The cloud and cloud provision tools will also work with PowerShell, including aws-cli, Azure tools, and terraform. So if you’re an infrastructure developer or DevOps engineer, PowerShell will serve you well in your career.

You can also install a package manager utility, similar to homebrew on MacOS, that has a massive repo to install and update software.

Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))

The above is the installation script that will get you taken care of. From there you run choco install x where x is the package you want to install. There are a list of packages available on the site above.

MobaXTerm

Download here

MobaXTerm is a multisession manager for Windows. It comes with a basic Cygwin configuration, but you can swap that for PowerShell, Windows Subsystem for Linux, or your preferred shell environment. Aside from ssh and sftp, MobaXTerm offers RDP, VNC, and AWS S3, among others. The free version allows you to have 12 saved sessions, with an unlimited amount of connections or types of sessions. It’s fairly customizable, with a few skins out of the box and some aesthetic color schemes.

One of the nice things about MobaXTerm, aside from the features I mentioned above, is that, if permitted in the sshd_config file, establishing an ssh session allows scp/sftp. You can edit remote files, click and drag files to and from, etc.

VS Code

Download here

Visual Studio Code, the only Electron application that works :wink: Only kidding of course, but it has a ton of support and is vastly superior to Atom in the opinion of a lot of folks out there. They seem to be the same, to me. Whereas Atom suffered from long pauses during use, VS Code sometimes has a long startup time.

What starts as a basic editor can quickly evolve into a full fledged IDE. VS Code is extension heaven. Any and everything you need when writing software probably has an extension in VS Code. This goes beyond syntax highlighting and linting, often enabling menu options and go-to or click-to-run functionality (Terraform and Docker are :ok_hand: for this). If you do anything in Go, the Go Analysis Tools make it worth switching to this environment. The Python linting is really great, too.

Aside from being an editor and smart(er) development environment, there are flexible shell options as well, you can run PowerShell, PowerShell Core, Windows Subsystem for Linux, CMDer, etc. The configuration has a GUI now, but you can still access the raw JSON to make changes and edits.

Docker

Download from Docker Hub

Microsoft has been heavily involved in the development of Docker. It has gone through dramatic changes, mostly getting better with some set backs now and then. As of this post, it still relies on Hyper-V, so consider that before you install it. In the future, the second version of Windows Subsystem for Linux will have native Docker compatibility.

You can use docker and docker-compose in PowerShell, CMDer, Windows Subsystem for Linux (with some tweaking), and Command Prompt.

Hey AdminDev, that’s great and all, but I still need Linux

Assuming this is the case and your employer will not provision you a Linux workstation, you have a few options.

Windows Subsystem for Linux

You’ll need to enable the developer mode:

Start > Settings > Update & Security > For developers > Developer mode

From there, you need to install the WSL underlying architecture:

Start > Turn Windows Features On or Off > Windows Subsystem for Linux

image

Reboot your computer to make sure the installation completes properly.

After that, head here and choose your distribution of choice.

You’ll set up a user account (this does not have to be the same as your local account/Windows live account). Don’t forget to update the distro when you’re done with the setup!

From there, install the tools and utilities as you normally would.

VMware Workstation/Player

Download

I would ask if your employer will fit the bill for this, otherwise get permission and pay or just use the Player (still good for using VMs).

VMware Workstation, despite their recent legal issues, is one of the best hypervisors I’ve used on the desktop. With workstation, you can manage snapshots and encryption, as well as a ton of other features. Player gives the same functionality at the VM level, but I don’t think you can do encryption or snapshots (someone correct me if I’m wrong).

The drivers for full screen and sharing are easy to install, and you can manage multiple environments. I tend to run headless VMs, but full screen with GUI has worked a lot better on VMware over VirtualBox and Hyper-V.

What if I just want a Windows VM, and not mess with all the stuff on my gaming rig. Can I install all this in a VM?

Even better! Microsoft has an image ready to go for your hypervisor of choice.

You can download it here. Be sure to take a snapshot, so after the trial period you can roll back and patch the system/tools. This activity is encouraged by Microsoft, so you’re not violating any T&S or legal issues.

Visual Studio: Community

Microsoft has released a community edition, similar to JetBrains’s IntelliJ, for open source developers, individual developers, and folks that want to check the platform out.

Visual Studio is a KICK ASS IDE. Their debugger is really great, very intuitive, and easy to work with. They’ve added a ton of platforms to their tool, including various JavaScript frameworks, Python development, and database development. I’ll admit, their Python linting isn’t as great on VS Community as it is on VS Code, but it’s nice to work with nonetheless.

There are packages for writing C and deploying to Linux, or writing C, C++, C#, etc. and deploying to Docker. Depending on your workflow, it can be a one stop shop, even for cross platform development (.NET Core, C++, C, Node/Express JS).

So, if you’re stuck with Windows or, if you’re like me, and just don’t mind using it sometimes, check out the above tools and get your environment rocking and rolling!

25 Likes

I think we can afford a forever pin

Nice bits of wisdom there.

Still, as much capability as Windows offers… Linux just does even more for you. I constantly miss these things in Windows (granted, last time was 3 years ago):

  • The Vim editing language is still the singlehandedly best production tool you can learn for coding, and the VS emulation layer is unfortunately lacking. While VS has vim keybindings, the language isn’t there, and trying to use it is like trying to use english using only nouns.

  • The VS standard compiler also lags behind in capabilities, last I used it they still didn’t support the entire C99 standard, nor the latest C++ standards (C++11? Not sure).

  • Tiling windows on multiple monitors is such a great feature on Linux, and I miss it every time on Windows.

  • The way Emacs allows me to customize everything I don’t like. Including, but not limited to: modality, keybindings, colors, keywords and macros.

  • GDB, which once you get advanced with it becomes even more capable than the VS debugger (but not nearly as intuitive, no).

This is not to harp on the Windows dev environment, which is very capable, but more point out that while Windows is a really capable environment, it does have limits, and those limits become extremely apparent especially when you try to develop cross platform programs. For what Windows does offer though; yes. It is quite capable for it’s strengths.

choco install vim -y

:wink:

Nah, they’ve been on that. AFAIK they’re up to C++17. Plus with the cross platform support you can write locally and compile/run on remote *nix server, plus have gdb functionality.

Yeah, there are limits and frustration across all the major operating system distributions, I think. It’s good to have balance. Depending on my mood, I prefer a Windows host with Linux VMs. I think as long as you avoid unistd.h or work with something like Go, Rust, Java, C#, C++, or a dynamic language, the limits are becoming far and few between.

2 Likes

Forgot to give a shout out to git bash and CMDer (well, I did, but here they are in action):

You can see that some of the *nix commands are not 100% on either terminal emulator. There are some hacks or Windows commands you can embed, but I’ll leave that to you to find the solution that works best for you.

https://gitforwindows.org/

https://cmder.net/

Why would I use one or the other instead of PowerShell or Windows Subsystem for Linux?

  • Comfort
  • Speed (WSL networking drops/breaks for me on long running Ruby scripts)
  • Preference

There are a ton more reasons. The folks at StackOverflow (engineers, not members) use CMDer a lot. The people at Microsoft use WSL or VMs or PowerShell. “It depends”.

2 Likes

Windows is still paid tho.

If I get to buy a pc with license I’ll keep it, but it’s too unsafe to use an unlicensed windoes for production.

Unlicensed I mean with the overlay text on the bottom ffs don’t pirate that shit, it’s even worse.

And why have all this trouble if ubuntu, for example, comes with most things set up?

It’s okay not to hate on windows… but why try to make it mimic *nix when you can go *nix?

Only environment I see it being fit is for .NET, because of Visual Studio mostly and all the jazz that .NET Core still doesn’t have.

1 Like

I guess that isn’t so much the point.

The past months (maybe longer) have been an endless stream of people claiming how bad windows 10 is and how much supperior development on Linux is. And with all the “All hail Linux” talk (which is certainly justified) the intend was to give a second opinion from someone who thinks that windows is competitive in that scenario.

There are a LOT of people out there, that either have to use windows, or, like me, need to jump through a lot of hoops to use Linux. Many Companies still run on Windows/Microsoft. And often, running Linux and not having your machine on the Domain isn’t an option.
With that, those people might feel like they are missing out or they have an idea of how Windows dev work was months ago.

Microsoft has done a LOT in the past months and years to change a lot about how a Pro uses or can use Windows.
No, it’s not trying to emulate *nix. It’s more trying to look at what *nix systems do great and bringing that to Windows. Plus giving tools like WSL to make the transition nicer for those people coming from Linux, that now need or want to use Windows.
All of those tools aren’t ment to make Windows into Linux. They just fundamentally change how you CAN use Windows and what it does.

Totally not true. I now run on WIndows at work fulltime, because of my company going full on Office 365. It’s possible on Linux, but you just loose out on Features with SHarepoint Sync etc.
WIth that said, my position is still working 95% with Linux Servers. I run VS Code with SSH Addon. I can Edit Configs across 5 Servers all in one application with syntax highlighting and what not. With full copy-paste between them and the abbility to share the code with co-workers etc. Especially for large scripts and Nagios Plugins, VS Code is a god-send.
And yes, it’s not vim. It doesn’t work the same way. But a lot of what vim does is there, just accessible in a different way.

SSH now just works from everywhere (cmd, Powershell, WSL), with identical syntax to Linux because it’s plain old openssh in Windows. No hacks or such.

So, i can now get Office, Outlook and all the Microsoft Integration i need for work, any windows only Program like our CMS, while also getting all the nice *nix tools with a great Terminal (the Preview is amazing) and not leaving any features of Linux behind.
This make Windows at the moment a much more compelling option for my work than Linux. And i don’t only write .NET code. I basically never do that.

And yes, it’s paid. That’s up to the individual to decide if it’s a problem. I guess in 99% of the cases, you either have it included with your PC or you already have a copy of Windows.

3 Likes

And there’s no reason to try to make them change.

I’m not saying “Windows is trash for developing and everybody and their company should go to *nix”, companies do what they see fit, but me as a individual, that random dude trying to learn to code (and failing so far) on some old and weak hardware, windows doesn’t seem like the best option.

Every person will have a different need, and most OS will be able to accomplish your goals with different levels of effort.

In the end it doesn’t even matter <- this was the nostalgia hitting me hard

True. And lately, a lot of people where riding the “Windows is the worst OS ever, and only on a Mac or Arch you can do true Sofware development” Train.

Just like Gaming now not necesarrily meaning Windows, Dev work or Pentesting doesn’t necesarily mean Linux anymore.

Good times indeed. Man, life was easy back then :wink:

2 Likes

I’d consider you an outlier or rare case. Most people have some sort of modern Intel core series processor I’d argue. A lot of people getting into programming aren’t doing it on ancient hardware.

Also, some of us enjoy Windows. Some of us enjoy logging in and not having to deal with video, audio, peripheral, software, or whatever other issue that plagues Linux. I’ve worked with C, C++, Golang, JavaScript (node, express, Vue, Angular), Ruby (Chef and Ruby on Rails), Python (shell, Flask, Django), PHP (Laravel), C# (.NET Core, ASP.NET), and Rust on Windows. It’s not an issue. Regardless of your environment it takes time to setup a development workflow.

4 Likes

Peep this, I need to install multiple versions of the same program. The installer always wants to wants to upgrade and windows keeps track of installed programs in at least the registry…
Any ideas on how to completely contain programs without an entire VM?

There’s some paid app virtualization software used in cloud/thin client setups but I’d like to at least test (hoping for testimony) before buying any software.

Multiple versions like Python 2.7.3, Python 3.7.3, Python 3.6.2?

docker, but i’ve never used it on windows so no idea if it is good or not.

1 Like

Was going to be my recommendation if it’s something like Node or Python.

1 Like

No, its some specific configuration, dfu and hosting software we use from our hardware vendors.

My understanding of it is limited, mainly just never use it because I’m ok with the overhead of a whole OS.

1 Like

Depending on what it is, I would still look at Docker. Otherwise a VM is the best way, likely.

Unless you use CMake or something and compile it from source, then you can just throw it in C:\Source\VersionA C:\Source\VersionB, etc.

1 Like

@AnotherDev have any reccomendations for books/large resources on Powershell?

3 Likes

Yeah, I’ll grab the links. One second.

2 Likes

@SoulFallen

This book assumes no understanding and teaches from scratch, from a computer management/systems administration point of view.

(If you don’t like Amazon, I can grab the Manning links)

This book builds off of the above and expands on the knowledge, taking you from advanced to expert.

This book is novice to advanced, but more from the development perspective. New edition coming soon!

Also the Get-Command cmdlet* (you can use Wildcard searches) and Get-Help cmdlet -Examples is insanely useful. Just run Update-Help as admin before you run those. Same links are online.

You can also use Get-Help cmdlet -Full to get the entire documentation of the cmdlet in your shell.


Also note that the PowerShell-Core is a bit more developer/open source focused. There is a ton of support for PowerShell, too. VMware, AWS, and Azure all have extensions, plugins, SDKs, etc.

5 Likes