« first day (877 days earlier)      last day (4070 days later) » 

9:00 AM
I mean, at least it's clear....
 
Modern programming languages
(...)
Ada 95 [Ada95]
Enterprise Cobol [Cobol]
 
@ThePhD no no no!
 
q_q
 
what is the 'thing' it is a Vector, not a 'VectorMath'
 
user142019
Vector and matrix? Make a generic tensor class!
 
9:01 AM
YAGNI
Quite literally.
 
@R.MartinhoFernandes ¬_¬ I forgot this one already :P
@Zoidberg would that really be easier though?
 
user142019
@R.MartinhoFernandes :P
 
user142019
@thecoshman no, but why so specialized?
 
ooooh, I got YAGNI now :P
 
@ThePhD one class/namespace. K.I.S.S.: Keep It Simple, Stupid. Remember you're going to have to type this shit, and be able to remember where to find each piece of mathy stuff
 
9:03 AM
@Zoidberg well, vectors and matricies are used a lot
 
@Zoidberg Because that's what he needs.
 
the only real objects you need are vectors, quaternions, and matrices.
 
@jalf well no, I do think a 'Vector' class and a 'Quaternion' class etc makes sense, but they should all just be in a 'maths' namespace
 
btw robot
submitted all proposals last night.
 
posted on March 11, 2013 by Xeo

Battle Intro When dealing with overloaded templates, it’s often desirable to restrict certain overloads so that they don’t accidentally get selected. A previous blog post already explains how to do that, the disadvantage being that you need to have non-overlapping conditions (or disjoint conditions). Let’s take a silly example: template<unsigned N, EnableIf<is_multipl

 
9:04 AM
@thecoshman Agree. You'll also need several subclasses like plane, ray, bounding box, etc, and they can all go in there too.
 
@thecoshman A vector class for representing a vector, sure. But not a class or namespace just for "all vector-related math"
 
Maybe vote up if you can't answer !? — Mahdi 4 mins ago
lol
 
Xeo
Awright
 
@jalf well no, vector related maths would be part of the vector class. But things like 'Ray / Plane' intersects would be just name space
 
I don't want to do this java shit ._.
 
9:08 AM
Whistles.
Slides out of the room before anything else happens.
 
Xeo
Time to slap some sense into a certain PhD student.
 
@ThePhD I'll trade you my German java crap assigment, and I'll do your linalg thing :p
 
@DeadMG Cool.
@Xeo Hey, look, it's up.
 
user142019
@melak47 In Java.
 
no
 
Xeo
9:09 AM
Woot, I completely forgot I have wasabi-coated peanuts here.
@R.MartinhoFernandes Yeah, thanks a lot :D
 
@Xeo peanuts? I'v eonly had wasabi coated peas :)
 
@thecoshman as little as possible. Most of it should just be free functions in your general mathy namespace
 
Xeo
@DeadMG Nice. I spent all day yesterday with the blogpost so I didn't even get started on mine. :<
 
well, the absolute cut-off date is Friday
 
@jalf aye, but things like 'vector + vector' would obviously be class functions
 
9:11 AM
so you'll need to get cracking
 
@thecoshman why?
It starts getting silly if vector/vector intersection is a member function, but vector/plane is a free function. Just make them all free functions and keep some semblance of consistency
 
!!
AHA!
Transforms.
Brilliant class namespace name.
 
Xeo
@LucDanton btw, I've been thinking about the return-type deduction thing a bit - C++ has kinda gotten itself into a corner. :/ It might be possible to day that when you specify auto, you get a perfectly-deduced return type - but then, how do you get a value-type? Would you have to specify Decay<auto>? :/
 
@ThePhD They're called Transformers, you know :)
 
