DEV Community

loading...
Cover image for My development environment setup (Part 1)

My development environment setup (Part 1)

jorge_rockr profile image Jorge Ramón Updated on ・2 min read

Last week at work I got a new project on .NET Framework. As a good developer I tried to run it on Linux using .NET Core but I failed and my work's laptop didn't had Windows installed, what could I do?.

So, I went running with the tech support area, told them the problem and after some research the only solution was: delete Linux, install Windows and install Linux again.

Fucking Windows. 😡

But that inspired to me to write this post.

This is what I consider a good environment to develop quick, easy and be coolest in the office. Don't judge me!

P.S.: I'm using Ubuntu 18.04 because why not? I had Fedora 27 before eveything happened and it's still my favorite but I will give Ubuntu a try again.

Let's get started!

1. Install essential tools

We need the basics, you will suffer if you don't have them:

sudo apt-get update
sudo apt-get install build-essential git curl xclip

Enter fullscreen mode Exit fullscreen mode

2. Install zsh

Zsh (also called Z shell) is an extended version of the Bourne Shell (sh). It has many cool features against original bash:

  • Plugin and theme support
  • Spelling correction
  • Automatic cd
  • And more!

Just install it with the follow command:

sudo apt-get install zsh
Enter fullscreen mode Exit fullscreen mode

3. Install Oh My Zsh

Now we have a good shell, great. But Oh My Zsh will give us extra power:

Then, just copy the follow command:

 sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
Enter fullscreen mode Exit fullscreen mode

And you will get this:

4. Start using zsh by default

If you restart your terminal it will be using bash again. Why? because you need to change it explicitly with the follow command:

# Change the shell to zsh
chsh -s `which zsh`
Enter fullscreen mode Exit fullscreen mode

The bad thing is that you need to restart your computer 🙄.

# WARNING! It will shutdown immediately :(
sudo shutdown -r 0
Enter fullscreen mode Exit fullscreen mode

But after rebooting this will be the result 😍:

5. Install vim

It's time to get into hacker mode 👨‍💻 :

Just kidding.

In my experience, working with vim has been the best idea ever because:

  • It's lightweight
  • It's everywhere (even on Window's Git bash)
  • I feel that I write code faster
  • Don't even use the touchpad (or mouse)
  • I'm forced to learn things such as package names and understand they purpose
  • Syntax highlight for many programming languages
  • Shortcuts as Sublime Text or Visual Code Studio

So, why don't you give it a try?

sudo apt-get install vim
Enter fullscreen mode Exit fullscreen mode

This is the end for the part 1 😋.

In the next post I will cover:

  • Configure vim and add steroids
  • Fixing some vim weird errors
  • Mastering vim

See you on the next post!

Part 2: https://dev.to/jorge_rockr/my-development-environment-setup-part-2-4ck9

Discussion (40)

pic
Editor guide
Collapse
jason_espin profile image
Jason Espin

I still don't understand this idea that Linux somehow has something that Windows doesn't when it comes to development. I develop in multiple languages and have never found the need to use Linux or found Windows lacking in any way so it would be interesting to hear what you think Linux brings to the table that Windows does not as surely a good developer should just be using what they feel most comfortable with?

Collapse
thomasjunkos profile image
Thomas Junkツ

My last windows development experience is a bit dated and many things happended - especially WSL happendend. So what I have to tell is cum grano salis. My last experience is from late 2014/early 2015.

I was a Java developer - no problem here. But what made me go away was, that I was a) accustomed to a linux shell (cygwin is no help) and b) part of my toolchain - e.g. git - needed a minimal unixy environment done with MSYS. And the really awkward part started, when you whad severeal MSYS environments on your machine which interfered with one another (+ your cygwin environment) and required you to carefully rewrite the sequence in the $PATH (what should trump what) so to say.

So doing Java everything was fine. But doing additionally scripting in ruby and having somewhere a perl in your cygwin could make your life harder.

My conclusion is:

  • developing C# in windows with Visual Studio (Professional) works like a breeze and has everything to offer, to develop for windows

  • developing Java is nice under windows and linux as well. I experienced no differences

  • using something like ruby (or e.g. python had some known bugs on windows and who cares for that?) in combination with other *nix-centric ecosystems made my life harder as it should be

From my experience, *nix systems were per se developer centric - you could fix your own system, if you leave apple out in this point - and offer a rich integration, which microsoft for years neglected.

Only the last years, they are going to reconquer developer's hearts with WSL.

Collapse
mapperr profile image
Michele Perrotta

windows sucks away lots of resources and it have many background services that keep my laptop busy (security center cannot be disabled, cannot switch to manual updates, etc).
With many Linux distros you can have more control over your workstation and more resorces available.

Collapse
jason_espin profile image
Jason Espin

I can only see this as a problem if your machine isn't up for the task in the first place. Again, I've never had any issues with Windows.

Thread Thread
mapperr profile image
Michele Perrotta

