Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Server Development
Habbo Retros
Habbo Tutorials
Becoming a better programmer!
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Seriosk" data-source="post: 413097" data-attributes="member: 72056"><p>Firstly, this has been put in the <strong>Habbo</strong> Tutorials section because its focused on the development of Habbo Emulation servers.</p><p></p><p>Hello. I saw one of these a while back done by a very talented developer and I must say it inspired me to be a better developer. I wish I could say many people listened to the thread and stopped with their sloppy coding practices but they really haven't.</p><p></p><p>This is mainly focused on the C# language but a lot of it can be thought of when coding in other languages (java mainly) as many coding languages follow the same sort of learning stages and you usually hit the same sort of problems no matter what language you're programming in.</p><p></p><p>Id like to start by saying its not about features.. you could say I am quoting what I've read in the other thread but let me go into a bit more detail. Many of you throw features in and hope they'll work. You need to look at the code, how it runs, and if that's really the best way to do it. During this thread many of you will actually read the first sentence and give up.. being a really good developer takes time and you'll require love and passion for the language you're developing in, if you don't want to do it.. go and carry on coding using sloppy practices, I'm not saying this thread will make you the best developer in the world, god knows there are many better developers than me on this forum alone, but it'll give you a few pointers and set you on the right path hopefully</p><p></p><p><strong>Code Quality vs Features</strong></p><p>Features really don't matter, one of the worst attitudes I see in programming is "If it works its good programming", wrong.. that's a very bad attitude to have. You can have hundreds of features but thousands of bugs, you can fix a bug which can cause many other bugs to occur because its not used to the change and you didn't think ahead about something, sure.. beta testing and even alpha testing can cover a lot of bugs that are found but writing good quality code can eliminate so many potential bugs from the future. When I became a better developer my mess up ratio dropped by a lot, take in to consideration people will appreciate less features and better code over hundreds of more features with badly written code that is possibly broken.</p><p></p><p><strong>What are the point of Utilities?</strong></p><p>A utilities in my mind is something that is often used. Lets say we need to get a persons name for 20 forms, in programming you would store that name somewhere and refer to it when needed, that's a utility.. what many of you do which is bad practice is you store it in multiple places for multiple methods. A whole point of a utility is to store it in 1 place so that if you ever make modifications to it you'll always fix bugs that occur in ever reference to that method. I can't tell you how much bugs you skip by doing this.</p><p></p><p>I'm sorry if my explanation of utilities weren't the best, I feel like I didn't go into depth enough so here is a few others:</p><p></p><p>The utility classes are essentially presentational classes in that modify one presentational aspect of an element. These are useful because they are broadly applicable. You may apply a utility class to a variety of components. Since it isn't specific to a particular component, it isn't necessary to create it as a component modifier.</p><p></p><p>A Utility class is understood to only have static methods and be stateless. You would not create an instance of such a class.</p><p></p><p></p><p><strong>Whats the point of an Interface?</strong></p><p>A point of an interface is to declare rules for a class to follow. It's super easy to understand, say we want every class that inherits the IMethod interface to have a method called "Run" other whys it can't be part of our project and will throw an error. This is very useful in situations when you want to group multiple classes to all do something similar with the same method name. Let's say we have lots of classes that contain "athletes" we'll call them that.. and they all need a method called Start and Stop, remember an interface can contain multiple rules not just one.. but lets say the classes need IAthlete and to force two methods called Start and Stop which stop them running, that's the kind of situation where interfaces would be very useful to a project.</p><p></p><p><strong>The different between asynchronous and synchronous</strong></p><p>Heard both of these words in programming? good.. you must of been involved in some what "advanced" programming at some point then. I see a lot of developers programming and they don't even know the different between this. I get asked all the time which performs better.. in coding and programming there usually is no answer to what code runs better, its usually better its usually always different depending on the situation. I'll use a reference from google, but I'll also use my own explanation.. the reason for this is because I feel google give a good explanation that you may understand better than mine.</p><p></p><p>Synchronous and asynchronous transmissions are two different methods of transmission synchronization. Synchronous transmissions are synchronized by an external clock, while asynchronous transmissions are synchronized by special signals along the transmission medium.</p><p></p><p>My explanation... Synchronous is the weakest (in my opinion) of both words. Synchronous makes it so that events have to happen in a line, lets take for instance a line of people waiting to enter a movie threat re, the door is big enough for more than 1 at a time (so is a computer) so usually Asynchronous is the best approach. Asynchronous is where you don't have to have 1 at a time, it can overlap to more than 1 at a time. You've probably heard of something similar to this which is called multi-threading as well, I'll possibly talk some on that later.</p><p></p><p><strong>Call Stack</strong></p><p>Let's go into a humanized situation for a second. Let's say we work at a shop and we need to go to the store room to find out how many jars of Jam we have left in stock. Okay.. you're probably thinking but why? Take the below code for example</p><p></p><p>[CODE]</p><p>int jamPlus23 = 10 + 23;</p><p>int jamPlus49 = 10 + 49</p><p>[/CODE]</p><p></p><p>Can you see anything wrong with the above example? You're going back twice to check how much jars of Jam you have left, in this situation just keep in mind you have 10 jars of Jam left in stock. Why would you need to go back twice? I make this mistake and a lot of other developers do too.. languages have memory for a reason, use it.. check out the next example and see if you can see what we should of done in the first example instead of hard coding it in multiple areas, wouldn't it be a struggle if we did that a lot more and two times and wanted to change it?</p><p></p><p>[CODE]</p><p>int jamInStock = 10;</p><p>int jamPlus23 = jamInStock + 23;</p><p>int jamPlus49 = jamInStock + 49</p><p>[/CODE]</p><p></p><p>You see if a lot in Habbo emulators, take this for example:</p><p>[CODE]</p><p>string author = Program.GetServer().Author;</p><p>string version = Program.GetServer().Version;</p><p>string name = Program.GetServer().Name;</p><p>string description = Program.GetServer().Description;</p><p>[/CODE]</p><p></p><p>Wouldn't it be better to do this? otherwhys its like having to go to the back room 4 times, when you could go 1 time and save it in your mind, not your mind but the computers mind, which we call the computers memory..</p><p>[CODE]</p><p>var server = Program.GetServer();</p><p>string author = server.Author;</p><p>string version = server.Version;</p><p>string name = server.Name;</p><p>string description = server.Description;</p><p>[/CODE]</p><p></p><p>Hopefully that went in...</p><p></p><p><strong>the "Which code will run better", "Which is better?" argument</strong></p><p>Language creators put functionality inside their languages because its used for different reasons. Lets say we had two features that did the same thing in a language (not exactly the same thing, but the same ending lets say that.. we'll call these A and B. If A outperformed B then why would A exist? the logical solution would to be to remove B right? wrong.. A and B do the same thing but for different situations. Code usually does the same thing, but its near impossible to answer a question of which is better just from asking the question... you need to analyze your situation, check out the differences of both of the features and chose which one fits correctly for your project. I see this a lot in timers (System.Timers vs System.Threading.Timers) in C#, the answer is.. nobody knows until you explain your situation.</p><p></p><p><strong>A quick message to the people who "ask" for help</strong></p><p>You don't have to be a genius to be a programmer, far from it.. infact.. anyone can write programs and software if they put their head to it. I just want to say I encourage everyone to learn it as it has so many benefits, it teaches you how to think... it also gives you a great deal of independence, not just in programming. If you can't fix something usually a google search can help you out.. I'm sure out of the millions of programmers that you're not the only one who has had the issue you're having, give it a try...</p><p></p><p><strong>A few lessons I never got taught </strong></p><p>Learn the correct naming conventions for your language.</p><p>You're never the best, there is ALWAYS someone better</p><p>Never be ashamed to ask for help, everyone starts somewhere.</p><p>Don't get cocky, you're still learning..</p><p></p><p><strong>Sites/Resources for learning:</strong></p><p><a href="https://stackoverflow.com/" target="_blank">https://stackoverflow.com/</a> => Asking general questions</p><p><a href="https://codereview.stackexchange.com/" target="_blank">https://codereview.stackexchange.com/</a> => Asking for reviews on your code</p><p><a href="https://www.codeproject.com/" target="_blank">https://www.codeproject.com/</a> => Asking questions</p><p><a href="https://www.dotnetperls.com/" target="_blank">https://www.dotnetperls.com/</a> => Explaning things..</p><p></p><p><strong>Shortcuts?</strong></p><p>Hang around developers, hang out in the StackOverflow chat (chat.stackoverflow.com) where professionally trained developers talk about programming all day. They have a chat room for pretty much every language, if they don't you can always make one. I'm not saying you'll become an instantly awesome programmer, it just helps, listen to what they say, how they explain things and watch very carefully when new developers like you come into the chat to ask questions and how the developers respond.</p><p></p><p>Remember.. you can also read existing questions, most exist unless your problem is fairly unique.</p><p></p><p>There is so much more to learn and you could of possibly googled all of this but hopefully it can help a few people... I'm sorry it isn't up to the best standards but it should help a few newbies in the areas where I struggled when I started off.</p></blockquote><p></p>
[QUOTE="Seriosk, post: 413097, member: 72056"] Firstly, this has been put in the [B]Habbo[/B] Tutorials section because its focused on the development of Habbo Emulation servers. Hello. I saw one of these a while back done by a very talented developer and I must say it inspired me to be a better developer. I wish I could say many people listened to the thread and stopped with their sloppy coding practices but they really haven't. This is mainly focused on the C# language but a lot of it can be thought of when coding in other languages (java mainly) as many coding languages follow the same sort of learning stages and you usually hit the same sort of problems no matter what language you're programming in. Id like to start by saying its not about features.. you could say I am quoting what I've read in the other thread but let me go into a bit more detail. Many of you throw features in and hope they'll work. You need to look at the code, how it runs, and if that's really the best way to do it. During this thread many of you will actually read the first sentence and give up.. being a really good developer takes time and you'll require love and passion for the language you're developing in, if you don't want to do it.. go and carry on coding using sloppy practices, I'm not saying this thread will make you the best developer in the world, god knows there are many better developers than me on this forum alone, but it'll give you a few pointers and set you on the right path hopefully [B]Code Quality vs Features[/B] Features really don't matter, one of the worst attitudes I see in programming is "If it works its good programming", wrong.. that's a very bad attitude to have. You can have hundreds of features but thousands of bugs, you can fix a bug which can cause many other bugs to occur because its not used to the change and you didn't think ahead about something, sure.. beta testing and even alpha testing can cover a lot of bugs that are found but writing good quality code can eliminate so many potential bugs from the future. When I became a better developer my mess up ratio dropped by a lot, take in to consideration people will appreciate less features and better code over hundreds of more features with badly written code that is possibly broken. [B]What are the point of Utilities?[/B] A utilities in my mind is something that is often used. Lets say we need to get a persons name for 20 forms, in programming you would store that name somewhere and refer to it when needed, that's a utility.. what many of you do which is bad practice is you store it in multiple places for multiple methods. A whole point of a utility is to store it in 1 place so that if you ever make modifications to it you'll always fix bugs that occur in ever reference to that method. I can't tell you how much bugs you skip by doing this. I'm sorry if my explanation of utilities weren't the best, I feel like I didn't go into depth enough so here is a few others: The utility classes are essentially presentational classes in that modify one presentational aspect of an element. These are useful because they are broadly applicable. You may apply a utility class to a variety of components. Since it isn't specific to a particular component, it isn't necessary to create it as a component modifier. A Utility class is understood to only have static methods and be stateless. You would not create an instance of such a class. [B]Whats the point of an Interface?[/B] A point of an interface is to declare rules for a class to follow. It's super easy to understand, say we want every class that inherits the IMethod interface to have a method called "Run" other whys it can't be part of our project and will throw an error. This is very useful in situations when you want to group multiple classes to all do something similar with the same method name. Let's say we have lots of classes that contain "athletes" we'll call them that.. and they all need a method called Start and Stop, remember an interface can contain multiple rules not just one.. but lets say the classes need IAthlete and to force two methods called Start and Stop which stop them running, that's the kind of situation where interfaces would be very useful to a project. [B]The different between asynchronous and synchronous[/B] Heard both of these words in programming? good.. you must of been involved in some what "advanced" programming at some point then. I see a lot of developers programming and they don't even know the different between this. I get asked all the time which performs better.. in coding and programming there usually is no answer to what code runs better, its usually better its usually always different depending on the situation. I'll use a reference from google, but I'll also use my own explanation.. the reason for this is because I feel google give a good explanation that you may understand better than mine. Synchronous and asynchronous transmissions are two different methods of transmission synchronization. Synchronous transmissions are synchronized by an external clock, while asynchronous transmissions are synchronized by special signals along the transmission medium. My explanation... Synchronous is the weakest (in my opinion) of both words. Synchronous makes it so that events have to happen in a line, lets take for instance a line of people waiting to enter a movie threat re, the door is big enough for more than 1 at a time (so is a computer) so usually Asynchronous is the best approach. Asynchronous is where you don't have to have 1 at a time, it can overlap to more than 1 at a time. You've probably heard of something similar to this which is called multi-threading as well, I'll possibly talk some on that later. [B]Call Stack[/B] Let's go into a humanized situation for a second. Let's say we work at a shop and we need to go to the store room to find out how many jars of Jam we have left in stock. Okay.. you're probably thinking but why? Take the below code for example [CODE] int jamPlus23 = 10 + 23; int jamPlus49 = 10 + 49 [/CODE] Can you see anything wrong with the above example? You're going back twice to check how much jars of Jam you have left, in this situation just keep in mind you have 10 jars of Jam left in stock. Why would you need to go back twice? I make this mistake and a lot of other developers do too.. languages have memory for a reason, use it.. check out the next example and see if you can see what we should of done in the first example instead of hard coding it in multiple areas, wouldn't it be a struggle if we did that a lot more and two times and wanted to change it? [CODE] int jamInStock = 10; int jamPlus23 = jamInStock + 23; int jamPlus49 = jamInStock + 49 [/CODE] You see if a lot in Habbo emulators, take this for example: [CODE] string author = Program.GetServer().Author; string version = Program.GetServer().Version; string name = Program.GetServer().Name; string description = Program.GetServer().Description; [/CODE] Wouldn't it be better to do this? otherwhys its like having to go to the back room 4 times, when you could go 1 time and save it in your mind, not your mind but the computers mind, which we call the computers memory.. [CODE] var server = Program.GetServer(); string author = server.Author; string version = server.Version; string name = server.Name; string description = server.Description; [/CODE] Hopefully that went in... [B]the "Which code will run better", "Which is better?" argument[/B] Language creators put functionality inside their languages because its used for different reasons. Lets say we had two features that did the same thing in a language (not exactly the same thing, but the same ending lets say that.. we'll call these A and B. If A outperformed B then why would A exist? the logical solution would to be to remove B right? wrong.. A and B do the same thing but for different situations. Code usually does the same thing, but its near impossible to answer a question of which is better just from asking the question... you need to analyze your situation, check out the differences of both of the features and chose which one fits correctly for your project. I see this a lot in timers (System.Timers vs System.Threading.Timers) in C#, the answer is.. nobody knows until you explain your situation. [B]A quick message to the people who "ask" for help[/B] You don't have to be a genius to be a programmer, far from it.. infact.. anyone can write programs and software if they put their head to it. I just want to say I encourage everyone to learn it as it has so many benefits, it teaches you how to think... it also gives you a great deal of independence, not just in programming. If you can't fix something usually a google search can help you out.. I'm sure out of the millions of programmers that you're not the only one who has had the issue you're having, give it a try... [B]A few lessons I never got taught [/B] Learn the correct naming conventions for your language. You're never the best, there is ALWAYS someone better Never be ashamed to ask for help, everyone starts somewhere. Don't get cocky, you're still learning.. [B]Sites/Resources for learning:[/B] [URL]https://stackoverflow.com/[/URL] => Asking general questions [URL]https://codereview.stackexchange.com/[/URL] => Asking for reviews on your code [URL]https://www.codeproject.com/[/URL] => Asking questions [URL]https://www.dotnetperls.com/[/URL] => Explaning things.. [B]Shortcuts?[/B] Hang around developers, hang out in the StackOverflow chat (chat.stackoverflow.com) where professionally trained developers talk about programming all day. They have a chat room for pretty much every language, if they don't you can always make one. I'm not saying you'll become an instantly awesome programmer, it just helps, listen to what they say, how they explain things and watch very carefully when new developers like you come into the chat to ask questions and how the developers respond. Remember.. you can also read existing questions, most exist unless your problem is fairly unique. There is so much more to learn and you could of possibly googled all of this but hopefully it can help a few people... I'm sorry it isn't up to the best standards but it should help a few newbies in the areas where I struggled when I started off. [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Tutorials
Becoming a better programmer!
Top