« first day (589 days earlier)      last day (4358 days later) » 

10:00 AM
@Jeremy No, you say "We'll cover it later." and move on.
 
He doesn't have to, at first. But it will stuck and later, he'll connect the dots.
 
@sehe how do you figure I suggest that?
 
@DeadMG Precisely.
 
@DeadMG But students need to/should learn multiple languages anyway, right?
 
Basically then, you're saying put this in here, we'll cover the entire thing later.
 
10:00 AM
@FredOverflow Eh. I disagree.
you might make an argument for multiple paradigms.
but the simple fact is that if you're on a university course, time is tight
technically, I covered like ten languages in my course
 
@DeadMG I wouldn't hire a programmer if all he knew was C++.
 
most of them only taught "append to a list"
 
C++ would be much easier to teach if he had a REPL.
 
there's not enough time to cover more than one, or at most two, languages in detail
 
And also, when you learn C++, you get a lot of stuff you might not get elsewhere. That makes adapting to any language a much smoother process.
If you need another language, it won't be a problem. But there's nothing on should know basis
 
10:02 AM
it's a waste to endlessly re-learn different syntax that can only perform the same semantics
 
True dat.
 
yes, people should know more than one language, but they should also know more than one language in depth.
 
You wouldn't have to explain I/O at all then, until later.
 
and there's not enough time in a university course for that
 
Do you think one semester is enough time to "learn a language"?
 
10:03 AM
Start with expressions, then functions, then function templates, et cetera. I/O can be somewhere at the end, along with broken toolchains.
 
@FredOverflow Are you bullshitting me? One semester of even Java is hardly enough to produce relatively simple programs.
 
Learning a language is a lifelong process, you can capture the basic notions and rules in a few months.
 
Basics of Java can be learned in an hour or two.
 
But learning it truly takes years. Knowing a language is knowing to apply it.
 
@DeadMG No I mean if you already know the basic gist of programming, can you learn e.g. Python in one semester?
 
10:04 AM
Advanced things, in a week.
 
I did one semester of Haskell and we never even covered lists, let alone monads or anything like that
@FredOverflow Students don't already know the basic gist of programmin.
could I learn Haskell in a semester? Maybe. Can a random first-year student? Probably not.
 
@DeadMG I'm not talking about beginners, I'm talking about students who already have 3 semesters background in Java or whatever.
 
They're still beginners. :Š
 
Python is easy, too.
 
I mean, other than a string literal, everything in a C++ hello world is something you'd explain later. I guess you could go as far as saying 'main is the entry point, don't worry about the arguments or the return or anything like that until later.'
 
10:05 AM
@Jeremy string literals aren't exactly trivial in C++ either :)
 
For this discussion to work, beginner/intermediate/expert must be properly qualified.
 
@FredOverflow The entire of Haskell? I don't think so
some of that Monad shit is quite complex, IIRC
 
@DeadMG Okay, screw Haskell (for the purposes of this discussion). What about LISP or Python?
 
Len
@DeadMG is there such a thing as "the entirety" of Haskell? I think it just goes on forever.
 
Haskell is rather simple.
 
10:06 AM
@FredOverflow Python? Definitely
 
Hardest thing is paradigm shift.
 
@FredOverflow You could do Lua in a semester, even with no experience.
 
Actually, thats a good point.
 
In fact, I forced C++ on students with virtually no background in programming in one semester
 
10:07 AM
but again, then what are you gonna do if you want to teach OGL? Lua is not particularly suited (at all) to such things.
 
at the end, they were doing parallelisation on bioinformatics algorithms using OpenMP
so yes, that’s definitely possible
 
@KonradRudolph How much of C++ did you force on them?
 
@KonradRudolph That's not particularly impressive depending on the context.
 
But the question is - how well do individuals (on average) process something of complexity in a short amount of time.
 
I mean, you have to consider how specific your teaching was to that end, for example
 
10:08 AM
@DeadMG I beg to differ
@FredOverflow As much as I could manage … but to be honest, not that much.
 
@KonradRudolph "depending on the context" -> i.e., it could be quite impressive, but I'd need to know more
 
Am I the only one who thinks that C++ and OpenMP bites?
 
yeah
I'm not proposing C++ as in a teensy little bit
I mean templates, SFINAE, expression templates, the works
covering it in actual depth
 