Well, yeah, if you are filthy rich and can afford a filthy powerful machine, then you can even use a virtualized MacOS xD.
Jokes apart, you are right, but in my case I have to do very different types of work on my machine: python development, nodejs, frontend, spin up virtual machines, use containers, etc, so I always felt I need as many resources as possible from my laptop. For instance, I think disk usage is an issue with windows. I'm developing a xamarin app, and visualstudio+xamarin take gigas and gigas of disk space (it's not the OS, though, maybe I am a little OT :). Ever felt this way?

Collapse
sangram profile image
Sangram

You can disable those by booting windows in safe mode

Thread Thread
mapperr profile image
Michele Perrotta

I actually never tried that. I always though that you have to use safe mode when something screwed up your pc. It is usable? Have any downsides?

Collapse
mackenza profile image
Andrew MacKenzie • Edited

See my post below about coming from a Unix background...

For me, until Windows 10 introduced WSL, it was not a place I could get my work done in a way that I found productive. I use a visual code editor (vscode) when doing much of my actual coding but for the other times, I am editing configs, running scripts, testing out code in REPLs, doing package management, using git... Etc. For all those things I immediately turn to the command line. Vi is magic for quickly editing a conf file. Bash/zsh are great for simple but powerful scripting. Yum/apt/etc are great for quickly getting software on your machine. Node or python or Elixir are great to test ideas out in their interactive modes on the cli. Cli is the fastest and, in my opinion, easiest way to use git. It's all made powerful by a great terminal and great shell. I find Windows lacking in both... until wsl came along.

Collapse
jason_espin profile image
Jason Espin

I just find that really difficult to contemplate. I've been a Windows user all my life. I edit config files in Notepad++ and really don't understand the need for anything else. I use git through a standard CMD prompt in Windows and again have never needed anything more when I've been developing in .Net, Java, JavaScript, Python, PHP and PL/SQL.

Thread Thread
havarem profile image
André Jacques

I don't mean any disrespect but the point is that you will never contemplate the *nix way if you don't try it seriously. The only problem there is with Linux, in my opinion, is that starting is hard. I was lucky to have a lot of friends that help me go through the first steps of learning.

Thread Thread
jason_espin profile image
Jason Espin

It's not a problem with starting with Linux. I'm fluent in using Linux from having to learn it at University but the point here is after using both Windows and Linux I fail to find any issues with just using Windows. It just seems everyone seems to be using Linux to develop on because it is seen as 'trendy' rather than actually being more productive.

Thread Thread
havarem profile image
André Jacques

I can't talk for others, but provisioning tools such as SaltStack, the POSIX terminal (that I'm sorry, Powershell is a long way off) and the ease of use of SSH (in both ways), all of that combined with the fact that the majority of servers on the Internet are running Linux (and the place I worked and my VPS provider does too) and the cost of Microsoft license is the reason why I prefer Linux over Windows. Furthermore, I've always hated the Windows Filesystem. I can't count the number of time I had ACL issues on Windows, sometimes I needed to use third-party super-user plugin to force a folder to be read-write for everyone (like an upload folder for instance).

I'm not a stubborn person, and I can admit that VisualStudio is probably the best IDE, after trying IntelliJ, Eclipse, Netbeans and XCode. SQL Server is a real good SGBD for the price to pay (compare to IBM DB2 or Oracle Database 12i). The real problem is the licensing: so complicated for nothing. SQL Server can be bought per number of people connecting, or per core processor. You are forced to buy Windows Enterprise or higher.

Lastly, Linux can run efficiently on older, less powerful computer compare to Windows. Running a dozen websites on a Windows server costing 4k might not be to the reach of small enterprise. It may be more efficient to buy 3, less powerful computers, to run with a load balancing, a fail-over system that cost the same price running Linux. The money you spend on licenses (that can easily cost in the thousands) can be invested in training. To be fair, it is easier to find professional for windows compare to Linux.

Collapse
d1p profile image
Debashis Dip

As developing using Python, I have found many packages have weird issues working with windows. WSL is great, However, takes some extra step to get into (start ssh server, tell pycharm to use wsl python as the default one)

Collapse
dschu profile image
dschu

You can't run docker container natively hence the missing unix namespaces. I'd image some performance bottlenecks/higher cpu & ram load since your docker engine runs in a vm.

Collapse
sandris profile image
sandris-

well if you work in some enterprise companies, you have very limited windows with slow security scans, or.. linux :D

Collapse
selectiveduplicate profile image
Abu Sakib

Okay pardon my newbie and dumb question, but can I run bash scripts(.sh) using Zsh?

And also, and this is just my opinion, have you given Ubuntu MATE a try? I prefer it above all Ubuntu flavors... specially the flagship Ubuntu that now comes with GNOME Shell...

Lastly, yeah, fucking Windows...

Collapse
jorge_rockr profile image
Jorge Ramón Author

There aren't dumb questions :) Feel free to ask.

Yes, you can run bash scripts because zsh is just an extension.

And no, I haven't tried Ubuntu Mate yet, maybe I should give a try at home's computer :D

