ow my head

Started by
14 comments, last by superpig 16 years, 1 month ago
Quote:Original post by Darragh
Quote:Original post by shadowisadog
C++ is a LOT harder of a language than Python. If you got confused with Python than what makes you think that C++ is a better choice? O_o.


I can see where he's coming from actually. I've been programming in C/C++ for about 4 years now and recently I started learning Ruby, which in many ways is quite similar to Python or Perl. One of the main difficulites I found during my time working with Ruby was that sometimes I could write a statement and not know exactly what it was doing; the language is so high level that it's sometimes difficult to determine exactly what the effect of each statement is. It's always a decidedly dodgy business when you start writing code and you're not even sure what it is doing IMHO!


Very true. I have programmed in C++ for over six years but I have recently started to move to higher level languages because work demanded it. My main point is that C++ is a much more confusing language for a novice to start with. When I started programming I actually used QBasic and some other now extinct languages to learn the basics and only later did I decide to make the leap to C++. C++ has a lot of undefined behaviors and if you don't know how to work with pointers you can cause a lot of memory leaks and crashes very quickly.

[Edited by - shadowisadog on March 3, 2008 12:39:45 PM]
Advertisement
Quote:Original post by shadowisadog
C++ has a lot of undefined behaviors and if you don't know how to work with pointers you can cause a lot of memory leaks and crashes very quickly.


Indeed. Like I'm sure there are lot's of people out there with a good working knowledge of the language who might even be confused by statements such as these:

// ? void _cdecl blah();void _stdcall blah2();// ? :)void blah2( void * p ){   ((void(*)())(p))();}


Things like that you just don't see the books on C++ and it's rife in some of the code you will come across on the net.
Quote:Original post by superpig
Quote:Original post by TheUnbeliever
A dictionary provides a 1:1 mapping (a bijection) from a set of keys to a set of values (in much the same way as its real-world namesake does – the word in a real-world dictionary is the key, and the definition the value).


Er, really? Every key maps to a unique value, and it's therefore possible to get from the value back to the key?


Oops. No. It'd be a surjection, not a bijection (right?).

My apologies.
[TheUnbeliever]
Quote:Original post by superpig
Quote:Original post by TheUnbeliever
A dictionary provides a 1:1 mapping (a bijection) from a set of keys to a set of values (in much the same way as its real-world namesake does – the word in a real-world dictionary is the key, and the definition the value).


Er, really? Every key maps to a unique value, and it's therefore possible to get from the value back to the key?


For reference. The mapping is a surjection: you can repeat values, and the mapping is therefore not reversible (unless you avoid repeating values manually, and reverse the mapping yourself).
Woo,

Well im getting into this python thing ive done hello worlds, and getting me to input my name. It was deffinatly the book i was looking at.

Well now ill not be revisiting this thread as it seems to have spiraled out into things i dont know about.

Well here i go into the breach.

o/

Brian.
Quote:Original post by Zahlman
Quote:Original post by superpig
Quote:Original post by TheUnbeliever
A dictionary provides a 1:1 mapping (a bijection) from a set of keys to a set of values (in much the same way as its real-world namesake does – the word in a real-world dictionary is the key, and the definition the value).


Er, really? Every key maps to a unique value, and it's therefore possible to get from the value back to the key?


For reference. The mapping is a surjection: you can repeat values, and the mapping is therefore not reversible (unless you avoid repeating values manually, and reverse the mapping yourself).


Well, no; it's neither injective (one-to-one) nor surjective (covering every possible target value). It's just a mapping.

Richard "Superpig" Fine - saving pigs from untimely fates - Microsoft DirectX MVP 2006/2007/2008/2009
"Shaders are not meant to do everything. Of course you can try to use it for everything, but it's like playing football using cabbage." - MickeyMouse

This topic is closed to new replies.

Advertisement