Sunteți pe pagina 1din 3

Windows Subsystem for Linux (​ WSL) is a “​Windows 10 feature that enables you to run 

native Linux command-line tools directly on Windows, alongside your traditional 


Windows desktop and modern store apps.” (​WSL FAQ​) 
 
Linux is important to learn for CS. When I first started really looking into programming, I 
didn’t see how I could ever incorporate it into my already existing workspace and 
environment. I don’t want to have to partition off a huge portion of my drive and dual 
boot linux and windows. Using a virtual machine is easier, but not as portable as I would 
like, and performance feels gimped. It would be easier if you could use linux on your 
windows machine and have it work comfortable with your current Windows setup. Well, 
you can, and if you’re someone like me, an important feature. I’ve completed two 
semesters worth of projects with this setup, and I feel no reasons to change. 
 
Since getting started properly with WSL, I’ve streamlined my development environment, 
and it’s become way easier to just start programming something. No longer am I 
spending ridiculous amounts of hours trying to configure or fix IDE’s. Instead, I’m able to 
use a ​text editor​ (​Atom​, S
​ ublime3​, V
​ SCode​, N
​ otepad++​, Vim, Emacs, Nano) and the 
proper​ c​ ompiler for whatever I’m working with, compiled and ran with WSL. 
 
Here’s a small example of how quickly you can get working: 
 
I have my text file called main.cpp that I will be working with. I open up main.cpp with 
VSCode. I use VSCode since it has syntax highlighting and excellent support for C++. It’s 
like a lightweight version of Visual Studio, though it’s slightly heavier than other text 
editors. 
 
In the interest of maintaining the status quo, I will now fill main.cpp with some hello 
world logic. 

 
Now we need to compile. I right click anywhere I want and click the WSL button to open 
up an Ubuntu terminal in the current directory. 
 
 
I have setup the cpp file on my computer desktop, so that’s where we will be working. I 
do a quick “ls” command to see where I am. 
 

 
 
I see I’m in the correct place, and my main.cpp is there. Now just compile and run. 

 
 
 
 
 
 
 
 
 
 
 
From here, if I want to, I can use git and setup a new repository for my project. Infact, I 
could do anything I could do if I was using linux on a virtual machine or its own 
installation in the hard drive. I’m even able to ssh into edoras to work with a class 
account. 
 

 
 
Note: One of the major drawbacks to developing on your local machine is not using the 
same ​compiler​ version as the one edoras uses. Look ​HERE​ for the proper compiler 
version (Look under the version column) for whatever you’re trying to use. 
Yes, you can ​EASILY ​change your compiler version through linux. I just followed those 
steps in my WSL terminal. 
 
Get started with WSL: h​ ttps://docs.microsoft.com/en-us/windows/wsl/install-win10 

S-ar putea să vă placă și