How to survive as a programmer with a 4GB RAM laptop.
I want to share my 4-year story of how I have been working as a developer with a low-end PC. It wasn’t easy but I pushed my laptop to its limits.
Are you a developer with little to insufficient resources?
Do you constantly feel frustrated by this insufficiency?
Want to learn how to make the most of those resources?
I want to share my 4-year story of how I have been working as a developer with a low-end PC. It wasn’t easy but I pushed my laptop to its limits.
My dad gave me his laptop
It was June 2020. I had just finished my A-levels. I met a very interesting guy who was building simple apps with Python. I immediately began having dreams of my previous attempts at learning programming. When I got home, I asked to borrow my dad’s laptop to practice some Python. After a week or so, he says to me, “It seems you need the laptop, you can have it permanently”.
A fire was lit in my heart. I spent countless hours pouring over YouTube tutorials. I sometimes switched between Python, HTML, and CSS. All of a sudden I was following a sentdex tutorial on building an NLP chatbot. Then the errors started rolling in.
My first experience with Android studio
In September 2019, I went to my first tech conference. I met an old-time developer. He had been programming before my parents thought of conceiving me. He was open to mentoring new developers. I immediately signed up. He started walking me through Java and Database Design in Microsoft Access.
He then decided we should try developing a mobile app.
Android Studio was needed.
The frustration I went through was beyond reasoning. From my laptop heating up to the fans crying out in despair, this was unbearable. I had to restart my computer many times during a single dev session.
Then I began to learn about flutter and dart and decided to try that out instead. The experience was a tad bit easier because I didn’t have to open Android Studio.
I continued the mentoring program till March 2020 when I had to go home because of the COVID pandemic.
My first Web dev job and the switch over to Linux
I had gotten my first web design job in October 2020. I got it from a Christian brother who ran an educational institution. I moved to Ibadan state where the company was. This was because I was also going to work as a programming instructor. Read more here.
I had always heard that switching to Linux would release a lot of my RAM. “Performance would increase”. Besides, I was getting interested in CyberSecurity. I decided to go with Kali Linux.
I didn’t have a way to back up my files. Unfortunately, my battery was very bad. The electricity also often went off. Twice, I was trying to use Gparted to partition my drive. The electricity went off and my files got unindexed ( It’s like the files were deleted. They were actually still in memory, only just inaccessible via the GUI).
I gave up on the files and formatted my whole drive. I decided to go with Kali Linux. The installation process was smooth enough. I was elated. The performance was much truly better but not over the moon better. But it was better.
I was also happy because I could now export android apps to iOS.
The performance started nose-diving after a while.
My first Linux breakdown
In early 2021, I returned to the university. I was working on a project in javascript.
Linux problems had begun to surface. While I was trying to install some npm packages, I kept getting a chown error. It didn’t have the required permissions. Permission to access the location where it installed the packages. The location was /usr/local/bin. I would have thought it should have been installed in a world-writable folder. This was what I expected because I installed npm using apt. Thinking back on this, maybe the problem would have been solved if I had removed the global flag (-g). It causes npm packages to be installed on the whole system.
In trying to fix the error, I researched on google. someone advised me to run sudo chown -R username:username. I ran this and the end had come. I tried running apps on my computer and they wouldn’t run. Let me break down the command.
sudo means superuser do. It’s like administrator on windows
chown changes the owner of files and directories.
-R means recursive. Apply the command to every file within every sub-directory within this directory.
The files in /usr/local/bin were executables. Some of them were standalone and others were dependencies of other apps. So all apps broke down.
The reason was, those files were owned by root and could only be run by root. Even the sudo command was in the directory. So I couldn’t reverse the command.
If only I had run the recursive only on the npm folder.
I was later able to solve it. I made a live USB and used its own unbroken sudo to change the owner of the files back to root. I’ll write an article on this soon.
My first time with a startup
Fast forward to July 2022. I was now established in Lithuania. I had left Nigeria. I had been looking for a job all winter and spring and now finally I had a job with a startup in the summer.
They were building a SAAS for Small to Medium businesses. The SAAS would handle all their business needs. Needs like shipping, inventory, receipts, digital products, etc.
I was given a code server. A VS Code environment online. I didn’t have to do some crazy dev environment setup. This also helped my computer survive the strain.
Later I asked them about the possibility of buying a new laptop from them. I would then pay it off with a fraction of my salary. This wasn’t possible at the time because of a lack of funds. This should have been a pointer to trouble for me but I didn’t notice it. An article is coming on that soon.
The founder then gave me one of his old laptops which was 8 GB RAM. This did wonders in my life while I had it.
My contract with them didn’t last more than a month. They weren’t able to pay me immediately so the laptop was with me for a few months more and so I enjoyed it while I could.
Working with a company in Germany
The projects I was given here were usually very light. It was just writing python scripts based on an excel file. The python script was creating a JSON configuration file for industrial sensors.
I whipped out some nifty scripts and worked through them very quickly whenever I was given a task. I didn’t bother asking if they could help with a computer. My computer worked just fine if I simply used a light IDE like sublime text.
My contract was terminated before long. 2 months. The CTO gave me a task I couldn’t handle quickly. He gave me a design doc but I also had questions on my mind at the time. Thankfully the next job I’ll take about was already in the pipeline
I still can’t decide if I wasn’t good enough or if he didn’t allow me to ask enough questions to clarify. I’ll also write an article thinking about this and allow you to be the judge. Anyways, my 4 GB RAM computer worked quite well.
Working with an IAAS provider on Upwork
This job dropped into my lap. I just found an Upwork request for my services. Make sure all your online job platforms are up-to-date and attractive. I write on how to do that for Linkedin here.
In this case, I was developing an IAAS system that was very similar to Linode. We were also building general invoicing systems. I had to move data around in MySQL.
Again the load wasn’t so much that my computer couldn’t handle it. This didn’t stop my computer from freezing from time to time though.
Recording videos for youtube
This is just a cool section to add. Would you believe that I was brave enough to install OBS and record videos on my PC? Streaming is possible but the quality is really bad. Also, I have a peculiar audio setup that streams audio from my phone to the computer. Streaming that streamed audio could be dicey. I only record videos.
I don’t open more than OBS, Audio streaming apps, and Chrome. Sometimes I quickly open some app I need momentarily which I close after its use. There wasn’t any particular wisdom to this. I have just been really lucky while recording.
Computer freezing has only happened during editing which I no longer have to do. I have a trusted Christian brother who does it for me now.
How am I surviving now and how you can survive too?
OS: Remove bloat if you want to stay on windows. Christitustech has great resources for this. Changing your OS to Linux is best. Your RAM is hogged less by system services like on windows. There are fewer bloat packages. Install only the absolutely need packages, and uninstall the rest. Update your Linux daily/weekly. Do this to get new optimizations on the kernel and various software. How to do that? I’m releasing a youtube video on this soon. One kernel driver received a 1000x speed increase last year.
IDE: Use sublime text and terminal or learn vim. The closer you get to the terminal, the less load on your PC. When I didn’t know about code servers, I learned and used vim to build major projects. I would only have the terminal and the browser open. When the projects required some finesse like flutter mobile dev, I used sublime text.
Code Server: This is salvation. It is a full Linux environment where I can write and run code. You can set it up for free on many cloud providers if you get their free tier. When the free tier is done, sign up again and use the free tier. For those without a free tier, find promo codes from YouTubers. A good trick for using the same email to sign up multiple times is to use email_adress+any_word@provider.com. I can use stephen+sugar@gmail.com and stephen+me@gmail.com on a stephen@gmail.com email address. I don’t know if other providers have this feature but Gmail does. I’ll do a full walkthrough on this later. The only downside could be if you don’t easy access to the internet. But if you had an old PC lying around, you could turn it into a server and access it locally and not over the internet. The good thing is that with a few GBs of RAM, the Code server works amazingly well.
AI training: When I needed to train some AI for some personal projects, I went to google colab. I changed the runtime to a GPU and was done training. Don’t try it on your 4 GB RAM PC.
Browsers: Use the Opera browser for really low RAM usage. Opera doesn’t allow live streaming though. You can also try Chromium which gives you chrome features but at the lower ram. Chrome is now a bit more light, just make sure you don’t have more than 2–3 tabs open at a time.
Browser Extensions: You don’t want more than 5–7 extensions unless they are really lightweight extensions. You can use the task manager to view extensions RAM usage. On chrome, hit Shift+ Esc
Forget about beauty: You might still be able to get it with Fedora or a custom desktop env. But just leave it as this uses more RAM. Focus on speed, not beauty.
Here are the guiding principles for the mindset of someone with a low-end PC:
Simplicity is key.
Get closer to the terminal.
Forget beauty, focus on speed.
Be very resourceful. There is more than one way to do a thing. Especially if that main way is very costly on your PC.
Have autosave on. Your computer might freeze or crash anytime.
When it does crash. Put it off, cool it down, and put it back on.
Join me on YouTube so you can get walkthroughs on everything I said here.
Secundum Allos Parakletos