r/AskProgramming • • May 21 '22

Career/Edu What can I implement from scratch that will make me a better software engineer?

As engineers we use so many tools that we just take for granted without really asking what is going on internally. I want to start a new project for learning purposes.

Which algorithm, tool or system you think could be interesting to learn and implement myself?

Do you think it's a good approach to improve my software engineering skills?

Thanks!

58 Upvotes

28 comments sorted by

8

u/[deleted] May 21 '22 edited Jan 02 '26

pet unwritten quicksand include husky adjoining vast encourage society normal

This post was mass deleted and anonymized with Redact

2

u/orgad May 21 '22

Thanks. Do you maybe have some ideas?

0

u/[deleted] May 21 '22

[deleted]

7

u/[deleted] May 21 '22

You can make a simple inventory program using malloc and linked lists for dynamic memory allocation

3

u/PleX May 21 '22

A long time ago I made a task list in C. A lot harder than it sounds. I really like your suggestion.

4

u/[deleted] May 21 '22

It's good because it shows you practical application of dynamic memory. Because in c there's no dynamic arrays or any of that

5

u/_NliteNd_ May 21 '22

Write an operating system, write a compiler, write a database, write cryptographic functions, write a graphics library…

2

u/orgad May 21 '22

This is quite overwhelming. Isn't it?

6

u/_NliteNd_ May 21 '22

It’s a lot, but you asked for things which would make you a better programmer. These abstractions are very hard, but they WILL make you miles better

1

u/nemec May 22 '22

You're going to spend what, 20, 30 years in a career? That's a long time to learn new things.

30

u/[deleted] May 21 '22

I learnt a lot about the HTTP protocol by writing a web framework. Not only did I learn a lot about the protocol itself, but debugging web apps is easier for me now. I have some appreciation for what they tend to be doing under the covers.

Just as an example.

6

u/bronkomonko May 21 '22

I like this, would you mind expanding on how you went about it? Was there any documentation or other sources of information you found particularly useful when you did it?

9

u/[deleted] May 21 '22

Grabbed a web server and had at it, basically. This was in Java, so I grabbed Jetty and started writing tests to hit it with different paths, methods, content negotiation. I ended up writing a DSL in Groovy for routing, very similar to Sinatra.

Docs? The RFC.

3

u/Beerbelly22 May 22 '22

If you are in php, fsockopen function is a nice place to start.

36

u/knoam May 21 '22

Your own programming language.

https://craftinginterpreters.com/

11

u/MadocComadrin May 21 '22

I was looking for this post. Interpreters, compilers, as well as things like language servers are THE tools that get taken for granted. Plus, they're full of interesting algorithms too.

15

u/NotMyGiraffeWatcher May 21 '22

I think the big three are:

Complier, operating system or http server (with no frameworks)

17

u/[deleted] May 21 '22

Develop alternatives to the software you use the most, making it slightly more focused on your needs, that way you will stay motivated because you would actually use the apps your developing and you will learn a lot.

5

u/ruumoo May 21 '22

As a start, implementing your own math library might be a cool project. Simple algorithms but with a large performance impact

4

u/l3l_aze May 21 '22

Just a hobbyist unless I somehow get lucky and fall into a dev job, but I'm working through the book Building Git by James Coglan, and it's been pretty amazing so far (up to ch4, I believe). He uses Ruby, but explains the concepts in enough detail that I've been using Android Java to supply low-level functionality to a WebView and using HTML/CSS/JS to implement a GUI + Jit (Git in the book) functionality, along with a testing framework.

Mobile-only currently, so I'm using the free version of AIDE on Android, and it's very limited but I'm doing my best. Built a catfile -p implementation in JS from Python source yesterday (another language IDK well), so I can see something similar to what he's showing in the book, but the tree handling needs fixed. Tried to make a simple bundling script using Gradle to split the JS up, but it never worked, so it's 1200+ lines so far and there's many more chapters to go.

Deitel and Deitel books used to (may still) include a super-simple custom assembly language interpreter, Simpletron. Their Java book had a more complex version that went on to build a very simple BASIC-like scripted language with an optimizing bytecode compiler which was really fun to work through. Easily possible to find older copies of these at Goodwill or similar "thrift shops", which is how I got mine. Lol.

Testing frameworks are pretty cool, and there's options to go the hard way and parse the test source code (for including coverage), or go the easy way and just provide functionality. Haven't tried a coverage tool yet, as the instrumentation portion to detect which lines are run would be insane because of AST parsing alone.

Documentation parsing and generation is another fun one. I made my own toy version based on JSDoc after trying to use it, with just enough functionality to document the project I was working on at the time.

The most fun, for me, was a complex Steam client settings API based on my own documentation of the Steam client settings, including manipulation and backup & restore, along with easy use of a hidden feature to skip a game update one-time-per-command-run, switch user accounts without logging in again, manage categories, and probably more I'm forgetting. Built an Electron app around it too, but then my PC died and i couldn't keep up using remote CI servers to debug even with automated testing built into the app.

4

u/wrosecrans May 22 '22

malloc()

Conceptually simple. Complex to master. Forces you to have an understanding of memory and syscalls, and gives you a deeper insight into what libc is and how the runtime works, and unpeels some of the layers of what the C spec is vague about because it just says the "system" handles it.

1

u/SergeAzel May 26 '22

If you really want to impress interviewers, have you considered writing FizzBuzz?

2

u/orgad May 26 '22

:/

2

u/SergeAzel May 26 '22

I figured you had enough serious replies.

But if you'd really more serious answer from me...

Well there's plenty. Many have suggested writing your own programming language or parser or compiler already.

Less difficult but with similar technological labor would be designing your own data language such as the next XML or JSON alternative.

Next you'd want a library or set of libraries to parse those objects as strings into object representation.

Further, if you work in a language with good reflection support you could write a library that builds on the former to support full object serialization.

Other ideas include designing your own database engine. Learn modern image or audio compression algorithms and see if you can design your own.

Honestly if you haven't done so yet, maybe the best option would be to just build a product, any small product, but build it with fully automated tests and fully automated build/release systems. Get something that can automatically publish release builds, available for immediate download. This kind of experience is something I've had the least of while working in the industry, simply because another part of the department handles it.

1

u/[deleted] Jun 21 '22

implement the linux kernel from scratch

1

u/orgad Jun 21 '22

Right away

1

u/igors84 May 21 '22

Good opportunities for learning are porting things from one language (which will probably be C or C++) to the other. You learn some things about the source language, about the lib you care about and about the destination language. Examples can be zlib, image loading/writing libs, font libs, windowing libs like SDL or GLFW...

1

u/SniperSmiley May 22 '22

I always recommend making a rasterizer if you can get proper 3d texture transformation you beat me