Man, I wish I could use one class inside of another with templates. =[
 
9:14 AM
@ThePhD Do you seriously need a namespace just for rotation, translation, scaling and skew?
 
@Xeo auto vs auto&&!
 
Xeo
@R.MartinhoFernandes Nope
auto&& breaks prvalue returns
 
/me weeps for your class hierarchy
just use a fucking math namespace
namespaces exist to avoid name clashes, and little else. Is there a danger that, if you put all your math stuff in a single namespace, you will get clashes between completely different operations sharing the same name? If not, put them in a single namespace and get on with your life
 
there's already a math namespace that does all this :p
namespace DirectX :P:p:P
 
namespaces are handy if you have a string class, and the third-party library you use has a string class, and the standard library has a string class, and you need to be able to tell them all apart. Or slightly more relevant, you have a vector class, and the standard library has a vector class.
 
9:20 AM
@jalf no I mean vector addition, you wouldn't want to use a a free function add two ints, why would you two add two vectors
@jalf this
 
mul(mul(mul(mul(matrix1, matrix2), matrix3), matrix4), matrix5); // :3
 
@thecoshman I absolutely would use a free function (or operator) to add two ints
 
@jalf (or operator)
 
@melak47 Yes, point is, I'd use a free <whatever> rather than a member <whatever>
 
and if you make an operator for your vector types, your vectors are already types, so you might as well put the operator in the type? :p
 
9:23 AM
@melak47 you might as well, except it is cleaner to keep them outside
Don't stuff random garbage inside your classes
 
wut
 
@jalf or operator... so member function
 
how is operator+ random garbage
 
If you keep your classes small, there's a hypothetical chance that they might actually be somewhat functional and bug-free
@melak47 It is random garbage if it doesn't need to be there
 
it's not good for anything else, so why put it elsewhere? o.O
 
9:24 AM
@Xeo, read your article, great article! Easy to understand and informative. Thanks.
 
Xeo
Cool, glad to hear that. :)
 
@jalf but if you need a function, it does not matter where you put it, you have just as much chance of causing a bug
 
@melak47 (1) because keeping it elsewhere gives you better encapsulation, and (2) because it is useful elsewhere. You can multiply vectors by other things than vectors
 
@Cicada hay there, lone time no see :P
 
9:25 AM
@thecoshman No. A function which has access to the class' private members is capable of much more destruction than one which doesn't
 
@jalf well, I said operator+ :p
so, nyaa nyaa :D
 
would you really rather have magnitude(vector) over vector.magnitude()?
 
||vector|| plox
 
Xeo
@melak47 _||vector||_
 
9:27 AM
was ||v|| norm? whatever
 
@thecoshman Yes, I would
 
user142019
user image
4
 
Xeo
@melak47 Right, I think |v| was length
But whatever, fuck math notation :D
 
user142019
@melak47 y u no operator*.
 
@jalf you crazy!
@Zoidberg ask @jalf
 
9:29 AM
@thecoshman For three reasons: 1: it is safer/cleaner, as pointed out above. 2: it is more natural "mathy" syntax, and 3: it leads to an extensible interface. Anyone can add new vector operations by defining new free functions, without having to touch the class
 
@Xeo Length and 2-norm are the same thing.
 
@Xeo but isn't it the same anyway for real vectors? length, magnitude, norm? :S
 
@ThePhD you should render transparent objects with some other algorithm :P
 
damn
 
@thecoshman Herb Sutter and Scott Meyers are crazy too then :)
 
9:30 AM
I Keep making embarassing mistakes at work :(
 
@jalf 1. perhaps/dabatable 2. I would argue the opposite 3. I don't see how having class functions prevents non class functions being added
 
on 3, it doesn't, but it creates an artificial syntactic distinction between "vector operations which were always there", and "vector operations I added later"
 
@melak47 There are various different norms. The most commonly used is the Euclidean norm (aka 2-norm), which is the same thing as the length.
 
@jalf appealing to authority, be careful
 
@thecoshman No
 
9:31 AM
@R.MartinhoFernandes that's usually what I mean when I'm in euclidean space :S
 
@jalf which I personally think is a good thing.
 
It would be appeal to authority if I dropped their names and nothing else. Instead, I specified multiple reasons why this makes sense, and I linked to articles where they explain their reasoning
 
@melak47 You can use other norms in Euclidean space!
 
@thecoshman Then my question to you is "what are you smoking"?
 
@jalf as in 'no I'm not' or 'I will be reckless all I want'
 
9:32 AM
@R.MartinhoFernandes but I don't wanna!
 
@BartekBanachewicz Never.
 
@thecoshman as in "no it is not an appeal to authority"
 
@ThePhD good luck with that :p
 
:3c
 
so, can we see your farmer yet?
or any screenshots?
 
9:33 AM
@jalf I t allows for a clear distinction between library code and my code, code I should be able to assume solid, and good I will question first
 
@melak47 Why do you want to see my farmer? D:
 
@thecoshman on #2, really? In your math class, did they teach you to write functions as y = x.f()? We were generally taught y = f(x)
 
any hoops, this is not going any where fast. I shall read those articles whilst 'work' and get back to you
 
@ThePhD because you talked about him
 
Okay, maybe later in teh week or something. D:
 
9:34 AM
@jalf no, they taught me x + y not +(x,y)
 
@thecoshman Operators are irrelevant. They have teh same syntax whether you declare them as member or nonmember
 
what's that thing to make a shell script?
 
(although their nonmember implementation is simpler and more flexible)
 
@ThePhD what? Dude.
 
@DeadMG text editor
 
9:35 AM
@BartekBanachewicz :D
 
user1357851
@DeadMG vim
 
yeah, I meant, they seem to have a special invocation at the top.
 
@ThePhD There's a difference between "reinventing" and "plainly wrong"
 
@thecoshman Show me a good way to implement a member operator allowing me to multiply a scalar by a vector (with the scalar on the lhs). :)
 
