top of page

Linux vs. Windows : How to choose... Something something dark side!

I started my computer journey on DOS Windows 3.1. As such, I've always fallen back on the comfort of my Windows OS.

That being said, when I started working for a software company that specialised in uber fast trading systems in 2006, that all went out the window.

Serious software is run on serious hardware.

(And by serious I mean that impenetrable command line business on sun servers).

Is it good vs. Evil? Or is Darth actually good hence the blue lightsabre. I'm not sure anymore.


Why did they hire a Windows literate CS graduate to do a job on UNIX ?

Fortunately during my computer science degree I had an incredibly enthusiastic C++ teacher (who was your absolute archetype programmer / hacker - always wearing a T-shirt with ironic musings printed on it, and very into his tai chi, particularly at the start of lectures).

He would have some sort of allergic reaction when the concept of using windows was even brought up. So to pass the course, we had to learn the dark art of Unix / Linux command line usage and compiling.


(Note I use Linux and Unix a bit interchangeably here: That isn't correct, Unix is the enterprise level / paid operating system used by workstations / business, Linux is the free open source version, but they have their similarities in terms of how they are used particularly on the command line side)


I've had a few friends over the years who had similar views (James I'm thinking of you here), who would spend hours trying to find compatible drivers to get there hardware working with Ubuntu at the expense of their relationships just to prove that their Linux system was as good and user friendly as Windows. It wasn't. :D


However, back to the point. In my interview I was sat down in front of a few pages of print out that included Unix code and a scripting language called Tcl. Fortunately I managed to pull something out of the recesses of my mind and work out what the program was doing and passed the interview, which was awesome and largely set up my very lucrative career for the next decade before I decided to chuck it all in and do graduate medicine. :D (I'll talk about that decision another time! lol)


So What? Why does this matter now?

Due to my years of work within the Unix environment, I got pretty good at navigating the OS, understanding the hardware and seeing what was going on by tailing logs. Quite often a problem would need a quick fix and hacking in code using the command line became second nature and a big part of my job.

However, at home I have always stayed pretty true to Windows. I like my shiny graphical user interface, didn't want the hardware compatibility headache of getting an Ubuntu install to work (The go to operating system for Linux), and if I ever wanted to go and kill some demons on Doom or mop up some insane evangelists on Far Cry, I could.


However, and here it comes... Sticking with Windows caught up with me, and here's how:

I love VS Code on Windows, with my shiny windows Powershell, and for the most part I got by just fine without having to mix up my windows commands with my memories of how to do UNIX shell / terminal commands. Trying to go between Bash (Linux) and PowerShell (Windows) is a pain! One I tried to avoid for the following reasons:




Different Commands for Similar Tasks: Even for similar tasks, the commands can be quite different. For instance, to replace a string in a file, you might use sed in Bash and -replace in PowerShell.


This is where it caught up with me : Dependencies :

Whilst trying to get a bit of software off the ground in the last year, I was using my Windows machine to develop happily. The concept was relatively straightforward :


Get some PDF's of useful data that doctors and patients can use, have a chat bot style interface and use an AI large language model to retrieve answers to the questions asked.

Simple.


So there I am with my Django system backing on to Haystack and I've had struggles here and there getting things working, but eventually I got things to a reasonable state and wanted to share this achievement with my co-founder.

So I had to find a server to host our platform, which I did via 'Kamatera', which of course was Ubuntu based.

But the main issues didn't hit until I tried to compile on the Linux server.

The system worked beautifully on my home PC, but wouldn't work on Linux. How can this be I cried?! It took me a little while to figure out, but is very simple now I see it in hindsight (These things always are :D)


Dependencies

For those of you that don't know, let me break some of this stuff down for you in the way that I use and understand it:

Django

Django is a Python web framework.

Within Django there is a document you can use to tell it about all the different libraries you're going to use. In this case, among other things, I've mentioned I wanted to use Haystack -The Open-source LLM framework to build production-ready applications.


PIP


Dependencies


How did I resolve the mess?

By tailing my compile logs on the Linux server, and looking through the error messages, I found the problem. Without preaching to the converted - One skill that is crucial to hone as a developer, is when things are failing and you don't know why, know how to turn on enough logging and output to find where the problem is happening. Modern day IDE's such as VSCode are amazingly good at helping you do this, down to the point of variable tracking.

Within your python program and indeed within my Django app I have a file called requirements.txt. This crucial file tells Django all of the different bits of software to use to make my system work. The dependencies. You make this happen with the command :

pip freeze > requirements.txt

And low and behold - whilst going through the logs of my dependencies loading, there was my error. A dependency that worked on the windows operating system that wasn't compatible with Linux. The card at the bottom of the pile made the house collapse.

Sounds obvious when you know where to look - but to say I lost just weekend to this would be an understatement. Especially being rusty with Ubuntu, Linux servers and all that it holds, the code was the last place I looked as I already thought that was working. Assumption is often a cause of many problems.


So what's the message? my conclusion then..

If you're serious about building healthcare apps, you've got to get comfortable with Linux and Windows. Both, not either / or.

Especially if you're developing for within the NHS, most hospital systems will use Windows as an operating system, as will most of the users of your product.

You don't have to go all in and install the latest Ubuntu operating system, although that is an option. You can install a windows Ubuntu terminal environment Windows with Windows Subsystem for Linux (WSL). Available here: WSL | Ubuntu, which will get you a lot of the way.


Whilst you can scrape the web for countless guides on how to get started with Linux, I find that this isn't the way to go. The variability of quality is massive, as is the use cases.

More so than ever before we need to get specific with what we are doing, and whilst programming books are mostly out of date by the time they are printed, having a good author take you through something step by step is something I would highly recommend.

I used the book "Practical Deep Learning: A Python-Based Introduction. by Ronald T. Kneusel."

In the opening first chapter he said : "The Operating Environment In this section, we’ll detail the environment we’ll assume throughout the remainder of the book. Our underlying assumption is that we’re using a 64-bit Linux system."

It was great to get me up and running with Ubuntu and since using has once again become second nature.

With all things, it comes with practice.

So I would recommend getting a Linux command line or distrubution up and running so when the time comes you know how to at least do some decent problem solving when you want to roll your application out. You can even do some dual booting to get both if you've got the compatible hardware, or further options still (and probably the best option for most) get a virtual machine set up going:


In Summary : Crawling back with my tail between my less.

(Probably the computing pun I'll ever make :D!)

When you develop and roll out a serious bit of software, and especially with any kind of machine learning, you're going to need to get up to speed with Linux. So why wait.

As a useful cheat sheet for those like me who got very used to using Powershell,


So go forth, have fun and try some Linux whilst also having your shiny Windows wonderment machine :D






コメント


bottom of page