[split] C++ and VB debate - Printable Version -Shoutbox (https://shoutbox.menthix.net) +-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58) +--- Forum: Skype & Technology (/forumdisplay.php?fid=9) +---- Forum: Tech Talk (/forumdisplay.php?fid=17) +----- Thread: [split] C++ and VB debate (/showthread.php?tid=31060) RE: RE: Random number generator? by TheAvenger on 09-06-2004 at 02:00 PM
quote: as a c++ programmer. I'll have to disagree with you here. The c++ seems perfectly logical and straight forward. How come you need to have some weird form_load function just to say randomize? And what is ByVal supposed to represent? int? string?... maybe bool? And where does it print the result? Does it print the result? And you actually have to DECLARE the end of the function? What a } isn't easy enough? RE: Random number generator? by CookieRevised on 09-06-2004 at 02:32 PM
quote:Not for someone who doesn't know C++... The VB one looks far more "logical" then the C++ for the inexperienced person... (and that is almost a fact; the advantage of VB above C++ is that its code is far more easy to understand then C++) Everybody without programming experience will understand Rand = Int((High - Low + 1) * Rnd) + Low faster and easier then: int random_integer = rand() cout << random_integer << endl random_integer = (rand()%10) And it seems more logical then the C++ one (although both are equaly logical) ... And that's exactly what NoName meant.... quote:You don't need that at all. It is just were NoName has put the code... Something which anybody who has a very small notion of VB knows. I can backfire this: "Why do you need some weird main() routine in C++??" quote:ByVal Low As Long ByVal means reference by value, not by name... This means when the variable "Low" is changed (Low = 5) the referenced variable isn't updated with the new value... And because of this, in the current function it isn't needed at all, since "Low" or "High" isn't updated anyways... (you should know that as you are a programmer like you said yourself ) quote:The VB one is a function... Again, anybody who has a very small notion of VB knows that that will return the number. I can even backfire this: "Where does it print the result in the C++ code???" Your response will be just the same as mine: NoName showed only the important calculation code... quote:1) there isn't anything to declare.... 2) VB doesn't use "{...}". It uses "Function... End Function", just like "If... Then... Else.... End If"..... This is a very very very basic difference between VB and C++ which almost everybody knows.... It is called a programming syntax.... I can backfire this to you: "Why do you end each line in C++ with ';'... it seems so useless, C++ isn't smart enough to reconize the end of a line or what????" I can't believe you don't know about that as you are a C++ programmer like you said, and C++ programmers are often more experienced in programming It's just the same as comparing French to English.... Furthermore, don't dish VB like that, and don't start a "VB vs. C++"-war. It's not only useless, it's even stupid, as both languages have their OWN set of codes and programming syntax. And both languages have their OWN uses and functionality.... PS: I'm not saying VB is better then C++... I'm just replying to your post, and in this case definding VB as you posted questions which cleary shows that you are either biased towards VB and/or don't know it at all... |