![]() |
Not logged in, Join Here! or Log In Below:
|
|
Hey, remember me? The Platformisis guy? I recently killed that project because it was so poorly implemented. I took some advice and fixed up my programming. I began developing this game where you catch flys. You are a walking hotdog that attempts to get its revenge on a fly for trying to lay on it. I find the game to be funny. This game is not done yet but I have managed to implement some important things such as graphics processing, a resource compiler, and some of the OS backends that will allow the game to run. I'm probably about 60% done with the game at this point but I need some input from you. Can you find anything that I need to improve? I haven't compiled much of the game yet so are there any errors that you found? I would greatly appreciate this. I just set up a site for the project. So you can find it at http://www.geocities.com/hitthefly |
|
> I recently killed that project because it was so poorly implemented. |
|
Just Curious. |
|
You didn't understand what I said. I want you to look at the game. I make very few syntactical mystakes. Most of the mystakes I get are symantical. Just take a look at the code and tell me if you notice anything weird. I'm not asking you to compile the code. Right now you can only compile the resource compiler and that sould compile on just about anything that calls itself a c++ compiler. |
|
What does that have to do with anything? How old are you? |
|
I said I was curious! |
|
So you want me to comment on style and structuring of your code ? That's ok, and I had a look. |
|
As Chris said, there are things that really don't look very good. a sample:
That has a bug (StringSize will _only_ be used if it is equal to DontKnow). That's made harder to see because of the single-line layout. In any case, you should use something like: ---8
be better implemented like this:
---8
is error-prone at best. Much better is to do something like this: Also, it is generally regarded as much better to declare variables at the point they are used. I also prefer to keep them within the scope where they are used, and to remove comments that don't add anything to the meaning of the code itself, so... ---8 |
|
why do you use C++ when you're not doing anything in an object oriented fashion ? All the non-member functions, global variables, it's getting nasty whenever a project grows over a thousand lines. |
|
Then we can learn from eachother. I can teach you to write good comments and you teach me good C++ programming. I looooooooooooooooooove macros! My whole philosophy in programming revolves around the macro. I don't want to get rid of them. Thanks for the advice on globals and other parts of programming. Perhaps you can rewrite some of the code for me? |
|
But what if you want register variables in your program? |
|
I'm young. Very young but not a kid. I'm sort of a little bit beyond the teen years. Actually I'm 22 but do I act like it? No way! I act like I'm 16. |
|
Register variables ? Variables that the compiler holds in CPU registers, or what ? It never does that with globals. |
|
Macros are evil, let you be told that. There is no philosophy to be found in using macros, and by your over-use of them you'll not be looked at as a good coder. |
|
why do you ask for comments and then stubbornly refute that your obsessively rediculous coding style(or lack thereof) is better? i am an amateur coder myself, but even i know your coding blows, and you are delerous in your ambitions. learn to write a decent "helloworld" before you attempt some inevitably doomed project. |
|
Now, that also IS a way to express it. I deliberately tried to be a bit more careful, but it's good to see some straight words. |
|
THAT GRAPHICS CODE IS CRAZY, DID YOU EVEN TEST IT YET? |
|
How is it crazy? Be more specific. |
|
Yoda-style wisdom: |
|
YOU WILL SEE ONCE YOU TRY IT OUT FOR THE FIRST TIME. |
|
I know that my coding style might be bad but I'm happy with it and it's pretty readable to me. I looooooooooove macros. I understand them better than enums or typedefs. In fact this is where I am strongest in C++. You sound very negative and pissed. Why? Everyone has their own way of coding and being the newbie that you are you have no right to judge my coding style. Could you do better? You probably don't even know what a macro is. So before you go storm at me the way you did just think about what you are saying. I did take some advice from people but I have learned something valuable. No matter how you code people will always dind something wrong with the way you code. So I have learned to take people's advice but to a certain extent. There is a point where I draw the line and that ppoint concerns macros. I really did not want people to comment on the coding style so much. I just wanted people to look at the game itself and maybe catch bugs. Why do people always go for the code??? |
|
This still doesn't help. What is wrong with the code? If nothing is wrong then why should I change it? I want to use my own stuff not someone else's. And, no, YOU'RE NOT BRIAN FELLOWS! |
|
I know how to use templates. Macros are not bad if you truely understand them. Most people hate them because they don't code them right. I'll give you an example. Take this piece of code:
I think many programmers are full of themselves but they don't realize this. The constructs of the language is not bad. It's how you use them. I personally think not putting curlies around single statements is a bad style. But look, when I put the curlies the syntax error went away. Lots of hype from programmers about not using macros but they just want the easy way out. I like macros and that's the one thing in C++ that I understand the most. They're not evil like you said. |
|
Object oriented programming is useful in some circumstances but when it comes to po pure unrelated function calls it's just a pain. I use both C and C++ coding. What can I say that's my coding style. |
|
Tragically you've just proved that;
Which doesn't even compile, and your "fix" expands to;
Which also doesn't compile. If I assume you meant
Then that compiles, but the 'else' is still 'attached' to the inner (macro expanded) if. What you probably meant, for your "fixed" macro was;
Yuck! At least make it obvious that your macros are macros, and not functions or variables, e.g. make them all upper case. |
|
The first and most important stage of learning is to be aware that there's something to learn. I have gone through that with comments. Now I just need to catch myself (or be caught) when I'm not doing it right, and fix it until it becomes second nature. Practice, practice, practice. I'm on it. :-) |
|
Just for your information, macros aren't exactly C++. |
|
Bit early in the year for trolls to come out of hibernation, isn't it? |
|
Francois, your macro obsession, including your example, is just plain ridiculous. And you're not accepting advice, just like you didn't in you last post. I'm sorry to say that you're not yet in the position to tell us anything about good coding style and pratice. |
|
Maybe is just Masochist or plain Hard Headed. |
|
|


