logs archiveBotHelp.net / Freenode / #2f30 / 2015 / August / 27 / 3
FRIGN
for example, set theory:
{n in N | n = 2k, k in N} is the set of even numbers
we only use their property, but would never dare to assume an even number, which somehow contradicts itself
I'll look into it in the future
stateless
assume in what way? its existence?
I mean surely that set exists, why can we not talk about it
be back smoke
Evil_Bob_
i drink 2-3 strong cups a day
2cups1bob
FRIGN
stateless: that's the joke. we literally never handle objects themselves
only properties
if you pull that through to first order logical systems, it would make the goedel-problem impossible :D
stateless
FRIGN, ok I see
FRIGN
:)
it's actually quite philosophical
k0ga
stateless: greek coffe doesn't count as coffe
my greek partner drinks along the full day the same coffe
stateless
"But C? Cs dead. Its the language for old programmers who want to debate section A.6.2 paragraph 4 of the undefined behavior of pointers. Good riddance. Im going to go learn Go."
hahaha
http://zedshaw.com/2015/01/04/admitting-defeat-on-kr-in-lcthw/
" And Id rather make the book useful for people who can learn C and how to make it solid than fight a bunch of closed minded conservatives whos only joy in life is feeling like they know more about a pedantic pathetically small topic like C undefined behavior."
but why! undefined behaviour topics are really interesting!
:P
then again I cannot take someone's opinion seriously if he hasn't written a C compiler so
"I will be sure to mention all of the pedantic things that every pedant demands about NULL pointers on a PDP-11 computer from the 1960s."
hahaha
"Im going to learn Go, Rust, and Swift. Holy crap. Stop being so religious about who learns what. I learn languages now to teach them to people, not because I plan on using them for anything. Dont listen to me as a barometer of whats cool now. Peace."
how can you teach people if you don't really use the language yourself? :P
in any case: https://github.com/btrask/stronglink/blob/master/SUBSTANCE.md
most suggestions on there are bullsh*t
k0ga, ^
k0ga
xD
stateless
"Use const to indicate and enforce ownership"
... :P
fu*k const
k0ga
yeah
of course ...
there was a moment I used const
it never help me in anything
stateless
yes
:P
and forces you into undefined behaviour when you get frustrated and cast out the constness
:P
k0ga
and it is so easy get poissoned by it ...
stateless
Immediately clear pointers after freeing
free(x); x = NULL;
Define a macro like FREE(&x) to do this for you
Assert that buffers are entirely zeroed before freeing
Don't just memset to 0, FREE/clear each field individually
...
k0ga
xD
stateless
that's retarded
k0ga
in fact, memset a struct is undefined behaviour
but, who cares?
xD
stateless
yes but it is very common
:P
k0ga
there are ppl in comp.c.lang that works in some IBM mainframes where NULL is not 0
but ...
come on
Evil_Bob_
k0ga: why is it undefined? because of potential padding?
stateless
k0ga, I believe doing an assignment to a nil compound literal should reset/initialize the members correctly (even floats and sh*t)
right?
Evil_Bob_, no because 0 is not always the nil value for the types being initialized
:P
like NULL
on IBM mainframes
Evil_Bob_
stateless: i mean memsetting a struct
stateless
yes
Evil_Bob_
but it shouldnt matter in most cases right? i mean:
stateless
struct foo { char *p; } foo; memset(&foo, 0, sizeof(foo)); is not the same as foo.p = NULL;
in theory
:P
Evil_Bob_
struct { char a[69]; int b }; memset(struct, 0, sizeof(struct))
k0ga
stateless: I don't understand your question
stateless
k0ga, = { 0 }; is valid as opposed to memset() or bzero()
k0ga
Evil_Bob_: p == 0, is always correct
stateless
it will initialize everything correctly
Evil_Bob_
stateless: ah yea, but fu*k NULL != 0 tbh
k0ga
but it doesn't mind that a pointer which value 0 is a correct null pointer
stateless
even if NULL does not have a zero bit pattern
k0ga, yes that is done in pointer context so it knows
k0ga
yeah
stateless
but in any case
memset on a struct always works
in practice
k0ga
the compiler has to add magic if NULL is not 0
stateless
yes
k0ga
if you use memset, the compiler cannot do add this magic
and the same with floats
stateless
Evil_Bob_, also think of floats
haha u got me
:P
k0ga
:P
stateless
there could be a floating point representation where all zero bits would not be the same as assigning with 0.f
k0ga
or even a valid number
Evil_Bob_
*sigh*
k0ga
maybe it is nan
atmc
k0ga: if i have a branch 'develop' for digging around and a feature branch
after i merged the feature branch to master
« prev 1 2 3 4 5 6 next »