General tips for a beginner programmer
#1
Posted 26 January 2010 - 12:18 PM
#2
Posted 26 January 2010 - 03:30 PM
For a beginner, java will appear very complex and is also very verbose.
For example, compare these two peices of code. Both do the exact same thing.
Java
class HelloWorldApp { public static void main(String[] args) { System.out.println("Hello World!"); } }C++
#include <iostream> using namespace std; int main() { cout << "Hello World!"; return 0; }
Both use 6 lines of code, but C++ by far requires the least amount of characters. While many people say C is difficult to learn, I have found that it by far has the smallest learning curve. Combined that with the fact that C++ is far more powerful...
However, no matter which programming language you choose, remember these important points:
- Consistency. While you are learning your coding style may change over time. But once you finally find a style you are comfortable with, stick with it.
- Neatness. This goes with your coding style. Make sure you make good use of indentation and don't put too much code on one line
- Well named variables. NEVER EVER name your variable nondescript things such as 'a' and 'b', because it will make your code harder to read by yourself and others.
- Commenting. Always comment your code, even if you have no intention of sharing it. It will make your life much much easier. By using well named variables, you can reduce the amount of comments you write to a degree...
- Don't expect to program the next Microsoft Office. That will come later
Edited by Andy, 26 January 2010 - 03:31 PM.
#3
Posted 26 January 2010 - 05:07 PM
#4
Posted 26 January 2010 - 05:24 PM
#5
Posted 27 January 2010 - 01:57 PM
#6
Posted 27 January 2010 - 02:31 PM
thanks for the tips, i'm glad to know that lothers share my feeling that earning programming isn't easy. it's like learning a whole new language. just gotta keep practicing and it'll come together. thanks guys
Ill give you a hand just add me on MSN or my aim is therealdcthugs93 MSN is [email protected]
#7
Posted 27 January 2010 - 09:49 PM
#8
Posted 28 January 2010 - 03:55 AM
Not only will sticking with one language pay dividends in turns acquired knowledge (you will be able to develop relatively advanced applications, great skill to have on a resume, plus you'll be able to freelance and earn some money), but it will make learning other programming languages that much easier. For beginners, the hardest thing I've witnesses to become accustomed to is the syntax and the programming process that you have to go to (i.e. outlining your problem, and deciding how you're going to tackle it). If you picked an OOP language to start, it really will make moving on to another language about 100x easier. For example, all OOP language syntax is extremely similar. So if you learned c++, it would be easy to progress to, say Java, PHP, Actionscript, Python, etc.
A programming language is similar to an actual language, in that mastering it comes down to practice, repetition and understanding. There's no use using code that you've copy & pasted from the internet without proper understanding on what it does. So, if there's something you're unsure on, take the time to carefully read through it and ask questions.
Good luck.
#9
Posted 28 January 2010 - 04:22 AM
Edited by Andy, 28 January 2010 - 02:43 PM.
#10
Posted 28 January 2010 - 08:32 AM
#11
Posted 16 February 2010 - 05:50 AM
Java has its uses outside of android and web-based game development.kk, Try this. Abandon java. Unless you are developing for a mobile phone, and I'm not talking about the iPhone or an Android handset, do not bother with Java. While it's use for developing web applications used to be common, now java applications on the web have become somewhat annoying, unless of course it is a game or something.
For a beginner, most things will appear very complex - and verbosity is perspectiveFor a beginner, java will appear very complex and is also very verbose.
Every language has its own learning curve, but learning cannot be measured or compared between people - it's all very personable.For example, compare these two peices of code. Both do the exact same thing.
Javaclass HelloWorldApp { public static void main(String[] args) { System.out.println("Hello World!"); } }C++#include <iostream> using namespace std; int main() { cout << "Hello World!"; return 0; }
Both use 6 lines of code, but C++ by far requires the least amount of characters. While many people say C is difficult to learn, I have found that it by far has the smallest learning curve. Combined that with the fact that C++ is far more powerful...
AgreedHowever, no matter which programming language you choose, remember these important points:
- Consistency. While you are learning your coding style may change over time. But once you finally find a style you are comfortable with, stick with it.
- Neatness. This goes with your coding style. Make sure you make good use of indentation and don't put too much code on one line
To an extent. Single character variable names are acceptable when being disposed after a short period of time - ie a for loop, foreach, etc
- Well named variables. NEVER EVER name your variable nondescript things such as 'a' and 'b', because it will make your code harder to read by yourself and others.
Good code is self-documenting - to an extent. This doesn't mean you shouldn't have any need to comment your code, it means you should write code good enough to need a minimalistic amount of comments.
- Commenting. Always comment your code, even if you have no intention of sharing it. It will make your life much much easier. By using well named variables, you can reduce the amount of comments you write to a degree...
Don't program office. Contribute to OpenOffice.org
- Don't expect to program the next Microsoft Office. That will come later
I started mucking about with programming around eight years ago now, and while at the moment I'm no expert, programming is how I bring in the dosh, so I know something. From what I've seen, there are two types of amateur programmers. The jack-of-all-trades, who learn a little about a lot, and those who stick with one language for years and really nail it. I really suggest you abandon the former approach, and go with the latter.
Not only will sticking with one language pay dividends in turns acquired knowledge (you will be able to develop relatively advanced applications, great skill to have on a resume, plus you'll be able to freelance and earn some money), but it will make learning other programming languages that much easier. For beginners, the hardest thing I've witnesses to become accustomed to is the syntax and the programming process that you have to go to (i.e. outlining your problem, and deciding how you're going to tackle it). If you picked an OOP language to start, it really will make moving on to another language about 100x easier. For example, all OOP language syntax is extremely similar. So if you learned c++, it would be easy to progress to, say Java, PHP, Actionscript, Python, etc.
Agreed. Inheritance / Polymorphism / Encapsulation / Abstraction are all very generic - OOP is simply a set of guidelines that languages abide by, that make it easier for you to use, reuse and manage objects in your code easily. Think of it as a giant design pattern.
A programming language is similar to an actual language, in that mastering it comes down to practice, repetition and understanding. There's no use using code that you've copy & pasted from the internet without proper understanding on what it does. So, if there's something you're unsure on, take the time to carefully read through it and ask questions.
Good luck.
Couldn't have said it better myself.
#12
Posted 01 March 2010 - 02:19 PM
Helped me to learn bits.... Forgot it all now tho :|
#13
Posted 30 March 2010 - 12:03 PM
#14
Posted 30 March 2010 - 12:58 PM
I went from C++ to Java due to what my job requirements were and for a beginner you really won't notice that much difference between the two.
But yeah online resources help a lot.
http://java.sun.com/reference/api/ was my number 1 resource for all things java.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users