#Suggestions what to add to my god-header-file

119 messages · Page 1 of 1 (latest)

neon swallow
#

why .h++?

#

your clear console function is a bit terrible, and it doesn't even clear by default

granite stag
#

I know folks prefer clearing the console with built-in functions like cls but that's not my cup of tea

neon swallow
#

I'm not sure what the point of your sleep function, there's already one in the STL and the point is that it's type safe, you can't fumble the time unit

granite stag
#

But I am open to change of course

neon swallow
granite stag
neon swallow
#

getenv, should be std::getenv

neon swallow
granite stag
#

oh yeah mb I should fix that

neon swallow
#

why would get_env throw if the var is empty?

granite stag
#

Because that should never happen.

rocky mangoBOT
#

@granite stag has reached level 2. GG!

granite stag
#

throwing is a quick and dirty solution for now

neon swallow
#

to_upper is UB

#

to_lower too

granite stag
#

As in now, I don't have alot of error handling anywhere. As I said I'll fix later. Throwing works for now

neon swallow
#

what's the point of format when we have std::format?

neon swallow
pale coral
#

It really looks like you could use a macro for half of these

#

just do a macro called sleep and make it do usleep * 1000

neon swallow
#

separate should probably be called split, and you should use std::move instead of copies

neon swallow
pale coral
granite stag
pale coral
#

if they are not complex, weirdly abstract, or just dumb, they are actually fairly useful

neon swallow
# pale coral how come

terrible to debug, harder to track what the code actually is, there are very very few reason to use a macro in modern C++

#

parsing ini and loading an ini should be different functions

pale coral
#

such as this

neon swallow
pale coral
#

#define sleep_ms(ms) usleep(ms * 1000);

neon swallow
#

just write the function

neon swallow
pale coral
pale coral
neon swallow
#

and macros cant be put in namespaces

#

there's so many reason to avoid them

granite stag
#

by the way are you two's main language c++?

neon swallow
granite stag
#

Doesn't the destructor of fstream already close it?

#

or ostream idk

neon swallow
#

when the Out is destructed

#

but yours is gobal so it'll stay open until the end of the program

#

sleep_until_tomorrow is sus af lmao

granite stag
#

why is that?

neon swallow
#

what is add_zero supposed to do?

granite stag
#

when have a single digit number, it puts a "0" infront of it

neon swallow
neon swallow
#

also what if I want 3 digits?

granite stag
#

Thats impossible

neon swallow
#

diff_in_s assumes every mmonth is 30 days?

#

and evry year is 365 days

granite stag
# neon swallow also what if I want 3 digits?

I could make a function for that but the purpose of add_zero was to make dates and military time stuff look normal. Instead of 0:1 or 1-3-2025 when printing it would be 00:01 or 01-03-2025

neon swallow
#

the class Helper has a terrible name

granite stag
neon swallow
#

lol

granite stag
neon swallow
#

why would you need to get the difference in seconds if it's not accurate?

neon swallow
pale coral
neon swallow
#

I'd rather not put that function than to put a broken one

granite stag
pale coral
neon swallow
#

maybe the Helper class could have a thread pool? rather than just one thread?

#

VirtualPath not supporting utf8 is a bit useless

granite stag
#

As far as I know ollama (especially 1.1) is considered the worst LLM

pale coral
#

No i mean its just less fun and more work to use ai to write like 10line functions at most?

pale coral
granite stag
#

Ollama is like chatgpt but has the iq of a banana

neon swallow
pale coral
granite stag
#

I'm a sadist and hate myself

pale coral
granite stag
#

sedatives? What's that? (I genuinely don't know that term)

rocky mangoBOT
#

@granite stag has reached level 3. GG!

neon swallow
#
  std::filesystem is very chunky and not very documented, so
  this class is a smaller wrapper around it. Memory efficiency
  is clearly favored over speed.

what do you mean not very documented? have you checked cppreference?
also not sure what you mean by memory efficiency

granite stag
neon swallow
pale coral
#

and are mildly pleasant

granite stag
pale coral
#

well, quite abit pleasant

pale coral
neon swallow
pale coral
#

damn the size of that popup

#

<> works

granite stag
#

In Folder and File class, large filesystems etc could get massive. I thought that every byte counts so why not use 1 byte strings instead of wstrings

neon swallow
pale coral
granite stag
granite stag
neon swallow
pale coral
granite stag
#

It would be once im done but right now, but I am just worried that a simple Folder class instance could take too much memory

neon swallow
#

in a "general purpose" lib

#

also not sure why TinySTL is there or why it would be in the same lib

#

you're already including std::string, std::vector and std::optional, what's the point of having a second impl there?

granite stag
neon swallow
neon swallow
#

or build form source

neon swallow
granite stag
neon swallow
#

the problem is that once you start using external dependency, you kinda need a build system

granite stag
#

its inhumanly slow but execellent compression which is my very goal

neon swallow
#

don't use LLMs