• Post Reply Bookmark Topic Watch Topic
  • New Topic

What's wrong with me?  RSS feed

 
Daniel Christopher O'Connell
Greenhorn
Posts: 4
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hopefully this is in the right section if not... oops

I have a problem i have completed the oracle java associate and java programmer and i understand java well what i know of it inheritance,swing,objects,encapsulation etc but when it comes to writing the code in eclipse i just pull blanks but when i see code i have no problem reading or understanding. am i just not good at java or programming in general.
Any ideas on what might make me better at this ? or is the problem way bigger and i am just in the wrong sector because i love computers and find it interesting how everything runs so its not like im learning java for no reason or for the sake of it. my intention is to hopefully make android apps and got some experience of android sdk while on my last course.


Thanks ;D
 
Mike. J. Thompson
Bartender
Posts: 689
17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It doesn't mean that you are bad at programming. It means that you don't yet have the experience to know that writing good software doesn't just happen with no thought.

I've been a professional software engineer for nearly 10 years now and I rarely just sit down and code. Even when it might look like that is what I do, in reality I had probably spent a few days thinking about that bit of software. If I try and write software with absolutely no thought then more often than not I will have to start over when I realise I failed to consider everything.

The best way to get good at writing software is to get a lot of experience doing it, and have your code reviewed by people that are better than you.
 
Campbell Ritchie
Marshal
Posts: 56595
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

How much practice have you actually had? I am not sure that the exams will actually teach you programming.
 
Knute Snortum
Sheriff
Posts: 4288
127
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You might want to try Head First Java. It's a good book to get you started programming.
 
Daniel Christopher O'Connell
Greenhorn
Posts: 4
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i passed both exams but they are multiple choice questions and require no programming so i was mainly studying the books im not too sure what it was called will try find that out.
The only coding i did was a few exercises on the course like how to get something working but its stringing it all together and making something at home is where i am having difficulty perhaps i want to be a awesome programmer overnight and i know that wont happen but atm it seems like im just crap started back in august at this.
Hopefully there is some tutorials or exercises that would help me the toughest thing i did on the course was a caesar zyphr but once you write it down on paper solving it aint too hard
i think i have a scanned version of head first java on my dropbox not too sure if its an old version, the book i am using currently is sams teach yourself java in 24hours its ok but not the best and sometimes goes off topic.
Thanks for the replies ;D
 
Campbell Ritchie
Marshal
Posts: 56595
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I personally don't like the SAMS book. It didn't get a good review here. There is another opinion about learning programming in 24 hours here.
You need lots of practice writing code. If you write something and post it here, rest assured we shall tell you in no uncertain terms if we think the code is no good
 
Steve Luke
Bartender
Posts: 4181
22
IntelliJ IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Daniel Christopher O'Connell wrote:the toughest thing i did on the course was a caesar zyphr but once you write it down on paper solving it aint too hard

Exactly! The toughest part of a program is the not-coding-until-you-know-exactly-what-you-need-to-do part. More planning on paper makes it easier.
 
Knute Snortum
Sheriff
Posts: 4288
127
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
O'Reilly has a bunch of other books to choose from.
 
Daniel Christopher O'Connell
Greenhorn
Posts: 4
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Once again thanks for the replies, I will check out those links.
I guess now that i think of it practice makes perfect so if i keep reading and practicing i should get better will post if i have any problems with code... i will have probems :P
i was just more worried about am i doing the wrong thing and should i just change to a software tester or something which i really dont wanna do i wanna code. Then the other problem i'm having is how to know when im ready to work in a java job cause i've seen some ads locally and they say 3+ experience just for junior positions and usually require something like c++ and some other stuff other than java.


 
Rico Felix
Ranch Hand
Posts: 411
5
IntelliJ IDE Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Some advice from a new-comer as yourself is this...

