Is Windows OS good for developing Phoenix projects?

While looking at most Elixir and Phoenix tutorials, i noticed that most samples used are using linux as development OS. This makes me think that Elixir/Phoenix devs must be using linux or if you want to make Elixir/Phoenix as main tech stack, you must be or choose linux as your main OS.

My question is, is Windows can be a good option too? What might be the advantages/disadvantages/limitations when using windows as main OS? tia

Not necessarily, any Unix or Unix-like should work fine, provided it runs the BEAM. For eg, macOS and FreeBSD do just fine.

I wouldn’t recommend it. A lot of elixir tooling is written giving Unix machines preference, so you’re experience is going to be less than ideal. Same goes for documentation and tutorials. A common difference in elixir (or any language’s code for that matter) is the PATH to files, so your code won’t be portable to Linux systems. I can’t think of any advantages. I recommend that you develop Elixir apps on WSL.

4 Likes

Thank you for your idea sir :heart:

Unless you’re deploying to Windows it is probably easier to develop in WSL. I develop in and deploy to both and develpoing on Windows and is perfectly fine.

On Windows you have to translate some bash (or use git bash or similar) and you lose autocomplete in IEx (unless you use werl) and the ability to easily manage projects with different Erlang, Elixir and Node versions with asdf.

Not sure I follow the issue with for paths @Benjamin-Philip? I don’t often find myself referencing files by their absolute path and if you’re wanting something portable you can certainly do that with a case statement or the built-in Erlang functions.

3 Likes

Thank you for this info sir :heart:

It can be, yes, but it’s more involved compared to when you develop on macOS or Linux. F.ex. as @cmo mentioned you’ll have to go out of your way to have iex setup to work like on macOS/Linux, and you’ll have to manually add some paths to your system PATH (though that’s mostly a one-time thing).

Where things can and have become troublesome is that some important Elixir libraries and frameworks depend on being able to compile C code and this is where many new devs trip up because you need to install Visual Studio’s dev environment, put its paths into PATH (or make sure its .bat file(s) are executed when you enter a terminal), download / install stuff like OpenSSL which is not always trivial on Windows, etc.

Is it doable? It is, it’s not rocket science. But it’s a bit more involved and personally I found myself annoyed by it.

Oh… and terminals. I hear Windows started having some good terminal programs in which you can do your dev work but macOS and Linux have a ton of them and most work perfectly already so that’s minus one more point from Windows in my eyes.

3 Likes

I’ve only done hobby stuff with Elixir and development worked just fine on Windows. There might be libraries that only work on Linux like to my understand Zigler that I find very interesting. Someone already mentioned you can use Windows Subsystem for Linux (WSL). It’s basically Ubuntu that is running with Windows. In this scenario your Visual Studio Code is running on Windows and it remotely connects to Ubuntu like Linux system running WSL2 on same machine.

Some related articles

1 Like

Thank you for all the responses :heart:
I really appreciated it :heart:

Before ASDF became common windows was just fine in itself without WSL2, but now with ASDF so ingrained I think the value of everyone being on pinned runtime versions is important enough to not live with the system wide windows install of elixir.

1 Like

The point I’m trying to make is that some nitty gritties of interacting with your system, like opening and reading files, varies from Unix to Windows. This has the side effect of certain documentation and tutorials not being “copy-paste” friendly. Sure, it only takes a minute to replace the said code with a cross platform option, but that adds complexity to the code base, and more importantly, may not be so easy for beginners to the language. Also, it is possible that certain packages do not have good windows support, (iex for example, or NIFs that do not use a cross platfrom build tool). It may not be common, but it is possible.

1 Like