[Tutorial] Why Dini is bad to use
#1

Will be updated.
Reply
#2

Thanks. I will link people this topic when they ask "Which one is better dini or y_ini?"
Reply
#3

Nice tutorial, I don't really need it but it might be useful for other people who's creating a GAMEMODE using DINI instead of Y_INI, the thing I hate about Y_INI is when you compile you get 4mb on your .amx
Reply
#4

Hmm.. So say there are so much set and get functions being used in the script, and then have them all running at the same time. Wouldn't it consume huge space for a short time. Like, a really huge one for many seconds? Because the .part files get created for something idk which is related with those functions being used.
Reply
#5

Quote:
Originally Posted by Tamer T
View Post
Thanks. I will link people this topic when they ask "Which one is better dini or y_ini?"
Great!

Quote:
Originally Posted by pds2k12
View Post
Nice tutorial, I don't really need it but it might be useful for other people who's creating a GAMEMODE using DINI instead of Y_INI, the thing I hate about Y_INI is when you compile you get 4mb on your .amx
Thanks. I only get around ~50 kb when I compile y_ini, perhaps it might be a combination of several others?

Quote:
Originally Posted by Sublime
View Post
Hmm.. So say there are so much set and get functions being used in the script, and then have them all running at the same time. Wouldn't it consume huge space for a short time. Like, a really huge one for many seconds? Because the .part files get created for something idk which is related with those functions being used.
There's a pretty good explanation for the *.part method in the tutorial. And the huge space would probably be a few kilobytes in size, since it's just a direct copy of the file used for reading.
Reply
#6

Quote:
Originally Posted by Emmet_
View Post
Just use y_ini!
This should really read "Just use MySQL/SQLite" to me the difference between INI and MySQL/SQLite is a cheap wine compared to an expensive wine. It just feels like INI these days is something I used when I didn't know any better
Reply
#7

What if the file used for reading is real huge? Won't that double the space if .part were to be there?
Reply
#8

Quote:
Originally Posted by [uL]Pottus
View Post
This should really read "Just use MySQL/SQLite" to me the difference between INI and MySQL/SQLite is a cheap wine compared to an expensive wine. It just feels like INI these days is something I used when I didn't know any better
That's true, going to add that section right now .

EDIT: Although, this is solely a tutorial about how awful the dini library is, I'll add a SQL section just for the sake of completing the tutorial.

I'll also link to Konstantinos' SQLite tutorial and a threaded MySQL tutorial so I don't have to write a whole section about it.

Quote:
Originally Posted by Sublime
View Post
What if the file used for reading is real huge? Won't that double the space if .part were to be there?
In reality, yes, but only for a few milliseconds at most, since the .part file is deleted shortly thereafter.

dini just opens the original file and writes the contents into the .part file. The original file is then deleted and the .part file is renamed to the original file's name.
Reply
#9

I should have mentioned not to get me wrong INI still has some uses where it might actually be desirable but overall compared to other tools that can be used it is very primitive another comparison would be dcmd to the likes of zcmd/ycmd. Look at Texture Studio's script it can be noted that it is all SQLite and the only time any file functions are used is for importing/exporting and some extended functions to show some files in a folder.

But most new scripters will start with INI because they don't know any better and it is a lot easier for new scripters to be able to open their INI file in any text editor and edit it. So it's good to know INI of course but remember wise man once said "know your db".
Reply
#10

Quote:
Originally Posted by [uL]Pottus
View Post
I should have mentioned not to get me wrong INI still has some uses where it might actually be desirable but overall compared to other tools that can be used it is very primitive another comparison would be dcmd to the likes of zcmd/ycmd. Look at Texture Studio's script it can be noted that it is all SQLite and the only time any file functions are used is for importing/exporting and some extended functions to show some files in a folder.

But most new scripters will start with INI because they don't know any better and it is a lot easier for new scripters to be able to open their INI file in any text editor and edit it. So it's good to know INI of course but remember wise man once said "know your db".
Good point!

Personally, I think that INI files are only reliable for saving settings - which is the sole purpose of an INI file in the first place. For accounts, I rely on SQLite since backing it up is just a simple click and drag operation, rather than copying 2,000 user files to your Dropbox.

This tutorial is just to inform people that dini is out of date and should ALWAYS be avoided for personal use. Every week people are releasing gamemodes that use dini and people are using it, thinking that there won't be any problems, but then you end up with a thread full of "What are these part files in my scriptfiles?", "Why isn't user data saving on logout?", "Why can't I login?".

y_ini would also be great for saving player data, since with the tag feature, you can set the tag to the player's name and simply write to the file.

Irrelevant: The past week, I've been writing a library that allows converting INI files to a SQLite database and it should help out users a bunch (it would also automatically create the database and the columns which corresponds to the fields within the file).
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)