<micahjohnston_>
agh I hate when people put the * on the type
<micahjohnston_>
but anyway lol
<purr>
lol
<alexgordon>
haha why
<alexgordon>
it's part of the type
<micahjohnston_>
well see
<micahjohnston_>
C notates types by putting little operators around the variable name in the same place they'd be used
<micahjohnston_>
for instance
<micahjohnston_>
int arr[10];
<micahjohnston_>
the brackets are like you'd subscript the array in actual use
<micahjohnston_>
int f(int x);
<micahjohnston_>
the argument list is where you'd put it
<micahjohnston_>
int *x;
<micahjohnston_>
the pointer dereference operator is where you'd put it
<micahjohnston_>
and more evidence:
<micahjohnston_>
int* x, y; vs int *x, *y;
<alexgordon>
yeah but nobody writes that code
<alexgordon>
look
<alexgordon>
typedef int *Intptr;
<alexgordon>
foo(Intptr p)
<micahjohnston_>
well I've seen genuine stack overflow questions where people's bugs have been caused by putting * on the type and having multiple vars
<alexgordon>
the *, it's part of the type!
<alexgordon>
well they shouldn't
<micahjohnston_>
right, it's part of the type
<micahjohnston_>
but
<micahjohnston_>
it's not syntactically boxed up
<micahjohnston_>
like
<alexgordon>
maybe not, but who cares, it belongs with the rest of the type
<micahjohnston_>
well the thing is
<micahjohnston_>
you can only do it with *, and only when there's only one variable and not multiple
<micahjohnston_>
like you can't do it with [] or ()
<alexgordon>
but there's never multiple
<alexgordon>
there's always one variable
<alexgordon>
in my code
<alexgordon>
and all my friend's code
<micahjohnston_>
well yeah but semantically the * is modifying the name
<micahjohnston_>
in the type decl
<alexgordon>
people just don't do: int *x, *y;, they just don't
<alexgordon>
so
<alexgordon>
it's free to go with the type
<micahjohnston_>
sure in most code it's not a problem
<micahjohnston_>
but you can't do
<micahjohnston_>
int[10] x;
<micahjohnston_>
like in java
<micahjohnston_>
you have to do
<micahjohnston_>
int x[10]
<alexgordon>
but I see that differently
<alexgordon>
the type is
<alexgordon>
well
<alexgordon>
you can't do that at all
<alexgordon>
yo ucan't do
<micahjohnston_>
but the c designers saw its as the same
<alexgordon>
typedef int tenints[10];
<alexgordon>
an array is a quasi-type
<micahjohnston_>
ok functions
<alexgordon>
use typedefs
<alexgordon>
:P
<alexgordon>
functions are just _weird_
<micahjohnston_>
int f(int x);
<micahjohnston_>
in go you can do like
<micahjohnston_>
types bundled up syntacvticaly
<micahjohnston_>
in c, typecast syntax is a clusterfuck
<micahjohnston_>
because of the way type declaration syntax is done by modifying the *name*, not the type on the left
<alexgordon>
it doesn't really matter though, I just do `int* x` because it's easier to see that the type is "a pointer to an integer" than `int *x`
<alexgordon>
and easier to read = less bugs, always
<alexgordon>
as long as you trust yourself never to do shit like `int *x, *y`, which I do
<micahjohnston_>
but it's an accident that C even allows you to do it
<alexgordon>
micahjohnston_: ok what if you want to do say
<alexgordon>
int * const x;
<alexgordon>
WHERE IS YOUR GOD NOW
<alexgordon>
can't put the * next to the name
<alexgordon>
there's a const in the way
<alexgordon>
but with int* const x; it's consistent
<alexgordon>
const or no const
<alexgordon>
the type is int* and it's being consted
<alexgordon>
…this may be the most pointless argument I've ever had
<micahjohnston_>
int const *x; compiles
<micahjohnston_>
is it different?
<alexgordon>
yeah
<micahjohnston_>
anyway c++ adding const into it just made the type syntax even *more* of a clusterfuck
<alexgordon>
int const *x is a pointer to a const integer
<alexgordon>
int * const is a constant pointer to a mutable integer
<micahjohnston_>
so when you start talking about c++'s additions I want to end my own life
<micahjohnston_>
what about const int *x
<alexgordon>
micahjohnston_: erm const is in C too!
<micahjohnston_>
was it before c99?
<micahjohnston_>
because c99 was basically backports
<alexgordon>
no idea but it's definitely in there now
<alexgordon>
pretty sure it was c89
<alexgordon>
but I dunno
<micahjohnston_>
nope c00
<micahjohnston_>
c99
<micahjohnston_>
wait not sure
<micahjohnston_>
anyway yet again
<micahjohnston_>
int *const x;
<micahjohnston_>
is liek
<micahjohnston_>
const modifying x
<micahjohnston_>
* modifying that
<micahjohnston_>
versus
<alexgordon>
I've seen code pre-2000 that uses const so it has to be c89
<micahjohnston_>
int const *x is * modifying x, const modifying that
<alexgordon>
micahjohnston_: so
<micahjohnston_>
yeah I think it is but it still fits iwthw it
<micahjohnston_>
finding it hard to give a fuck anymore but it's still consistent
<alexgordon>
const int * is the same as int const *
<micahjohnston_>
well yeah
<alexgordon>
which means you can't do *x = 10;
<micahjohnston_>
put const wherever the fuck you want as long as it's on the same level in the order of modification
<alexgordon>
and int * const means you can't do x = &something;
<micahjohnston_>
can you do int *x const;
<alexgordon>
errr
<alexgordon>
noooo idea
<alexgordon>
but I would never do it :P
<alexgordon>
too weird
<micahjohnston_>
but like that's still consistent with my model of the C type syntax
<micahjohnston_>
which is consistent, just a fucking dumb idea
<alexgordon>
haha yeah
<alexgordon>
in his book, bjarne proposed simplifying it (!) but decided against it for backwards compatibility reasons
<alexgordon>
he proposed something rather like Go's actually
<alexgordon>
you should read bjarne's book btw, it's really interesting
<micahjohnston_>
which one? the original c++ language one?
<micahjohnston_>
I think we have that one
<micahjohnston_>
my dad has a great big bookshelf of programming books
<alexgordon>
it's the antithesis to all those wanky proglang research papers
<micahjohnston_>
one of them is "the c++ object model"
<alexgordon>
hold on
<alexgordon>
don't think it's that
<micahjohnston_>
i don't think it is
<alexgordon>
micahjohnston_: he goes through and discusses all the practical problems of building a programming langauge
<micahjohnston_>
but that one is full of disgusting shit :p
<micahjohnston_>
subject change: I've realized something about productivity
<micahjohnston_>
I want to make games, and make music, and programming languages, and novels
<micahjohnston_>
and maybe learn to draw
<alexgordon>
haha
<alexgordon>
so not much then
<micahjohnston_>
but I cannot focus on even like 2 of those things at once
<micahjohnston_>
so
<micahjohnston_>
I've decided
<micahjohnston_>
at some point, not during this hellish school year
<micahjohnston_>
allocate like
<micahjohnston_>
a week
<micahjohnston_>
or a month
<micahjohnston_>
at a time, to each of those things
<micahjohnston_>
so I can get really in depth in them and not be task switching
<micahjohnston_>
and do some really focused, high quality work
<micahjohnston_>
and then switch so I'm not burnt out on it and so I can do all of them
<alexgordon>
have you read pg's essay about "top thoughts"?
<alexgordon>
stuff you think about in the shower
<micahjohnston_>
I may have
<micahjohnston_>
yeah I have
<micahjohnston_>
yeah that's another reason
<micahjohnston_>
when something is the thing your mind turns to during downtime at school or whatever that is the thing you will get done
<micahjohnston_>
I remember being aware of that in 9th grade
<micahjohnston_>
I wanted to write a story
<micahjohnston_>
but I found myself not always thinking about the plot of it
<micahjohnston_>
and so I realized that it was not going to get written
<alexgordon>
it's interesting how the compellingness of an idea determines how successful it is. If something is in my head all the time, then I have to devote lots of brain time to it, and I usually end up doing a good job of it
<micahjohnston_>
whereas sometimes the opposite is true
<alexgordon>
but if I'm getting distracted, yeah it's doomed from the start
<micahjohnston_>
yewah
<micahjohnston_>
yeah
<micahjohnston_>
My wife thinks I'm more forgiving than she is, but my motives are purely selfish.
<micahjohnston_>
haha I like that
<alexgordon>
I read that out of context and thought you'd gotten married already
<micahjohnston_>
hahaha
<alexgordon>
mormons eh!
<micahjohnston_>
i have a girlfriend but we are both not mormon so you can rest at ease
<alexgordon>
wait you found a non mormon gf in utah?
<micahjohnston_>
here in the salt lake valley it ain't so bad
<micahjohnston_>
provo and st george and stuff are >90% mormon
<micahjohnston_>
st george is also like 90% white and very aged
<micahjohnston_>
but salt lake was named one of the most gay-friendly cities
<micahjohnston_>
and <50% mormon
<micahjohnston_>
so still a lot but way less than the rest of utah
<micahjohnston_>
:p
<micahjohnston_>
actually most of my friends are not mormon, and a significant number are ex-mormon
<alexgordon>
90% white isn't that far off from the UK :P
<alexgordon>
actually apparently the UK is 90.94% white
<alexgordon>
so… not far off indeed :P
<micahjohnston_>
oh wow
<alexgordon>
next biggest group is indian
<micahjohnston_>
most of my cultural experience of the UK is through things about electronic music over the internet
<micahjohnston_>
so I get the impression that there are more black people than there are :p
<alexgordon>
haha yeah there's quite a few in london
<alexgordon>
and in some of the cities
<alexgordon>
but in places like scotland it's very very white
<micahjohnston_>
ah
<alexgordon>
no slaves :P
<micahjohnston_>
haha right :P
<alexgordon>
but yeah I didn't know that the indian subcontinent was our largest (non-white) ethnic group
<alexgordon>
guess I should have guessed living next to hounslow
Nuck has quit [Ping timeout: 248 seconds]
Nuck has joined #elliottcable
<micahjohnston_>
sorry was gone
<micahjohnston_>
back
alexgordon has quit [Quit: Computer has gone to sleep.]
sephr has quit [Quit: Leaving]
<devyn>
Nuck: screw Rails
<devyn>
lol
<purr>
lol
<devyn>
also, Nuck, whitequark, I learned a bit of Go a while ago
<devyn>
it's alright, I guess, but it's not what I was really hoping for
<whitequark>
devyn: how's its error handling in practice?
<whitequark>
also interested about the builtin strings and maps. usable? quirks?
<whitequark>
the thing I like the most is its import/export system. is it as good as it looks like?
cloudhead has joined #elliottcable
cloudhead is now known as Guest77578
_whitelogger has joined #elliottcable
alexgordon has joined #elliottcable
yorick has joined #elliottcable
yorick has joined #elliottcable
yorick has quit [Changing host]
sephr has joined #elliottcable
notalexgordon has quit [Read error: Operation timed out]
notalexgordon_ has joined #elliottcable
PragCypher has joined #elliottcable
<Nuck>
devyn: Like I said, I despise rails. But it's fucking effective, and I can't argue with that. It's boring, it's shitty, it's enormous, and it's *effective*
<alexgordon>
well you're cheating by depending on the whole of the ruby interpreter
<whitequark>
alexgordon: ok I'll be more specific. use any language from TIOBE index, don't use any builtin sort functions.
<whitequark>
or external, i.e. nonstandard library code.
<whitequark>
(I've even removed the J/K/APL clause)
<whitequark>
it should be quicksort, it should accept an array and return an array
<whitequark>
it can mutate the array or create a new one
<Nuck>
So, I just watched Anamanaguchi DJ on Turntable.fm
<Nuck>
I love this site.
<vil>
Nuck: I was in a room with Knife Party a few weeks ago
<vil>
t'was pretty cool
sephr_ has joined #elliottcable
sephr has quit [Ping timeout: 258 seconds]
PragCypher has quit [Quit: Leaving]
Sgeo has quit [Read error: Connection reset by peer]
Sgeo has joined #elliottcable
PragCypher has joined #elliottcable
<Nuck>
Hey guys, do any of you know an algorithm for propogating a change up an inheritance tree?
<whitequark>
Nuck: huh?
<alexgordon>
Nuck: huh?
<Nuck>
Like, let's say I've got A inheriting B inheriting C, and there's also Foo and Bar with similar inheritances to A, well, if C changes, A, Foo and Bar all need to be updated with the new info
<Nuck>
This is easiest implemented at runtime, but not feasibly so on this scale, I'd say — we're talking potentially 50+ tags all to flatten down before a page can load
<whitequark>
wat are you talking about
<alexgordon>
Nuck: what
<alexgordon>
Nuck: so C is your base class?
<Nuck>
hehe I'm making a recursive tagging system where an Item can be tagged with, say, 5 tags, but those 5 tags are also tagged with more tags, and then so on
<Nuck>
It's not classes, it's inheritance
<whitequark>
you need a nested set of associations
<Nuck>
Well, more importantly, the requirements are very different
<whitequark>
and also to be put in a mental institution
<alexgordon>
Nuck: has probate been granted yet?
<Nuck>
alexgordon: probate?
<Nuck>
Yes, I'm crazy, but this is a UX idea I've had bouncing around and goddammit I wanna make it happen
<Nuck>
I mean, if I can get the time of execution down within a reasonable period, then I can do this at runtime and that'd be awesome
<Nuck>
And I need to flatten it either within a reasonable time or in a manner which doesn't cause my database to explode
<whitequark>
Nuck: nested set
<whitequark>
spaghetti stack has nothing to do with that
<alexgordon>
it was more the picture
<Nuck>
Well spaghetti stack looks like it could have applications in certain situations related to mine, but not precisely mine
<alexgordon>
Nuck: I have basically no comprehension of what you're doing, but... avoid redundancy
<whitequark>
don't ever listen to him
<alexgordon>
lol
<purr>
lol
<whitequark>
if it's an RDBMS, denormalize
<whitequark>
it's the only way to make it fast, basically
<whitequark>
if it's mongodb, fuck off.
<alexgordon>
redundancy is the enemy of all things good and proper
<whitequark>
... says a person who clearly never had to deal with a slow SQL query.
<alexgordon>
heh, now I *know* that's not true
<Nuck>
whitequark: Hmmm the nested set looks very applicable but I'm worried it's not nearly as applicable to a system of child-parent relationships instead of parent-child relationships
<alexgordon>
I dislike RDBMSs anyway
<alexgordon>
files FTW!
<Nuck>
Honestly I would use a graph database for this in the ideal
<Nuck>
Just traverse it at runtime
<alexgordon>
graph database lol not that again
<purr>
lol
<Nuck>
I really want a fucking graph database okay?
<Nuck>
This is exactly why.
<alexgordon>
just write the damn thing in C++ and store the data in a bunch of files. What could possibly go wrong
<Nuck>
Yeah Nested Set won't work
<Nuck>
The problem is, nested set is designed for folder-like relationships, where you traverse from broad to narrow
<Nuck>
But I'm designing the opposite — a traversal from narrow to broad