Register | Login | |||||
Main
| Memberlist
| Active users
| ACS
| Commons
| Calendar
| Online users Ranks | FAQ | Color Chart | Photo album | IRC Chat |
| |
0 user currently in Programming. | 3 guests |
Acmlm's Board - I2 Archive - Programming - C/C++ is easier then VB | | | |
Pages: 1 2 3 | Add to favorites | "RSS" Feed | Next newer thread | Next older thread |
User | Post | ||
interdpth Rex Level: 36 Posts: 420/527 EXP: 294398 For next: 13712 Since: 03-20-04 Since last post: 10 days Last activity: 31 days |
| ||
Well I am nearly halfway done with the basic Skeleton for a map editor in C++ total API only. And I never would have been able to do this in VB in this short amount of time. What do you guys think? | |||
Dish Spiny Level: 38 Posts: 311/596 EXP: 355646 For next: 14801 Since: 03-15-04 From: Disch Since last post: 18 days Last activity: 18 days |
| ||
But of course. C has this weird stigma of being difficult or complex -- when it's really straightforward and simple. Never understood the appeal to VB. |
|||
neotransotaku Baby Mario 戻れたら、 誰も気が付く Level: 87 Posts: 2823/4016 EXP: 6220548 For next: 172226 Since: 03-15-04 From: Outside of Time/Space Since last post: 11 hours Last activity: 1 hour |
| ||
it's the concepts that give C that stigma--VB lets you get away from certain concepts (or plays it down) while C you meet them head on; plus VB allows GUIs to be laid out much faster than in C which gives it a head start off the bat... | |||
Parasyte Bullet Bill Level: 35 Posts: 390/514 EXP: 267348 For next: 12588 Since: 05-25-04 Since last post: 104 days Last activity: 32 days |
| ||
A lot of what scares people about C is how "general" it is. It's not at all specific about things like text strings, which are simple char (or short int, depending on the charset) arrays. It can be overwhelming that rather than having some specific datatype for things like text strings, you're only given a very minimal set; 8-bit, 16-bit, and 32-bit data types. Everything else just builds upon those in the form of arrays and structures (and in the case of C++, classes). In fact, this complete lack of complexity really makes the language much nicer, and far more powerful than anything like Visual Basic. |
|||
creaothceann Red Paragoomba Level: 11 Posts: 7/50 EXP: 5903 For next: 82 Since: 01-27-05 Since last post: 21 hours Last activity: 21 hours |
| ||
On a somewhat related note: What do you think of the "Boolean" type? I noticed that it was included in C# ... but don't really see the advantages. | |||
Dish Spiny Level: 38 Posts: 313/596 EXP: 355646 For next: 14801 Since: 03-15-04 From: Disch Since last post: 18 days Last activity: 18 days |
| ||
'bool' is a data type in C++ too, and I never use it. It's completely stupid. | |||
dormento Shyguy Level: 17 Posts: 87/99 EXP: 24075 For next: 668 Since: 03-15-04 From: Esteio - Brasil Since last post: 182 days Last activity: 161 days |
| ||
Most of that "c/c++ is harder than VB" crap comes from people who have a BASIC background. VB is good at making GUIs and ... that's all :p Really, the problem with VB is that it was not intended to make what most people in these boards seem to be striving for (games, multimedia, scientific stuff). None come here asking for help to setup some database with VB. Don't get me wrong, i love VB... * dodges objects thrown by Disch, Gavin, Dan and Parasyte * I i'm trying hard to get used to the C/C++ intelligent way of thinking, although i wouldn't recomend it to depressive people. VB is kinda like getting a blowjob, instant gratification. C/C++ is like that girl you get to be friend with, then marry her and build a love and caring relationship which will last the rest of your life. You'll be an 80 year old fart with heart disease, but you'll know that you can count on her, unlike that cheap prostitute. I would never ever ever ever (that's three evers) program anything that relies on fast math or io manipulation in Visual Basic. Too darn slow. For example, making game editors is fine. Making games is definitely not. Btw, why can't Visual Basic code be compiled into independent executable files, the likes of vc++, delphi etc? Couldn't you statically link OLEAUT32, MSVBVMXX etc? Or is there something i am missing? (Although i know the executable file would big quickly) (edited by dormento on 03-29-05 10:51 AM) (edited by dormento on 03-29-05 10:53 AM) (edited by dormento on 03-29-05 10:59 AM) |
|||
neotransotaku Baby Mario 戻れたら、 誰も気が付く Level: 87 Posts: 2825/4016 EXP: 6220548 For next: 172226 Since: 03-15-04 From: Outside of Time/Space Since last post: 11 hours Last activity: 1 hour |
| ||
Originally posted by DischIf you think about easier to read code (or maybe just reducing probability of bugs), it makes sense to have bool since you limit it's domain of values to be either "true" or "false". As a result, during compling you never run into the situation of giving a value that isn't "true" or "false" and possible create bugs that way by giving it some fuzzy value. But, you have a point implementation-wise, it's a waste of bits |
|||
Dish Spiny Level: 38 Posts: 314/596 EXP: 355646 For next: 14801 Since: 03-15-04 From: Disch Since last post: 18 days Last activity: 18 days |
| ||
I don't even agree with that. '1' is just as easily read as 'true'. And '0' is just as easily read as false. if( myvar ) is just as easy to read as if( myvar == true ) or if( myvar != false ) mybool = 1; is just as easy to read as mybool = true; Furthermore, there is no value that is neither true nor false. 0 is false... any other value is true. So there is no fuzzy inbetween value that could cause confusion -- it's either 0, or it's not. It's not a difficult concept once you get it, and it actually clarifies so many things and allows for more efficient coding practices. C (and C++ somewhat) pretty much completely disregards the difference between the two anyway -- unless you specifically use the bool data type. If you put any nonzero value in a conditional it will treat it as true. I can't tell you how much of a pain in the ass it would be if everytime I wanted to do bitwise checks "if(somevar & 0x04)" wouldn't be sufficient. I mean that is NOT difficult to read by any standards. Yet the bool 'easier to understand' method would be: "if( (somevar & 0x04) != 0 )". With all the bitwise checks I do in my various projects -- having to convert everything to bool form would not only be a major pain in the ass -- but it would inflate my code and make it harder to read. And don't get me started on compound statements: if( (var1 & 0x80) || (var2 & 0x40) ) versus if( ((var1 & 0x80) != 0) || ((var2 & 0x40) != 0) ) So yeah -- bool data types are useless and stupid. That's one MAJOR turnoff I had when I tried Java -- they insisted on treating them differently and making them non-interchangable. Why they decided to do that I'll never know, they must have been on crack. (edited by Disch on 03-29-05 11:41 AM) |
|||
dormento Shyguy Level: 17 Posts: 90/99 EXP: 24075 For next: 668 Since: 03-15-04 From: Esteio - Brasil Since last post: 182 days Last activity: 161 days |
| ||
(...) they must have been on crack. Caffeine actually :p But i too agree that the boolean data type is just a gimmick. It all boils down to either Zero or Non-Zero. |
|||
interdpth Rex Level: 36 Posts: 421/527 EXP: 294398 For next: 13712 Since: 03-20-04 Since last post: 10 days Last activity: 31 days |
| ||
My background was VB it took less then a 3 weeks to get on the gravy train that is C/C++ | |||
Kyoufu Kawa I'm not bad. I'm just drawn that way. Level: 70 Posts: 1381/2481 EXP: 3008456 For next: 7355 Since: 03-19-04 From: Catgirl Central Since last post: 14 hours Last activity: 13 hours |
| ||
*Kawa-oneechan prepares to dodge objects thrown by Disch, Gavin, Dan and Parasyte. If I know the game engine's logic, I can write games in VB that come very close to C in speed, with a few hoops. I'd like to refer you all to my unfortunatly dead fighting engine. Even though it was never finished, it was very very fast. On the other hand, I code my GBA in C. |
|||
neotransotaku Baby Mario 戻れたら、 誰も気が付く Level: 87 Posts: 2828/4016 EXP: 6220548 For next: 172226 Since: 03-15-04 From: Outside of Time/Space Since last post: 11 hours Last activity: 1 hour |
| ||
Disch: boolean is there to help type checking and to ensure more programs will run correctly as intended. it's true that you can do the same stuff with int but int has a whole lot of more uses than boolean--that flexibility you do not want, so a boolean is nice. So, it seems boolean is there more for enterprise programming and programming for yourself. | |||
Dish Spiny Level: 38 Posts: 315/596 EXP: 355646 For next: 14801 Since: 03-15-04 From: Disch Since last post: 18 days Last activity: 18 days |
| ||
Perhaps boolean is just too 'high level' for my tastes. I mean when you look at it through my eyes... all I'm seeing is an integer with a bunch of silly restrictions and extra rules that are not only completely unnecessary -- but also illogical. And from what I can gather it's just to help people prevent from tripping over their own code? *shrugs* Still seems stupid to me. |
|||
interdpth Rex Level: 36 Posts: 423/527 EXP: 294398 For next: 13712 Since: 03-20-04 Since last post: 10 days Last activity: 31 days |
| ||
Yeah I am with Disch I just declare an int for a flag which I can use a bool to check but it's alot easier with an int since you can have a variable ready for anything after your done. | |||
neotransotaku Baby Mario 戻れたら、 誰も気が付く Level: 87 Posts: 2831/4016 EXP: 6220548 For next: 172226 Since: 03-15-04 From: Outside of Time/Space Since last post: 11 hours Last activity: 1 hour |
| ||
That's probably it--it's very high level. After I posted, I realized that in the end, boolean in memory is no different than int in memory--since in the end, it's all the same to a CPU. as for prevent tripping over their own code, it does seem useless to someone coding for his/her own self but it makes a big difference when you are coding in projects. It's almost impossible to know the entire code down to each character as well as one person be in control of everything. Thus, the restrictions that are in place provide a mechanism for consistency and ensure code runs to specification (which is big thing) since it is easier to translate logic to boolean than it is to int because how would you explain to a customer why you are using int to do logic... all of this is important in enterprise programming--something never considered in certain convention debates... so yeah--use int if it floats your boat, no one is stopping you and people don't care unless you need to explain stuff to non-programming person |
|||
sloat Level: 16 Posts: 37/85 EXP: 18044 For next: 2212 Since: 05-21-04 From: South Central Delaware Since last post: 19 days Last activity: 5 hours |
| ||
from what i understand, false and true aren't technically supposed to be considered 0 and non-zero, respectively. Kinda like how null isn't supposed to be considered 0. But yeah, it is a high-level language dealie. (edited by sloat on 03-29-05 02:53 PM) |
|||
Parasyte Bullet Bill Level: 35 Posts: 394/514 EXP: 267348 For next: 12588 Since: 05-25-04 Since last post: 104 days Last activity: 32 days |
| ||
Eh... It doesn't take that much effort to read and understand another programmer's C code. Even the ungodly, uncommented code that many of us have seen before. (*cough* With all the programming styles between most people here, everyone will tend to see another's code as ugly. *Refrains from posting examples*) Of course, I have a generous assembly reverse engineering background, so I find RE'ing C code to be one of the easiest things to do in my spare time. But that aside, boolean variables are nothing more than char's with a little additional overhead:bool mybool = 45; is the same as char mychar = !!45; is the same as char mychar; If you don't understand; it requires a maximum of two branches to calculate the result (in all cases). Note the interesting use of the logical NOT operator... I've always thought that was clever, but it's really no better than the other two examples. Anyway, boolean variables are highly wasteful. They cause: A) 7/8 of the memory allocated for them to be unusable, and add some overhead every time they are written. Or B) Little to great amounts of wasted memory, depending on the number of boolean variables available, and even more overhead to pack the boolean variables into byte-aligned memory. Either way, boolean variables fail miserably. (edited by Parasyte on 03-29-05 03:48 PM) (edited by Parasyte on 03-29-05 03:51 PM) (edited by Parasyte on 03-29-05 03:52 PM) |
|||
Squash Monster New Age Retro Hippie Togateiru Fohku Kohgeki!! GRUNGE no HAMSTER otona bite Peace love and turnpike! Level: 40 Posts: 555/677 EXP: 430507 For next: 10802 Since: 03-15-04 From: Maryland (of the Country Between Canada and Mexico) Since last post: 5 hours Last activity: 5 hours |
| ||
And I always figured that a compiler would take your booleans and store eight to a byte and sort out the details on its own. A boolean type seems counter-productive any other way. Anyway, I think that VB is simpler than C++, but C++ is simpler to use. If that seems illogical, think of Brainfuck. That's the simplest language there is, but it gets complicated if you actually use it. VB is like being given a hammer and being told to build a house. The hammer's pretty nice, easy to wrap your head around, does its job. And then when you need to cut down a tree for more lumber, you have to turn the hammer around and hack at the tree for a few hours with the back end of the hammer. Which is still fairly simple, but it's a pain. If you were using C you'd have figured out how to use an axe or saw and not had to put up with that. So people like VB because it's easy to understand, and they can't tell that it'll end up being harder to use because it seems counter-intuitive. That and it's easier to paint the house in VB because they give you a cart of spraypaint along with the hammer, whereas in C you have to file a dozen layers of beurocracy to figure out how you're supposed to paint your house in whatever state you're in. And people like paint for some reason. |
|||
Zem You can be civil without being flowery, dipshits. Level: 49 Posts: 1003/1107 EXP: 829398 For next: 54485 Since: 06-13-04 Since last post: 131 days Last activity: 131 days |
| ||
Squash Monster wins the analogy award. |
Pages: 1 2 3 | Add to favorites | "RSS" Feed | Next newer thread | Next older thread |
Acmlm's Board - I2 Archive - Programming - C/C++ is easier then VB | | | |