@ScottW I'm hungry.
 
@DeadMG Point taken … if I remember correctly they had to implement QUASAR using data parallelism – that’s an inexact string search algorithm using q-grams as seeds
 
10:10 AM
I don't know about any other universities, but mine covered about 9999999 languages with about 1mm depth
and I think that's just wrong
 
so the OMP part wasn’t that impressive, it was the whole taken together
 
you never get past "What's the funny syntax for functions in this language again?"
 
It is wrong. Average people with no background got nothing out of it.
 
@KonradRudolph Good. We used to force templates on freshmen, and honestly, I think it's way too much abstraction for an introduction to programming.
 
@FredOverflow Yes, agreed
 
10:11 AM
@FredOverflow good for 20 secs, but then i found it a bit noisy?
 
@DeadMG At least your University acknowledges the existence of Haskell.
@CheersandhthAlf It gets smooth @ 4:40
 
The fact is, universities rarely teach you anything. Exceptions to this rule cannot be used as an argument to the contrary. Most of the work must be done by a fascinated student who is really motivated.
 
@FredOverflow Very true. A pity that we did a semester of logic first, like DeMorgan's Laws, which are utter snoozecruizes.
 
What exactly is a "snoozecruize"?
 
sigh I can't wait until I get in to university... Just a couple months and thousands of dollars away, lol.
 
10:12 AM
@DomagojPandža In fact, I question the need for their very existence, and indeed, the need for regular formal education institutes to exist.
 
The average Joe gets fucked over, but the good side is that he doesn't even know what happened. He got a degree and he's happy.
 
@FredOverflow It's something that's both beyond easy and beyond boring.
 
You use de Morgan laws, even if you don't think about it.
 
so what? I use the Standard lib, but I don't have to implement that either
 
10:14 AM
it's a conceptual no-brainer, a trivial formula you can prove with a truth table
 
@CheersandhthAlf Oh the oriental (?) part at 7:24 is really cool.
 
the kind of thing I'd copy off Wikipedia if I ever needed to use it
 
Ell
universities are of course necessary
 
@Jeremy erm. Because it's "Much harder to explain with getting in to things like namespaces, objects, static methods, overloads[1] and operator overloading"
System.Console.Out.WriteLine vs. System.Console.WriteLine;
System.Console.Out.NewLine but no System.Console.NewLine...

Why does

      using System;
      // ....
      Console.WriteLine(@"int main() { printf(""Hello world""); }"); // sic