See computer programming as only three simple steps which are:
  • Taking in some form of input from a source
  • Processing the input
  • Providing results from the processed input


  • This is commonly referred to as the IPO model (Input)(Processing)(Output)... what this does is take a general problem statement and break it up into these distinctive parts... It is only after this step has been completed should you turn to a programming language to implement your solution. Emphasizing on the point it means you must first know what is the type of input you are dealing with and where it is coming from, what processing needs to be done to get the desired results and where the output of this result is to be directed (either to the user's screen, to a file on the disk, over a network connection, etc).

    Programming a computer system is not about a programming language... a programming language is just a tool which you use to build/implement your crafty designed solution to the problem you are trying to solve... So in the initial stage of your project forget about Java, C, C++, Ruby and all the rest of programming languages and focus on the algorithms and data-structures so that when you finally head over to the computer to perform your magic it all flows freely...

    Every time you decide to approach a programming project by first going to the computer to start typing always remember a builder will never just go on a piece of land and just start knocking up pieces of wood and laying down blocks arbitrarily expecting to end up with a solid, beautiful structure... s/he must firstly acquire a detailed plan to work with.
     
    Jayesh A Lalwani
    Rancher
    Posts: 2762
    32
    Eclipse IDE Spring Tomcat Server
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    The method that has always worked for me is anthromorphization

    Back when I was a wee one, my dadda got a book for me that was an introduction to computers. It showed a basic architecture of coputers. Except that instead of blocks, it showed each component as a little gnome. There was the chief gnome who was the CPU. Another gnome who was the hard drive, and so on. That got me thinking of the computer program as a bunch of gnomes sitting there doing some work

    Think of it as you have couple of gnomes sitting there ready to do your bidding, and you need to get something done. But remember the gnomes are stupid. They would rather do the same thing over and over again, and they don;t like to figure stuff out. They like to be told what exactly should be done. They are gnomes, not people. So, what seems elmentary to you isn't elementary to them. Make it a story, or a play out of this

    So, for example, let's say you had a program that reads a file, does some processing and writing it to the database. You could have gnome do all this work, but he would complain because he has to keep doing this differrent things. So, you get 3 gnomes, one to read a file, one to process the data and one to write to database. Now, you make a play, out of this, and you are the director and you have to tell each gnome what to do, So, you would do something like

    a) Gnome A open the file
    b) Gnome C open the database
    c) Gnome A read a record and give it to Gnome B
    d) GNome B process the record using this rules, and give the data to Gnome C
    e) Gnome C write the record to the database
    f) repeat the process c- e until you run out or records

    THere, you got your algorithm right there! And you didn;t even need to fire up the IDE

    You do this enough times, and the gnomes will take up permanent residence in your head, and you will be figuring out how you can make the gnomes do everything
     
    Madhav Turangi
    Greenhorn
    Posts: 16
    1
    Eclipse IDE Java
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Practice...Practice...Practice and more Practice is what builds confidence. If you can read and understand a Java program, then pick a program and think how different it can be coded and attempt to tweak the program. For example, if you have a program that adds two int numbers.

    There are various things that can be changed (for practice).

  • Make this addition a reusable code, by moving the addition into a separate method.

  • Can I simplify the print statement, yes there is printf method that uses Formatter (if remember the java exam objectives)
    Try it.. might not work first time, don't panic, have a look at material, ask for help and attempt to get it right.
  • Can I use add method to add pairs of numbers, say 5 pairs of numbers, then think of how can these 5 pairs be created. Various ways,
    can use arrays or can use Collections. Try with each.
  • Hang on a minute, this is not a proper object oriented code. Try to change it by adding instance variables and change static add() method to non-static.
    Now create object in main method and call instance method.


  • This can go on... walking into new avenues of coding.

    This is a simple example I took. Based on your comfort level, pick code blocks and keep tweaking. Always keep asking yourself questions when you look at a piece of code like "what if I change ....", "how different it can done..."

    Let your mind rock with thoughts and put them into code, however simple or meaningless they could be, try it to see for yourself the outcome. Happy, pat yourself and keep moving. Not happy, a challenge to achieve, do not stop. If all your attempts fail, you can always post for help here in Ranch.

    To the least surprise, you could soon be writing meaningful software... Goodluck !

     
    Shivom Shukla
    Ranch Hand
    Posts: 77
    Eclipse IDE Java Tomcat Server
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Hi Daniel,

    Welcome to the Ranch!!

    My view is you need to stop reading code and moving on but ACTUALLY WRITE CODE. The thing is java is like Mathematics, you need to literally write code to actually start coding. As in case of Mathematics, you do not just read problems and but actually solve them by writing them down ;) Same is the case with our beloved java, its true if you read code you understand it,but this leads to a bad habbit of not writing code and you slowly loose a hands-on on java.

    So start writing ....NOW!!

    All the best,
    Shivom
     
    Campbell Ritchie
    Marshal
    Posts: 56595
    172
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    I would suggest that the adding numbers example should be refactored to reduce the main method to its correct size: one statement. And that example does not show two statements.
    A similar example: design an immutable class called IntSwapper whose constructor and getXXX methods allow you simply to swap two numbers. Put i and j in and get j and i back.
     
    Daniel Christopher O'Connell
    Greenhorn
    Posts: 4
    Android Eclipse IDE Java
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Okie dokies will keep at the ole java and will hope for the best thanks for all the replies ;)
     
    fred rosenberger
    lowercase baba
    Bartender
    Posts: 12565
    49
    Chrome Java Linux
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    also...remember that writing code isn't easy. The same way that painting a picture isn't easy, or dancing the lead in Swan Lake, or performing a magic act in Vegas...

    Anybody can do any of those things poorly...but to be good at it, you have to practice. You have to learn good habits. You need to show what you are doing to others, and accept their critiques.

    I've been a professional for 15 years, and I am still learning new stuff every day. But for me, that is a big part of what makes it fun and interesting.
     
    sai rama krishna
    Ranch Hand
    Posts: 536
    1
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    I think most of the people in java would have thought atleast once why am in java/j2ee field, how much more practice i need to do, how much more new things coming in. When can i say i know most of the java j2ee related technoligies. On top of all that life happens and less time available to catch up on new technologies
     
    sai rama krishna
    Ranch Hand
    Posts: 536
    1
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    so each gnome is separate java class right based on the algorithm?

    Can any business realtime scenario can be considered as IPO model?


    "what if I change ....", "how different it can done..." some times when viewing some code say production code or some code to which we do not have access to change or test ourselves how to apply this step?
     
    Knute Snortum
    Sheriff
    Posts: 4288
    127
    Chrome Eclipse IDE Java Postgres Database VI Editor
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    There are companies like Catalyst IT Sesrvices that will train you and then hire you for a two year commitment. (If you do go to Catalyst, mention my name, Knute Snortum.)
     
    Madhav Turangi
    Greenhorn
    Posts: 16
    1
    Eclipse IDE Java
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    sai rama krishna wrote:so each gnome is separate java class right based on the algorithm?

    Can any business realtime scenario can be considered as IPO model?


    Yes, any scenario can be considered, any piece of code (may it be 1 line or few lines or bigger) does something with some data. That data which is used to do whatever it does is input, what it does is process and the result is output. This can be applied to as simple as adding two numbers to any bigger scenario.

    sai rama krishna wrote:
    "what if I change ....", "how different it can done..." some times when viewing some code say production code or some code to which we do not have access to change or test ourselves how to apply this step?


    This is said particularly in response to what is asked by OP. In simple, it is not possible to apply this to the code to which there is no access.

    There are some extreme technologies that work by intercepting and manipulating the code at runtime, which can be used in desperation (or sometimes by design). Then the input (I) would be "the compiled code for which there is no access to source code", the process (P) would be to "intercept and modify the executable code before it is executed by runtime" and the output (O) would be the modified executable code with the intended changes applied.
    I think it is a bit too much for the subject of this thread.
     
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!