Collapse
roshan092 profile image
roshan092

“There arent dumb questions”. Try this on stackoverflow and you would wish u didn’t exist 😜

Collapse
mackenza profile image
Andrew MacKenzie

I am mostly with you. I jave a few variations on your setup though.

I prefer Neovim to vim
I prefer Prezto to oh-my-zsh

In terms of Windows, what I always found lacking was a decent terminal and shell. Those are different things.

For terminal, I now use ConEmu (and wsltty sometimes) and love it... A lot.

For shell, cmd is too different from *nix shells to be useful to me. And I have never been comfortable with PowerShell, though I wish I was as it's very powerful. For me it comes down to growing up using Unix command line and finding that to use Windows, my knowledge only makes me better on Windows... but learn *nix shell scripting and you can use that anywhere.

Collapse
marcmdev profile image
Marcelo Miranda

I wanted to start using VIM but it feels like it's too hardcore for me, I'm just a beginner, Although I've thought about forcing myself to use it

Collapse
tux0r profile image
tux0r

If you can't handle Vim, nobody will criticize you. Vim is not for everyone. Use what suits you best!

Collapse
marcmdev profile image
Marcelo Miranda

VSCode is killing it smoothly, I'm loving the array of extensions it has

Collapse
jorge_rockr profile image
Jorge Ramón Author

In my next post I will cover the commands I use day-to-day. So don't worry, I know it's hard, but with this setup made it easier

Collapse
tux0r profile image
tux0r

Looking forward to advertise Emacs under it! scnr

Collapse
roshan092 profile image
roshan092

Use whatever u r comfortable with, although it s a must to know basic vim commands. Is handy when u need to log in to linux servers for basic dev tasks

Collapse
vancanhuit profile image
Đinh Văn Cảnh

I usually use neovim instead vim on Ubuntu.

Collapse
hoelzro profile image
Rob Hoelz

Out of curiosity, what drives you to Neovim instead of Vim Classic?

Collapse
vancanhuit profile image
Đinh Văn Cảnh

You can read more here.
Roadmap: Roadmap

In essence, neovim provides many common default settings for you. It is a refactor of traditional vim, keep good parts of vim and also an effort to make vim more productive.

Collapse
eljayadobe profile image
Eljay-Adobe

Sorry that Windows blue-screened on you, Jorge. Glad you were able to channel your anger into something constructive (i.e., this post).

Windows is a very good development environment. Especially if you are all-in on the Windows way of developing.

If you have not drank the Windows flavor-ade, you can still go a long way using WSL, or Cygwin, or even SFU (although I think WSL supersedes SFU, but not everyone is on Windows 10). One foot in each world. Of those, my personal preference is Cygwin.

There is a native (GUI) Windows build of Vim. (Just as there is a native build of Vim for Mac, called... MacVim.)

For doing .NET development, Visual Studio is hard to beat. If you are doing Mono development on an non-Windows platform, Visual Studio (formerly Xamarin) for that non-Windows platforms is highly recommended. I did all my F# coding for Mono on a Macintosh, without a hitch. Only thing lacking was WPF, since WPF is tightly coupled to DirectX — probably why Microsoft hasn't open-sourced WPF as they've done with so many other .NET technologies. (Open-source kudos to Microsoft under the Satya leadership era!)

Code on!

Collapse
defman profile image
Sergey Kislyakov 🇷🇺 🇺🇸

The bad thing is that you need to restart your computer

Re-opening your terminal would be enough.

Collapse
jorge_rockr profile image
Jorge Ramón Author

I tried but no luck hahaha. Restarting worked, I dont know why.

Collapse
taq profile image
Eustáquio Rangel

You don't need to restart. Just open your regular terminal/shell and type zsh and your current shell will be replaced by it. If you want to start to use it without this workaround, you can close your current user session and open it again, after you changed your shell configs.

Collapse
d1p profile image
Debashis Dip

You don't need to restart the computer, however you have to logout and login again.
Cheers on the setup.

Collapse
equiman profile image
Camilo Martinez • Edited

I can't believe it when Microsoft launch .Net Core and say that can runs in Windows, Linux and Mac.

I decided migrate my bash/bat scripts and test in a console application and it's fucking true.

Now with vscode and .Net Core no matters the OS that you choose as developer.

In past years I worked with Windows, Linux and now with MacOS... and learn that all have problems and BSD (freezes and restarts). Even need formated time to time, all of them.

Collapse
lukemikael profile image
mile zero

Remap capslock to esc and vice versa :)

Collapse
tux0r profile image
tux0r

If lightweight is a feature, doesn't the zsh kill it off?

Collapse
p0k8_ profile image
Parwat Kunwar

If you love zsh shell and emoji's with fish icon.

You will love this zsh theme

github.com/parwat08/random-emoji-r...

Collapse
maxdevjs profile image
maxdevjs

Very good :D

Collapse
tux0r profile image
tux0r

I see. I had not used it in a while and it was hungry back then, but I had oh-my-zsh...