Serialising/Deserialising Structured Memory To Disk, AKA Savin' Stuff

preview_player
Показать описание
In this tedious and long video, I talk about an easy to use file format that's great for serilizing and deserializing data, i.e. Saving Things!

Source: Coming Soon!

Рекомендации по теме
Комментарии
Автор

This reminds me of a recent video I saw where this guy was trying to create a save system for his game so he went on a journey to implement reflection in C++ by messing with the compiler code itself. This, by comparison, is far more straight forward lol.

connoisseurofcookies
Автор

Since about 2004 I have been using a similar file format to input configuration parameters. But I hated how I accessed the data from within the application. Back then I was more worried about wasting RAM space. Now you have given me some ideas on how to improve and modernize my code.
thanks *big thumbs up*

dihydrogenoxide
Автор

Great to know that you are still producing the standalone "educational" videos.
Keep up the good work.
Great content.

duncangibson
Автор

David, thanks so much for addressing this topic. Serialization/Deserialization is something I've heard a lot about but isn't something that isn't covered in most textbooks,

IsaacC
Автор

I prefer passing the indent level as an argument to the lambda; that saves you having to decrement it. But then I also prefer having a publicly accessible function accepting a file pointer rather than a name, since that simplifies dumping to log files, standard output, etc.

PleegWat
Автор

Very interesting video. I don't do a lot of programming but always enjoy your content

KerboOnYT
Автор

The techniques presented in this video are very powerful indeed! Great video as always.
If I may suggest something; try to add links when you refer to your past videos. For example, you mentioned a video about "a retro menu system" but if I'm interested to watch it then I need to browse through the list of videos on your channel.

glitchy_weasel
Автор

As always, amazing video. Clear code, great teaching, and having an example we've seen before in another video is so cool!! Great mate

ercre
Автор

Good and interesting video as usual. Just a small comment on the fact that your format can easily be "broken", for example if some strings contain an equal sign, or worse, a double quote sign (or a dot for your property chaining with dots). The case of a string containing a double quote sign needs to escape the double quote sign with an escape character, for example, the backslash sign. The escape character then needs to be itself escaped when written. And when reading, escape characters need to be recognized, removed, and then handle properly the following character.

err
Автор

thank you very much, I'm waiting for new videos about the finalization of the format

antikl
Автор

"Human generated garbage"
-Javidx9

brawldude
Автор

That sounds like JSON with extra steps! :D

Good work though, very informative on how to write your own data structure - I would honestly went with JSON as it's standardized and why reinvent the wheel anyway but that's me. Kudos for great thinking!

sorek__
Автор

Man, I've been trying to write a yaml parser (there isn't a good pure-lua one) for a bit and it is making me appreciate JSON more and more.
You want a string? Wrap it into quotes. One kind of quotes.
One kind of mapping, one kind of list.

Python's whitespace may be funky, but zen of python is correct - there should only be *one* way to properly do something.

GTGTRIK
Автор

this man and his oneNote can explain everything

brawldude
Автор

I'm super excited to see your video today! 😎👍

DSage
Автор

Javidx I wish you were in South Africa man. I want to be your student. I am really obsessed about learning the technology behind CAD/CAM systems and your videos really helps me. Are you ever gonna visit SA?

monamodikgwete
Автор

Another great video.
For my data file utility I used the object dot notation each parameter, and didn't worry about making it easy for humans to edit 😁
Based on advice on the Internet, I found using std::stringstream to be a really easy way to parse / tokenise a string based on a delimiter.

A huge point not addressed is what is the "best" / recommended way to make an object serialisable but minimise the coupling between the objects being serialised and the Class doing the serialisation. Here you've added the serialisation code into the object, i.e. coupling the object to the datafile class; but what about a "shapeserialiser" class that knows what data each shape wants to save and how the datafile will save and restore that data and then create Shapes from the datafile; or possibly a Structure of data names and values that is passed between the Shapes and the datafile; or are there better ways?

axelBr
Автор

Wow just as I was done watching all of your videos, you release a new video. Nice timing!

Momoyon
Автор

As always been your videos full of practical working n full of knowledge and something to learn new concept even seasoned programmers.

imrank
Автор

BTW, if you make your separator a single char or C-style string then you can construct a string as e.g. *std::string(count, char)* or *std::string(count, c_str)*. That way you don't need to do the loop yourself. Less typing!

treyquattro