DEV Community

loading...
Cover image for Creating a database from scratch with Node.js - Day 17

Creating a database from scratch with Node.js - Day 17

ciochetta profile image Luis Felipe Ciochetta ・1 min read

Hello folks!

Quick update on the database project:

I have refactored every single one of my statement functions.

I am reading the book "clean code" right now and I am really liking the ideas there, so I have spent some hours today just refactoring my functions.

I am now checking for errors using try catches and throwing exceptions instead of returning errors, the code is indeed a lot cleaner.

I am also trying to respect the "each function should do one thing" principle, so I am breaking down some giant functions into many little functions and trying to keep each function dealing with one abstraction level.

So yeah, I do not have anything flashy to show off today, just did some good old refactoring

Thank you for reading

If anyone wants to read the code or play around with the project, this is the repository for the database >

GitHub logo ciochetta / learndb

Database project I've created for learning purposes

and for the parser >

GitHub logo ciochetta / lql-parser

parser for my database project

Discussion (0)

pic
Editor guide