DEV Community

S. Sharma
S. Sharma

Posted on

5 Projects To Do When You're Offline

Recently, I went on a camping trip with family and I got really bored. The outdoors isn't really my thing (which is why I decided that programming and mathematics suit me more than, say, being a gym instructor), so I naturally brought my computer and phone along with me. Of course, I had no service and no Wi-Fi meaning that I was limited in terms of what I could do. The only real form of entertainment I had was my downloaded music and my text editor.

A lot of code written nowadays requires some sort of Internet connection. Building a web server? Internet. Developing a vast neural network? Internet. Making an app? Internet. Creating a website? Internet.

Many of the tools that typical developers make require an Internet connection. Additionally, I assume there are some developers that β€” like me β€” would prefer to spend a weekend inside rather than let the sun touch their face or would just like to spend some time doing something productive.

If you're that type of person, then this article (might) interest you if you (might) find yourself in this situation. If being Internet-isolated is not a problem for you, then please don't recommend that I go outside more because β€” and this might be a shocker β€” I don't care. At all.

Without further ado, the following are 5 projects to when you're do offline.

A Basic Calculator

I was looking at my phone thinking about what I could do. The calculator app is one of the only functional apps on your phone. I thought I would make a basic calculator on the terminal (like bc) that could perform addition, subtraction, multiplication, division, and exponentiation according to the order of operations. Additionally, I wanted it to be able to evaluate parenthesized expressions. After a little bit of thinking, I created a basic calculator in C.

A File Search Program

Since I can't access any data on the cloud, I only have the files on my local machine to deal with. So, logically, making a file search program makes sense. I wanted it to be simple, so I decided to ignore character files, symbolic links, and block devices. With a majority of the file system minutiae out of the way, we only have to consider directories and regular files. If we come across a directory, then we put all the contents of the directory into a queue. Otherwise, if we come across a regular file, we check to see that the regular file's name matches the user's search query. In a little bit of code, I made a crude file search program (again, in C).

Any UNIX Tool

There are a lot of UNIX tools: less, grep, du, cat, rm, ld, and ps, to name only a few. If you're on a UNIX system, then pick a UNIX tool to recreate. Generally, most of the knowledge needed to recreate these tools can be found within a few man pages or with just a bit of basic programming knowledge. If you're on Windows, then this task can be especially challenging. I chose to make a basic version of grep (with highlighting).

Play with Mazes

Generating random mazes is surprisingly fun and a real algorithmic challenge. The only reason I'm even suggesting this is because of Jamis Buck's Mazes for Programmers, a thrilling book (that I should have taken with me when I was camping) on maze algorithms. The book is entirely in Ruby, but it can be done in any language. I wrote some basic code to generate a maze of arbitrary size according to user input and output it to the terminal screen using the Binary Tree algorithm (Disclaimer: OK, so I didn't write this code, the author of the book did, but that's besides the point). If you're ever feeling uncreative (like I was when thinking of a project to do), then I would recommend just going through this book. So far, it's been quite entertaining.

Recreate Basic Programming Language Features

Another project is to recreate basic features of your programming language of choice in that programming language. I didn't "recreate" malloc() and calloc() per se, but I did implement a simple, dumb variant of the two functions that allocates memory off of a fixed memory pool. Of course, there's many other features you can recreate: slices, vectors, lists, dictionaries, even for and while loops. The choice just depends on what seems interesting to you.

Conclusion

Again, all the projects I did above are available in this repository. Some of them can obviously be improved. For example, the calculator could have its own GUI (maybe not in C, but in another language) or handle more complex functions like sin and square root. The file search program is single-threaded and synchronous. Could an async/threaded approach be faster? The alloc program is a really dumb implementation of a memory allocation system. There's not even a way to free up memory. Maybe a binary heap would be better (or a Fibonacci heap) rather than a linear, fixed memory pool? The list of improvements are endless.

Of course, there's many, many more offline projects you can do. Pong, Chess, a JSON parsing library, or even an entirely new programming language are all examples of offline projects that you can embark on.

Have you done any interesting projects while offline? Have any thoughts? Opinions? Concerns? Ideas? Write a comment below! 😁

Top comments (8)

Collapse
 
leob profile image
leob

Haha this is great, funny to see you so bluntly and unapologetically admitting that you don't give a hoot about outdoors ... :-)

But anyway, in principle you can do a lot more than these things, you can even do web or database programming or whatever, as long as all the programs and dependencies that you need are already downloaded (and you don't depend on cloud services and so on). And then you're still limited by not being able to access online docs, googling for answers, accessing Stackoverflow and so on.

You could make an effort to download a lot of these things and make sure you have them locally. But it's still a hassle of course. Maybe there's some sort of software tool to assist with this?

Collapse
 
penge profile image
Pavel Bucka

Nicely written and nice example projects!

A Tix-tac-toe (3x3) could be also a good project! Or a Snake.

Maybe you could update the repository and write down projects that you think could be nice to do. And possibly organize these into categories like Games, Common Utils, File Search, File Manipulation, Math Problems, Language Constructs, etc. Reader can pick what he finds interesting and do it. And this list could grow over time.

It would be also nice to mention some good offline resources, like devdocs.io.

But overall, I like the article!

Collapse
 
shawarma profile image
S. Sharma

Thank you so much! I appreciate the feedback.

Collapse
 
alexkadis profile image
Alex Kadis

Making mazes is definitely a fun suggestion. I made a version of Jamis's maze code in TypeScript last year. In the README I describe the process involved and how to reproduce my work.

Collapse
 
matheusgomes062 profile image
Matheus Gomes πŸ‘¨β€πŸ’»

I think it's awesome to have a list of projects to make when you are offline, i pretend to make at least 2 of this list on this summer. But i just want to comment that i read your bio status and i want to say that the author of 'Who Owns the Future' Jaron Lanier is awesome, i have read 'You are not a gadget' and i'm mesmerized by his ideas and the way he writes. Love to see someone likes him too! Good luck on your projects and see ya!

Collapse
 
metz20001 profile image
metz2000

Why is internet needed to develop a web server, a website, an app or virtually anything?
"Many of the tools that typical developers make require an Internet connection."
If there is a dependency on a remote service that can be stubbed or faked. Being offline is actually the best opportunity to verify that unit tests are really using test doubles (mocks, stubs, etc) or depend on remote services.

All one needs is a text editor (ie Notepad on Windows or an IDE), in some cases a compiler, and some means to run the code (ie a local console, a browser or an emulator for mobile apps).

Collapse
 
k2t0f12d profile image
Bryan Baldwin

Video Game Engine

Collapse
 
celnethub profile image
Celestine

Thank you Sharma... Very very insightful