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)
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.
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.
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.
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?
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.
-wno-deprecated FTW
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.
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).
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.
Much like how I felt diving into electricity and magnetism in Physics class then I assume.
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.
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.
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.
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.)
Ugh. More code to maintain, debug and optimize makes for a grumpy programmer.
That is both unsatisfying and confusing in the context of a lecture on OOP.
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.
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.
That looks really really limited in its useability. Doesn't even support passing functions as arguments.
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.
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?
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).
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):
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
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.
And I plan to assume the fetal position in a corner, shivering uncontrollably until it all goes away.
I can't wait. Thousands of new and exciting ways of blowing your foot off, all in a neat little package.
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.
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.
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.
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
Woz: It's a C99 thing - http://www.comeaucomputing.com/techtalk/#voidmain explains the thought process relatively well (although the bit of most relevance is probably the bit entitled "Where does the int returned from main() go?")
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.