Work, but

      static void MyOutput(string format, params object[] fmtargs)
      {
           Console.Out.WriteLine(format, fmtargs);
           // MyLogFile.WriteLine(format, fmtargs); // not relevant, just making this more realistic
           // MyLogFile.Flush();
 
@FredOverflow he he
 
10:15 AM
@DeadMG I have seen 4th semester students being completely baffled by !(a && b) == !a || !b.
 
@FredOverflow Nor are they in C#, for example see inline example ^^
@FredOverflow That would be a logic course, nothing language related
 
@FredOverflow Huh. Maybe I'm just bright.
 
@FredOverflow People are baffled by such a statement?
 
@sehe But it's very language related in the sense that students often want to repeat a loop until some condition is true, so they have to negate that expression in order to use it in a while loop. And then they screw up from time to time.
 
ah, repeat until
 
10:17 AM
@FredOverflow Sure, but you don't have to use DeMorgan's Laws to transform it. You can just leave it as !(a && b)
 
Right, but people make mistakes.
 
@FredOverflow It's kind of trivial to just do !(somecomplicatedExpression)
 
I know, but that's not how everybody does it.
 
@FredOverflow So it is a property of people, not the language
 
@FredOverflow They're more likely to make a mistake trying to transform it than by throwing parenthesis around it and chucking a ! in front.
 
10:19 AM
@EtiennedeMartel "garbage" in C++ we call "Java" or "PHP".
 
Computer science would be such a pure and beautiful field if it weren't for the people involved.
 
PHP is one of the ugliest languages I've ever seen.
 
@sehe However I am saying that there is a simpler way of introducing someone to the typical structure of a C++ program. Not that it is a simpler or more difficult task in Java\C++. I suppose writing an introductory tutorial might be more difficult in java than C++ because you have to deal with objects.
 
@DomagojPandža word!
 
@DomagojPandža We all agree with you.
 
10:20 AM
I don't.
 
the easiest way to get starred is to bash PHP or Java, and PHP is especially common
 
@sehe however in C++ you can stay away from objects, namespaces and operator overloading and still introduce the general structure and syntax (the purpose, I assume) of a hello world.
 
PHP is not one of the ugliest languages. It is the ugliest language. Even shell script with inline Perl and C is more beautiful.
 
@Jeremy Except that with printf/puts you fail that very mission: "introducing someone to the typical structure of a C++ program"
 
Now I really want C++ REPL.
 
10:21 AM
There is a C++ IDE with a REPL. I think it was Netbeans.
 
@Jeremy That's new for me. I've heard of C with classes, and it might be a half-sane option in some cases, but C++ without classes?
 
@sehe how so?
 
Without crappy IDE.
 
Because of the typical structure of C++ programs.
 
@Jeremy printf is not typical or desirable in a C++ program.
 
10:22 AM
@sehe It is perfectly possible to write interesting C++ programs without defining new classes. But you cannot write a Java application without at least one class having a main method.
 
@FredOverflow Huh. Defining new classes is not the issue here
 
I will never know what's so hard about classes.
 
@sehe I didn't mean "typical structure of a C++ program" to such a detail. Primitive applications a starter would be working would not use a class.
 
When I first started OOP, I really had no idea what the fuck was going on.
 
Jesus, if you're writing a C++ program, write C++ code. Why do people simply have to mix it with C. It's not like it's incomplete. I understand upgrading legacy code and keeping old shit, but its 2012., for crying out loud.
 
10:23 AM
Same with pointers.
 
"This is a program in C++. You'll never write it like that, but it's simpler than explaining how you will actually write programs."
 
So, in fact you start by learning C. That is viable strategy, but others exist. And you should call it just that: "Start by learning C".
Don't say it is introducing the typical structure of a C++ program
 
That's just lazy and harmful.
 
@RadekdaknokSlupik I can't remember exactly what it was like when I started OOP. The only thing I vaguely remember is thinking "Why the hell would I care about squares and triangles being geometric figures? What does that have to do with programming?"
 
I've started with Pascal records.
 
10:25 AM
@RadekdaknokSlupik (shhh. It's kind of hard to introduce program arguments without using pointers)
 
Long before I knew what the hell OOP even is.
 
@sehe So just don't use program arguments.
 
It just seemed logical.
 
@FredOverflow I was confused by a stupid tuturial that explained classes, polymorphism and friendship all at once.
 
Program arguments are so useless for a beginner.
 
Ell
10:25 AM
I have only ever known OOP
 
I really don't think you can diffrentiate C++ and C code like that. C++ added OOP components, you are saying that if you do not introduce C++ with OOP, you aren't introducing C++ but rather C. C is apart of C++ and a C introduction is just as effective, imho.
 
Ell
the first language I saw was ruby <3
 
No, don't teach C when you're teaching C++.
 
C++ is not C.
 
Don't mention C library.
 
10:26 AM
The first language I saw was C++. :(
 
Don't mention C idioms.
 
@Jeremy If you start with C, you have to declare all variables before the first statement. Eew!
 
C++ pets C on the back by allowing it to be near its grace.
 
In fact, don't mention C at all.
 
It's for legacy crap only.
 
Ell
10:26 AM
C is not a part of c++, C is a tumor on c++
 
@FredOverflow That hasn't been true for over 10 years.
I overshot.
C99 lifted that restriction.
 
@Ell C++ is the sarcophagus around the C disaster, shielding us from nasty details trying to get out.
 
Ell
Is there a way I can keep an anonymous object on the stack? as in:
{
c->KeepTheReturnedObjectOnTheStackUntilTheEndOfScope();
}
 
@CatPlusPlus Visual Studio does not support C99 :)
 
Honestly
 
10:28 AM
Who cares about VS.
It's not a C toolkit.
 
@FredOverflow it was a j/k
 
@Ell auto&& x = c->KeepTheReturnedObjectOnTheStackUntilTheEndOfScope();
 
Or just auto x = foo();
 
I really don't think printf is going to create a huge obstacle for the user when they start using cout.
 
Ell
but there is no way I can have it bound not to a variable - if you understand?
 
10:29 AM
I don't think they have to know printf even exists.
 
@Ell If you want scope bound, you need a name.
 
@Ell What do you want it bound to, if not a variable?
 
How would you access the object after that line without a name, anyway?
 
but the point of hello world isn't to introduce the cout object, namespaces or operator overloading. Neither is it to introduce printf
its not relavent
 
Ell
Its a "ScopedClip" object, it clips the canvas until it goes out of scope. You don't need to access it
 
10:30 AM
Then it needs a name.
 
TBH, I don't really see a point of hello world.
It's fine when you write it yourself, not when you explain it to someone.
 
@CatPlusPlus Well, my 'beginner-approach' would be:
int main(int argc, const char* c_args[])
{
     /*const*/ std::vector<std::string> args(c_args, c_args+argc);
}
 
Ell
It shows the person they are in command and they have control over the computer?
 
@CatPlusPlus The point of hello world is to have a minimal example (that does something) so students can get familiar with the tool chain required to compile and run programs.
 
@Ell Precisely. Important revelation and catalyst
 
10:31 AM
I'd start with syntax basics, expressions and types, then values and references, then functions, then function templates, then classes, then class templates, then standard library and stupid toolchains.
 
@sehe And how the hell are you going to explain std::vector<std::string> args(c_args, c_args+argc);?
 
I always thought it was to give users a feel of what the programming language looks like :S
 
That's why I want REPL.
So I don't have to deal with stupid toolchains.
 
@sehe By the way, I'm pretty sure that signature of main is illegal. Take away the const.
 
@CatPlusPlus ideone? :P
 
10:32 AM
20
Q: What is the proper declaration of main?

FredOverflowWhat is the proper signature of the main function in C++? What is the correct return type, and what does it mean to return a value from main? What are the allowed parameter types, and what are their meanings? Is this system-specific? Have those rules changed over time? What happens if I violate...

 
@DeadMG Can't evaluate a single expression.
 
@CatPlusPlus ah, very truecakes.
but then, in C++, arguably you couldn't do anythin with a single expression, you'd need #include Standard headers to do anything interestingg
 
@CatPlusPlus I agree, REPLs are extremely valuable for beginners.
 
user784668
@CatPlusPlus geordi?
 
Ell
What is uglier? one or two? (pastie.org/3975992 - 24 lines)
 
10:34 AM
@Ell One seems to be exception-safe.
 
I first thought that the second one was written in Lisp.
 
@FredOverflow oh. bummer. I don't like the idea of inviting UB without warning, so I prefer to use the nonstandard extension supported by all compilers I know
 
@Ell The first is hideously ugly.
 
Ell
they are both hideous
 
why don't you use method chaining?
 
Ell
10:34 AM
how do you mean? o.O
 
@sehe You try to defeat UB by using an illegal main signature? Seriously?
 
user784668
@FredOverflow Implementation-defined, not illegal.
 
Can you have a function in the global namespace called "main" that is not the main function?
 
@RadekdaknokSlupik I believe the Standard forbids overloading it.
 
10:36 AM
yes
 
@DeadMG REPL could do the scaffolding behind the scenes.
 
Ell
@DeadMG never thought of that, thanks - it looks much better
 
@Fanael Precisely (@FredOverflow)
 
@Ell I am the skilled.
 
@RadekdaknokSlupik apparently not
 
10:37 AM
extern "Haskell" would be awesome.
 
@Fanael Except without sandboxing and stuff and ran locally.
 
@Ell Also known as "fluent interface" IINM.
 
Possibly with a fancy GUI.
 
You can just configure your compiler so that main isn't the entry point. At least in visual studios you can
 
main is not the actual entry point anyway.
 
user784668
10:38 AM
@CatPlusPlus geordi runs locally, see geordi-local.
 
It's application-level entry point.
 
@FredOverflow ah cool.
 
@Fanael I could never get it to work. :(
 
Thanks for correcting me. I should've been more specific
 
@FredOverflow Sooo... You argue that using a nonstandard main signature is evil by definition, yet, you use ideone to 'prove' anything about overloads of main being allowed or not?!? Huh. Double Huh. Seriously?
 
Ell
10:39 AM
@DeadMG so do I just return a reference to the canvas on all the draw functions?
 
@Ell Give or take.
the clip ones will need to return a proxy object so that they can call EndClip in their destructors
but you can overload operator-> to make it no probs
 
@sehe Sorry, I have a fresh Linux on my computer, and I haven't installed Dropbox yet (my C++ standard is in my Dropbox).
 
@FredOverflow you can see your Dropbox files in your web browser.
 
Too late, already installing...
 
I'm off to bed. Later guys.
 
10:42 AM
@Jeremy Have fun. :Đ
 
man, I suck
4
 
@DomagojPandža How can you have fun in bed? Oh right, reading a book.
 
I have several ideas, but I'm too lazy to go and do any of them
 
@DeadMG I have the same problem regarding my room and cleaning it up.
I'm still on manual crap management.
 
10:44 AM
@FredOverflow Heh. My room is an absolute tip too, but I just don't care :P
 
@DeadMG Procrastionation to and for the people. I, too, have to work on my renderer. But I just had a hot sunday meal and I'm enjoying the aftershock.
 
@DomagojPandža I have to work on a lot more than that. I have to fix my renderer, alter my simulation, introduce many new classes, add networking and some UI components and generally do a huge refactoring
and that's just for one of my three projects I want to work on
 
You could distribute the work among coworkers.
 
just me, me, and me
 
Someday I'm gonna starve to death because I'm too lazy to cook.
Happily that day hasn't arrived yet.
 
10:46 AM
what you think of my component dependencies?
 
too many cycles
 
any specific ones?
 
Isn't one cycle already too much? ;)
 
lol
 
Damn, that's a cluster fuck :Đ
 
10:48 AM
yeah
 
Also, what exactly is a component? A class?
 
things are mostly fine but they go absolutely sideways wherever the Controller is involved
 
You're doing MVC?
 
@FredOverflow Close- some of them are groups of classes, like, the renderer factories out objects and stuff.
@FredOverflow Actually, I get the impression that my understanding of MVC is not anything like what it actually is.
 
I have no bloody idea what MVC is. (I thought I did once.)
 
10:49 AM
plus, I can't do MVC because that would make three components and I actually have four- sim, render, controller, and UI
 
Separating data, rendering and control which mediates the two.
And lots of other tiny details
Usually, most people violate the shit out of it by equalizing data with control
 
@DomagojPandža Also, my user input code is untrusted script and has to be separated from rendering
whereas normally in MVC the UI and display are the same
 
@DomagojPandža I didn't realize until now that violate and volatile are anagrams. Oh wait, they aren't :)
 
the problem is that I need some cycles
 
You can always get rid of cycles with variations of the Observer pattern.
 
10:52 AM
like, I need information from remote clients to propagate to the sim, and I also need some information from the sim to propagate to the receivers
 
Why isn’t Martinho online when I need him? Who needs stinkin’ weekends?
 
no, wait, I think I changed that
 
@KonradRudolph Do robots even have weekends?
 
They need to recharge sometimes.
 
What are weekends? :$
 
10:53 AM
good question
 
@sehe 3.6.1 § 2 states "[main] shall have a return type of type int, but otherwise its type is implementation-defined." so you were right.
 
I just love people who set rval for main to void and ask what's wrong with that.
 
I did actually represent a few dependencies that don't really exist
 
@DeadMG I don't think C++ is so great when it comes to functional programming. And without concepts, the generic department also isn't that great.
@DomagojPandža What's wrong with that is void isn't int :)
 
@FredOverflow It's not so great. But it's better than Java, and you can't learn OO in Haskell.
 
10:57 AM
@DeadMG There's an 80 page paper on OO in Haskell called "Haskell's overlooked object system", but I haven't read it yet.
 
@FredOverflow Not to mention the amount of time it would take to re-learn all the things in Haskell which you could already do in C++ non-functionally.
 
Ell
Concepts just increase the clarity of diagnostics don't they?
 
It seems that I need to employ move semantics between my body and the toilet. Excuse me.
 
@Ell No, they are also great documentation. And they help you to write correct template code without the need to instantiate it. So you get earlier error detection.
 

« first day (589 days earlier)      last day (4358 days later) »