>this makes the js fags seethe
This makes the js fags seethe
Other urls found in this thread:
youtube.com
twitter.com
seriously though, what is the point of having header files in your language? I still don't get it
nobody knows
lol you need to include stuff so your linker can figure stuff out that we don't even have to think about
Aktshually it's for the compiler, not for the linker.
why can't they just check the function definitions directly?
because c/c++ programmers hate themselves. unless of course they use an ide which they don't.
Well it's C, so history reasons most likely. Someone in the 70s though "eh it'll be fine and run way faster on this computer we got for cheap." And now we are still dealing with headers.
headers are based
modules are cringe
I am hacking nasa with javascript :-)
no hacky stuff in pic
okay, what about this? I learned this from mister sir robot
so when referencing functions in a different files you dont have to worry about race conditions
this way you can check for redefinitions
wow, was this song written about you? youtube.com
>this way you can check for redefinitions
how? can't you just redefine anything anyway?
to build an elaborate net of interlinking files that no normal human bean can have an overview of
no. thats the point the compiler will stop you in your tracks if you attempt it.
in a far and highly advanced future, we will have switch statements that support non integer like Strings natively
You can just write the definition if you want, it's just that the convention is to have header/source files for scoping reasons
Because the compiler processes each .c file independently. It's up to the linker to decide if the referenced symbols are in a shared object (library) or one of the compiled objects. The headers are required for the compiler to know how to call a function or access a variable that's defined outside the current compilation unit.
>wow, was this song written about you?
it was yeah, I am the CEO of Anomalous :_)
lol I am just learning js and don't even know what you mean
usually switch only works with ints and in rare cases with float
In C? No we won't, how do you define equality on char*? It's not necessarily zero terminated.
sorry for ebing retarded but isn't float a css command?
>in C
thats why I said highly advanced and not dystopian Fallout future
tbf something something like this:
switch( memcmp(my_char_ptr, ..., my_char_ptr_len) ){
case str1:
case str2:
}
where "..." is the placeholder for the case value would be very nice
i should have negated the memcmp, but you get the idea
not my problem. let AI teach the compiler to know that the String "Hello" ends after "Hello"