Author Topic: Started java.  (Read 1381 times)

0 Members and 1 Guest are viewing this topic.

Offline thecompgame

  • /dev/null
  • *
  • Posts: 11
  • Cookies: 0
    • View Profile
Started java.
« on: July 29, 2011, 07:16:57 pm »
I just started java today, and iv gotten to Variables so far(i know wdf this dudes a noob) but im hoping to finish this course from this dude http://www.youtube.com/user/thenewboston#p/c/FE2CE09D83EE3E28/9/iMeaovDbgkQ in a week or so...
But i was wondering when will i actually get to the point where ill be able to make stuff in java that's useless and not just for the sake of learning.
Thanks :P

Offline petermlm

  • Knight
  • **
  • Posts: 226
  • Cookies: 7
  • Information is Power
    • View Profile
    • Security Check
Re: Started java.
« Reply #1 on: July 30, 2011, 01:08:26 am »
I just started java today, and iv gotten to Variables so far(i know wdf this dudes a noob) but im hoping to finish this course from this dude http://www.youtube.com/user/thenewboston#p/c/FE2CE09D83EE3E28/9/iMeaovDbgkQ in a week or so...
But i was wondering when will i actually get to the point where ill be able to make stuff in java that's useless and not just for the sake of learning.
Thanks :P

I remember asking my self the same question, lol. You see, knowing a programming language like Java, and I mean knowing the syntax of the most common thinks used in that language is, in fact, just the beginning. You seem to already know that, lol.

After this there is no clear path like: "now learn how to do this, later that and Boom, you can do cool stuff.". You may take various points of interest like network programming (although this is a little advance for someone who got out of the basics.), graphical user interface programming (make a program with windows and widgets), graphic programming (like a program that draws graphics in the screen, or a game), working with databases (this requires you to learn to work with a databases), etc.

These examples are very scattered and not very linear, I know. But what I am trying to say is that you are always going to be learning. Every time you take a project or there is something you would like to try, there is a big probability that you are going to use some think that is new to you. For example. Suppose that after learning the basics of Java you are going to start learning how to make graphical user interfaces. Then you are now going to have to learn how to use Java libraries to program user interfaces, and with that there may be new concept that you never heard of, but you will have to do some research about these matter until your objective is complete.

In the end, remember that doing something that is actually useful may be some think that is not very complicated and doesn't take must coding. Like doing a simple simple algorithm that decrypts/encrypts a rot13 cypher.

I hope a shed some light on you doubt.

Offline thecompgame

  • /dev/null
  • *
  • Posts: 11
  • Cookies: 0
    • View Profile
Re: Started java.
« Reply #2 on: July 30, 2011, 04:21:04 am »
Thanks for the info :) I  plan on taking 1-2 months for java only then once i think im pretty comfortable with java ill move onto C or visual basic.

xor

  • Guest
Re: Started java.
« Reply #3 on: July 30, 2011, 05:37:33 am »

As with all programming languages starting with the syntax is always your best bet, so you're on the right track. Once you know the basics, all you really then need is a point of reference and you can code in any language.


Get the following things down pat and you should be alright:


1. Syntax


All languages have specific word orders in order to achieve the same result. Java and C for example declare the variable TYPE first and then the descriptor/name for the variable. Visual Basic declares the variable descriptor/name FIRST and then the variable type. Where as you have other languages which don't have to define a type for the variable at all, it's decided what type to make it once it's interpreted, a good example of this is PHP.


2. Variables / Variable Types


Learn the variable types. Most languages have similar base types for variables called PRIMITIVES. Then there are other variable types which are system or user defined called OBJECTS. You'll get more into objects later as you progress. Where most languages have the same set of primitives, there are some languages which have their own custom types, C and c++ for example have char where as there's no real alternative for this in Java. One important thing to take note of when becoming an efficient programmer is choosing the right variable for the job.


For example, you may think that an integer just another variable to hold a number, and while you would be right, each data type has a limit on the amount of bytes it takes up, and thus the amount of data it can hold. So if you only ever needed to hold a number that's 2 digits long and doesn't use floating points, you'd never need to use a long, or a double or a float. So choosing the right size variable and type of variable can be important. Most programmers don't care and will choose the biggest one because memory is so readily available these days, and you can choose which programmer you want to be, but when dealing with shellcodes etc you want the smallest possible footprint.


Variable sizes and limits are largely dependent on the language you are using and the platform you are running on (x86 x64), and there are plenty of references on line to find out which language takes up how much space and what data it can hold. Here's an example:


Edit: example removed, because tables aren't working properly on the board? Need to get that fixed. See below.



Source: http://www.cplusplus.com/doc/tutorial/variables/


3. Loops


There are only a few, but it's important to use the right one to be classified as a good programmer. In general here is the rule I follow.


Do you know when the loop is going to end?
 - YES (use a for loop), e.g.


Code: [Select]
   for (int i=0; i<10; i++) {
      // loop for 10 iterations only.
   }

  for (initialization; termination; increment) { statement(s) }


 - NO (use a while loop), e.g.


Code: [Select]
   while (unknown_condition == false) {
       // do some work until unknown_condition == true
   }


These loops in general are available in all languages interpreted or compiled so you will definitely need to get used to using them. Some languages also have a foreach or for each loop which can be used to iterate1 through a collection of objects. If you ever need to use one, I'm sure one of us will be willing to help you if you can't figure out how to use it properly.

4. ...Profit?


Nah I dunno, at the moment I can't think of anything else although I'm sure there is for the basics, I'll add more in if I think of any later, but basically. If you get those steps down and just play around with the language, you'll eventually get the point where you can knock something together that actually does something. It takes some time, but believe me, it's damned fun once you get the hang of it.




Any questions, post here, or you can find most of us on the IRC.


(SSL - recommended ) irc.evilzone.org port 6697 or 9999, channel #evilzone. See you there :)

-- xor


1. Iteration means the act of repeating a process usually with the aim of approaching a desired goal or target or result... http://en.wikipedia.org/wiki/Iteration
« Last Edit: July 30, 2011, 05:52:38 am by xor »

Offline Flikka

  • Banned leecher
  • Peasant
  • *
  • Posts: 56
  • Cookies: -65527
  • Life isn't fair. We all learn it the hard way.
    • View Profile
Re: Started java.
« Reply #4 on: July 31, 2011, 04:12:53 am »
I was lookin' over the eBooks and i found this.


http://evilzone.org/ebooks/shitload-of-for-dummies-books/


Download it :P


This is one of its books that you might like...


Beginning Java Programming for Dummies, 2nd (2005).pdf
My name is:
01000110 01101100 01101001 01101011 01101011 01100001