ac1d_buRn (12-02-2010),Apoc91 (12-02-2010),freedompeace (12-02-2010),NOOB (12-02-2010),Nubzgetkillz (12-02-2010),UGodly (12-02-2010),whit (12-02-2010),why06 (12-02-2010),_Fk127_ (12-02-2010)
Hey guys,
I see a few of coders here have learn't a some what sloppy way of coding, Apoc91 made a post about this, and I have to agree with him, I don't code in C++ like most of you guys but I want to offer just a couple of small tips in general programming which has made my life easier and hopefully should make it easier for you guys..
Tips
* Name your Variables or Constants with a meaning
For example we want a integer variable, I always name it with a "i" to indicate that this variable is an integer.. example iLoop then when used in code I can see thats its a type interger, Same goes for a Dword , example dwAddress, or a boolean bOnOff, or even a string sMyString... but also remember to name it with some meaning even after you have the first letter(s) indicating what type it is.
* Name your controls with a meaning also, instead of Button1, use something like btnSendData, which you now can clearly see its a button(btn) and it sends data..
* If you use a block of code more than twice turn it into a Function or Procedure.. This will make your over all code smaller and you can use that function/procedure in your next project
* Think about faster methods that would produce the same thing..
A good example and what I have seen a lot is If.. Then...Else repeated over and over again, When a Simple Case statement(Switch in C++) would be alot more faster and easier to read..
* Take the extra time to add comments in your code, because it will help you with two things... first it will help you understand it and second if you have not worked on that project for awhile it will bring you upto speed on how you where thinking at the time you originally wrote it... Also a 3rd would be if you needed someone to check your code they wont have to spend all day trying to work out whats going.. So yes comments are a good thing to use
* Name your project files with a meaning, file1.cpp means nothing to you or anyone else but Injection.cpp would mean something and could be used later on in another project.
* Don't be scared to use multiple .cpp files (.pas files in delphi) because if you can split your functions up they might come in handy in another project and saves you time rewriting the whole function/procedure again
* Try and keep your project folder organized
* If you have a snippet in a project that you are not using anymore, save it to text file or database(lots of snippets database programs around) so you might be able to use it later without having go through the whole process of coding out again.
* If you ripp code from other projects(I seen a lot have) please try and understand the code and whats happening before you paste it into your own, this will save you the embarrassment when you come back to forum asking why your code is not working.
* Dont be ashamed if you don't know something, Belive it or not you probably know something else that one of "pro" coders doesn't know. There is no such coder any where that knows everything, So do not be shy to ask how and why(don't ask give me this give me that)..
* Come to reality and realize you wont learn to code over night, But saying that don't listen to idiots that say "Go and Learn C++" because its obvious they have no idea them selfs... just take your time and practice and you will be doing more and more advanced coding without you even realizing it.
* Last and final tip... Have fun while coding, its pointless to code if your not enjoying it, Think out side the box because coding hack for CA doesn't make you awsome........
//Edit
I just found this link to CPP style standards, I suggest reading this if you code in C++
https://geosoft.no/development/cppstyle.html
Also if you have any other useful tips of your own you would like to share, then post them up so others can benefit from your knowledge.
Last edited by Departure; 12-02-2010 at 02:43 AM.
ac1d_buRn (12-02-2010),Apoc91 (12-02-2010),freedompeace (12-02-2010),NOOB (12-02-2010),Nubzgetkillz (12-02-2010),UGodly (12-02-2010),whit (12-02-2010),why06 (12-02-2010),_Fk127_ (12-02-2010)
Love you! Repped, and...
And, "try and keep your project folder organized".. I try but stop trying almost instantly. xD
lol yeah its one of things.. we all know we should keep it organized but most of the time we don't (well for me anyway).
Just a quick tip, you could also mention that the notation you're using where you prefix names with a letter based on their datatype (e.g. szString, bOnOff, etc) is called Hungarian Notation.
Hungarian notation - Wikipedia, the free encyclopedia
Aside from that, thanked and repped! Great work =)
That's not really organised.
GOod job I agree also. THANKed/REPPED
Member since September 25, 2010
Current Objectives:
- Graduate college with a degree in Computer Science
- Find a decent job in the Computer Science Field
- Learn more programming languages
Looking for Elo Boosting Job - League of Legends
Looking for Bronze -> Gold Jobs
Skype: whatthedream
Very good thread
Everybody should read this. Will help out alot of new coders on the forum.
Member since September 25, 2010
Current Objectives:
- Graduate college with a degree in Computer Science
- Find a decent job in the Computer Science Field
- Learn more programming languages
Looking for Elo Boosting Job - League of Legends
Looking for Bronze -> Gold Jobs
Skype: whatthedream
Very Very Nice...
And you got it right theres an ego in the section where if people can semi code / leech a Combat Arms hack they Pro as shit, and i think thats bullshit
Member since September 25, 2010
Current Objectives:
- Graduate college with a degree in Computer Science
- Find a decent job in the Computer Science Field
- Learn more programming languages
Looking for Elo Boosting Job - League of Legends
Looking for Bronze -> Gold Jobs
Skype: whatthedream
Member since September 25, 2010
Current Objectives:
- Graduate college with a degree in Computer Science
- Find a decent job in the Computer Science Field
- Learn more programming languages
Looking for Elo Boosting Job - League of Legends
Looking for Bronze -> Gold Jobs
Skype: whatthedream
Finally, a smart member who DOES NOT pretend to be "The Shit." We need more people in this section like you. Thanks, +rep.
note- OMFG SOMEONE ACTUALLY KNOWS C++ HOLAY SHIIT