The online racing simulator
Microsoft Visual C++ Version 6
(75 posts, started )
#26 - wien
Quote from Shotglass :"the story of mel"

That was excellent. Thinking about code like that makes me shudder and gape in awe all at the same time.

(What's going on with teh internets today? Everything is slow as a bucket of shite, and lots of pages (and BT seeds, damn you dansus) seem to have disappeared)
Quote from wien :Oh absolutely. But not before starting to program. You need to have some basic understanding of programming before those concept will make sense. I'd much rather see this being taught alongside implementing them in some language than as pure theory.

Agreed, but a language to learn the basics shouldn't require you to learn lots of things like header files and namespaces that make no sense whatsoever when all youre code fits comfortably into the main routine. So that leads us back to Scheme which has some of the easiest syntax i have ever seen and its also largely compatible with RPN calculators from HP so thats tons of added coolness right there.
Although i have to admit that from what I've seen and read it seems like the only way to write iterations in Scheme is with tail end recursion which is probably confusing for anyone new to coding but on the other hand teaches a valuable lesson about the more sublte differences between recursions and iterations.

Quote :I just object to them being taught first.

Heh cant be as bad as what we were taught first. Our comp. sci. lessons went right for one and twos complement withing a few minutes only to go off in a completely different direction in the following lecture which was about formal grammar and infinitely long strips of paper. Thats one way to make an engineer hate anything that looks remotely like software.

Quote :I remember many of my class mates got completely fed up with programming after a couple of years of assembly and twiddling pointers in C++. They felt this wasn't relevant because they still had no idea how to make a normal, run-of-the-mill Windows application. I'm certain that if it were taught the other way around it would have been easier for them to see the relevance.

Well thats possibly correct for most comp. sci. majors. Me however, being someone who went from QBASIC in DOS right to teaching himself C, which has even more emphasis on memory management and pointers, and being someone with (limited) experience with VHDL, I tend to have a bit of a problem with the concept of variables considering that ultimately all they are are dereferenced pointers or rather, the result of MOV calls. Matlab for example, which is big in engineering, is a constant annoyance to me when it comes to passing variables between functions thanks to the lack of pointers.

Quote :but they sure help you concentrate on exactly that when you have megabytes upon megabytes of code you need to stay on top of.

But how long will it take you to get anywhere near that? More importantly what are the chances of getting there with a 70 pound CD that contains code which is wrong on every level?

Quote :Never actually tried scheme myself, so I can't comment there

If you'd like to teach yourself a little Scheme this is a great place to start: http://swiss.csail.mit.edu/cla ... abelson-sussman-lectures/
It's the original MIT introduction course for all comp. sci. students on video and a great thing to do before going to bed. Also if you've never done any functional programming it will be a real eye opener.

Quote :And if you think the current version is bad, just wait until C++0X is released.

-wno-deprecated FTW

Quote :don't show them pointers and manual memory allocation before they know the standard library by heart

Ewww... most of the time id eg. rather code my own lists instead of figuring out how to make the STL lists work the way i need them to.

Quote from wien :That was excellent. Thinking about code like that makes me shudder and gape in awe all at the same time.

Luckily theres still a few Mels around even today. Kkrunchy would probably make him proud (and shudder when he sees what a mess the x86 opcodes are).
#28 - wien
Quote from Shotglass :Agreed, but a language to learn the basics shouldn't require you to learn lots of things like header files and namespaces that make no sense whatsoever when all youre code fits comfortably into the main routine.

You don't have to teach exactly what a namespace is right away. I remember my C++ teacher just said "always put 'using namespace std;' underneath '#include <iostream>'. I won't explain why here because it's beyond the scope of this class". This will of course annoy the inquisitive mind in the back that needs to know why (me), but he will then research on his own an get smarter for it. The rest will just go "okidoki" and merrily be on their way.

Quote from Shotglass :Thats one way to make an engineer hate anything that looks remotely like software.

Much like how I felt diving into electricity and magnetism in Physics class then I assume.

Quote from Shotglass :I tend to have a bit of a problem with the concept of variables considering that ultimately all they are are dereferenced pointers or rather

Which is why C programmers generally make poor C++ programmers at first. You can use C++ as "annoying C" if you want, but that is usually not the best way to do it. Prior knowledge of C can in many cases hurt more than benefit because you have to unlearn a lot of the stuff you already know to use C++ the best way. This is only relevant if the ultimate goal is to learn to use C++ though. If your goal is more general than that (learn to program), it's not that important. I still feel learning the best way to use any given language is important though.

Quote from Shotglass :But how long will it take you to get anywhere near that?

You don't need a large project before name collisions become a problem. Say there were no namespace and you make a class to do some math with vectors. You can't just call the class "vector" because that would collide with the standard vector class (a contiguous collection of objects). Again, not really about instructing the computer, but usually people have to read the code as well, so it's beneficial for it to be readable and non-ambiguous.

Quote from Shotglass :If you'd like to teach yourself a little Scheme this is a great place to start: http://swiss.csail.mit.edu/cla ... abelson-sussman-lectures/

Thanks! I'll definitely have a look. I've meant to look deeper into functional programming for a long time. With programmers stumped as to how the hell we're supposed to take advantage of all those cores Intel and AMD seem to want us to use, functional programming is looking more and more viable in the real world because of easy automatic threading.

Quote from Shotglass :-wno-deprecated FTW

Hell no. I'm actually excited, but you really wouldn't be. (well, you'd probably approve of the new lambda expressions, but the syntax isn't the best I've seen.)

Quote from Shotglass :Ewww... most of the time id eg. rather code my own lists instead of figuring out how to make the STL lists work the way i need them to.

Ugh. More code to maintain, debug and optimize makes for a grumpy programmer.
Quote from wien :I won't explain why here because it's beyond the scope of this class

That is both unsatisfying and confusing in the context of a lecture on OOP.

Quote :You can't just call the class "vector" because that would collide with the standard vector class (a contiguous collection of objects).

Reminds me of the Project a friend of mine is doing for uni in Matlab atm. Because Matlab has tons of built in functions hes resorted to calling all of his my*. His code reads like a Learning Matlab in 21 Days example from hell.

Quote :With programmers stumped as to how the hell we're supposed to take advantage of all those cores Intel and AMD seem to want us to use, functional programming is looking more and more viable in the real world because of easy automatic threading.

That's another thing I never really understood. For a VHDL guy anything is concurrent anyway and any sort of sequential procressing is merely a figment of the coders imagination.

Quote :(well, you'd probably approve of the new lambda expressions, but the syntax isn't the best I've seen.)

That looks really really limited in its useability. Doesn't even support passing functions as arguments.
#30 - wien
Quote from Shotglass :That is both unsatisfying and confusing in the context of a lecture on OOP.

Sure. But with limited time and a language as huge as C++ you have to draw the line somewhere (which I am well aware supports your "too big, vague and complex" argument ). I still feel a subset of C++ is perfectly reasonable for teaching fresh programmers though. Specifically the STL and its data structures and algorithms can be handy when trying to teach, well data structures and algorithms. Abstract concepts first, then roll your own.

Quote from Shotglass :Because Matlab has tons of built in functions hes resorted to calling all of his my*.

Which sucks. Namespaces are at the very least more efficient prefixes. How does Scheme handle naming like this BTW? Is it even a problem there?

Quote from Shotglass :That's another thing I never really understood. For a VHDL guy anything is concurrent anyway and any sort of sequential procressing is merely a figment of the coders imagination.

Peh. You hardware people and your lies and black magics. Everyone knows a computer does everything neatly in sequence.

It's boils down to it being such a big paradigm shift really. All the abstractions we've created during the last decades have had sequential processing as a key assumption. When you throw that out the window our knowledge and tools suddenly become useless and we have to start from scratch. It'll be interesting to see what we end up having to do at the end of it. I'm afraid languages like C and C++ might be in for a rough time. Huge OS-level threads won't do when we're at hundreds or thousands of cores (which Intel has already warned us are coming).

Quote from Shotglass :That looks really really limited in its useability. Doesn't even support passing functions as arguments.

Sure it does. You can use the new "std::function" class which can wrap both lambda expressions (AKA function objects in C++) and normal function pointers. You could also just use a plain function pointer. Something like this (I'm not 100% on the syntax since there's no compiler support yet):
void display(int value)
{
std::cout << value;
}

...

[] named_lambda(std::function<void (int)> func)
{
func(3);
};
named_lambda(&display); // Prints 3

Quote from wien :How does Scheme handle naming like this BTW? Is it even a problem there?

AFAIK not at all, but then again its mostly aimed at educational use. Common LISP offers something similar to namespaces though from what I know.

Quote :Peh. You hardware people and your lies and black magics. Everyone knows a computer does everything neatly in sequence.

Which is also why x86 processors are predominantely out of order processors.

Quote :It's boils down to it being such a big paradigm shift really. All the abstractions we've created during the last decades have had sequential processing as a key assumption. When you throw that out the window our knowledge and tools suddenly become useless and we have to start from scratch. It'll be interesting to see what we end up having to do at the end of it. I'm afraid languages like C and C++ might be in for a rough time. Huge OS-level threads won't do when we're at hundreds or thousands of cores (which Intel has already warned us are coming).

I plan to watch and enjoy the carnage.

Quote :Sure it does. You can use the new "std::function" class which can wrap both lambda expressions (AKA function objects in C++) and normal function pointers.

Sounds fun.
I have sent them an email now just have to see what response they come out with. They wont be able to get around not giving me a refund because they are in Bolton and we go up there regular to visit Family as my Dad is from there so I will go and visit them in person with the disc

Well all I have to do now is wait for a response.
#34 - wien
Quote from Shotglass :Which is also why x86 processors are predominantely out of order processors.

See, that's the kind of hardware I can approve of. Just silently reshuffle my code behind my back to make it efficient instead of all this multi-threading nonsense.

Quote from Shotglass :I plan to watch and enjoy the carnage.

And I plan to assume the fetal position in a corner, shivering uncontrollably until it all goes away.

Quote from Shotglass :Sounds fun.

I can't wait. Thousands of new and exciting ways of blowing your foot off, all in a neat little package.
I have got hold of a copy of Accelerated C++ and just put the code in of:
// [I]a small C++ program[/I]
#include <iostream>

int main()
{
std::cout << "Hello, world!" << std::endl;
return 0;
}

When I go to compile it, its opens then shut really quickly, opens a command prompt, how can I get this to stay open?
Quote from sam93 :I have got hold of a copy of Accelerated C++ and just put the code in of:
// [I]a small C++ program[/I]
#include <iostream>

int main()
{
std::cout << "Hello, world!" << std::endl;
return 0;
}

When I go to compile it, its opens then shut really quickly, opens a command prompt, how can I get this to stay open?

Try this...

// a small C++ program
#include <iostream>
#include <cstdlib>

int main()
{
std::cout << "Hello, world!" << std::endl;
system("PAUSE");
return 0;
}

Or run if from a command line as a command line app is supposed to be run...
#38 - wien
Yeah. Visual Studio 7.1 or something suddenly stopped halting after running console programs. Not sure why exactly. Be aware thoug that the system("PAUSE") call isn't portable (won't necessarily run on platforms other than Windows) as it just passes the command along to the underlying shell which may or may not support a pause command.

It's fine for testing in Visual Studio though.
Ok thanks, but shouldn't this work with just using an empty project?
Will Accelerated C++ teach me how to work through this or not?

Edit: This Worked cheers:

// a small C++ program
#include <iostream>
#include <cstdlib>

int main()
{
std::cout << "Hello, world!" << std::endl;
system("PAUSE");
return 0;
}

#40 - wien
Everything works even before you add the call. The console window just closes as soon as your program has finished running. So you either add system("pause") so the "press any key to continue" thing comes up before the program finishes, or you run it from a console instead of from the IDE like pb32000 said.
Quote from wien :Everything works even before you add the call. The console window just closes as soon as your program has finished running. So you either add system("pause") so the "press any key to continue" thing comes up before the program finishes, or you run it from a console instead of from the IDE like pb32000 said.

Ok cheers I will take this into account, all I can do from here is go forward and finish the bloody book lol, I'll just refer here if I come into problems.
#42 - wien
Sounds like a plan. Remember to make sure you've read and understood everything before moving on to the next chapters though. The book progresses rather quickly so if you just skip ahead you'll regret it later.
Just got a reply from Apex Web Media and they have said they can only give me a refund if I have had the product for under 2 months. Also they said they should stick to the Amazon Returns Policy even though they sell the product on their own website.

Quote :
Hello
Really we should stick to Amazons own terms and conditions on software returns, they prevent us from refunding against software, a copy of the Amazon terms and can seen here: http://www.amazon.co.uk/gp/hel ... play.html?nodeId=13036701.

However if you you purchased this in the last 2 months post this back I will invoke a refund and state that the product was unopened. Returns are only available via post and you should return this to:

Apex Web Media
Returns
PO Box 398
Bolton
BL7 9YS.

To qualify for this refund you should send the product back in the next 7 days, you will also have to include a printed copy of your Amazon invoice.

Thanks

I have sent them an email saying that I have had the product for about 5-6months and forgot about it and remembered about it a couple of days ago and I no longer have the invoice and stating that I still want a refund and is this possible, if they dont give me one I can visit them in person, that way I get to speak to the manager aswell
What the hell do you get with these tutorials? As that's a LOT of money for something you could do for free pretty effectively.
#46 - Woz
Sorry but I have to ask, Since when has void main() not been valid. void main() is valid no matter what, main does not NEED to return anything.

It might be "more correct" in ansi C++ but no less valid.
#48 - wien
#49 - Woz
Quote from wien :No.

Shows the last time I really worked in C++, I am more C# nowdays.

Cant understand why void main() was blocked though tbh. It it is required for any bootstrap/startup could it could just handle void main() {} as the same as int main() { return 0; }. Just a bit too anal.

Probably why I moved to c#, to avoid the baggage C++ carries with it. C# really is a far nicer language, all the benefits of C++ without all the crap that was layered over it.
I think it will be best to get a refund wouldn't it?

Could people post some useful links to learn C++ and C# please, I am changing my mind and getting the £70 back, could spend it on something worth the money.

Microsoft Visual C++ Version 6
(75 posts, started )
FGED GREDG RDFGDR GSFDG