@DeadMG #!/bin\bash/\something?
 
9:36 AM
@DeadMG she-bang? #!/path/to/interpreter
 
user1357851
#!/bin/bash
 
user1357851
depends on which shell you are using maybe
 
user142019
#!/bin/sh is more common.
 
then afterwards I just dump commands in it as if I'm in the terminal, right?
 
you could implement a member operator for vector * scalar, and a nonmember for scalar * vector, or you could be consistent and implement both as nonmembers. With the added bonus that you keep the class small, and access to its private members minimal
 
9:37 AM
@DeadMG Yeah.
 
user142019
@DeadMG Yes.
 
oksies
 
user142019
And make the script executable using $ chmod +x foo.sh from your shell.
 
user142019
Then you can run it using $ ./foo.sh.
 
user1357851
freeos.com/guides/lsst <== newb's guide to shell scripting
 
user142019
9:38 AM
You can do the same with Python and Ruby and whatnot; #!/usr/bin/env python.
 
@jalf see, you are arguing that there should be no member functions, whilst I am arguing that some functions make sense to have as member functions. It's not going to get very far
 
@jalf clearly operator* should be a member of class scalar here and produce a vector :3
 
@thecoshman No, he's arguing to minimize member functions.
yay, I increased my column count to 300.
now the terminal can actually use a reasonable amount of my screen space
 
When I write my own language,
it's going to have properties, and they're not going to suck dick. ._.
 
user142019
s/write/design/
 
9:47 AM
write.
 
pfft
everybody is just jealous of Wide.
 
I don't like Wide's syntax at the moment.
 
user142019
Wide's feature list is too narrow.
 
:= and = is still bugging me out.
Though it's something I could probably get used to.
 
@ThePhD You'll be glad for it when named arguments come about.
 
user142019
9:48 AM
:= and = is great.
 
@thecoshman no, I am arguing that member function should only be used when necessary: mainly when you need access to the class' private members
 
:= declare + assign thing, = assign thing?
 
@jalf You know what syntax would make binary operator stuff nicer on classes?
Being able to specify if it was right or left.
 
and so far, your sole argument seems to be "but x.f() looks nicer", which is just a matter of what you're used to. Preferring nonmembers is more flexible, consistent and safer
 
operator left *
 
9:50 AM
Except for the clusterfucks you get in C++ or Perl, I think complaining about syntax is just silly a "get-off-ma-lawn" response.
 
operator right *
 
user142019
@melak47 x = y; is assign, x := y; is like auto x = y;
 
@R.MartinhoFernandes get your fucking clusters off my lawn
 
@Zoidberg so, declare and assign? :p
 
user142019
Yes. :P
 
9:51 AM
@jalf Get your lawn fucking away from my clusters?
 
user142019
Or initialize, how you want to name it.
 
Xeo
@melak47 initialize
 
user142019
I don't know the correct Wide terminology. :P
 
user142019
lol
 
user142019
I have a lecture and the beamer is borked.
 
9:54 AM
@Zoidberg I prefer "Construct".
 
@DeadMG how about a ≜ operator? :3
 
the only declarations in Wide are functions which are dynamically located.
 
user142019
@DeadMG What about T() expression?
 
@Zoidberg Constructs a temporary variable?
 
user142019
Yes.
 
user142019
9:55 AM
A value.
 
an rvalue.
 
user142019
Is that also called construct? :P
 
of course it is.
you constructed an rvalue of type T.
 
user142019
Oh and := constructs an lvalue?
 
user142019
I see.
 
9:56 AM
yeah
in fact, internally, I have BuildRvalueConstruction, BuildLvalueConstruction, etc.
and a couple others whose details you don't want to know.
 
user142019
What are the details?
 
user142019
Oh nevermind, I don't want to know.
 
well
in Wide, then everything is either an lvalue or an rvalue, right?
but at the code generating level, there's a third value category.
 
user142019
If you say so.
 
which I have to dick around with conversions to and from
so I have BuildValueConstruction.
and the last one is placement, a'la placement new.
speaking of which, I need to fix my code generation for complex types
after work, though
 

« first day (877 days earlier)      last day (4070 days later) »