• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Another question for beginners

 
Author
Posts: 160
11
Android Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What do you find most difficult about learning Java? (... or ... Think about the things that you currently use for learning Java. In what ways are they most lacking?)
 
Bartender
Posts: 10780
71
Hibernate Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Barry Burd wrote:What do you find most difficult about learning Java? (... or ... Think about the things that you currently use for learning Java. In what ways are they most lacking?)


I'm not really a beginner, but I can certainly tell you the thing that was lacking in my reading/training: Teaching you how to think 'objectively'.

I'd been a procedural programmer for more than 15 years when I was introduced to OOP (via C++ in about 1992; then Java in 2001), but I didn't have my 'Eureka' moment until about 2007 (if you're interested, you can read about it here).

It doesn't stop people from writing decent Java programs, but I find that quite a lot of our time here is spent guiding beginners away from just writing procedures; and it's something that I still have to be on guard about myself.

I think some basic examples of "good" and "bad" OOP implementations might help a lot of beginners get over the 'objective hump'.

My 2¢

Winston
 
Marshal
Posts: 79177
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Agree with Winston. I think this applies particularly to people who have used procedural languages in the past; they have great difficulty getting to create and use objects.
 
Bartender
Posts: 1952
7
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When I was first taught Java I had some difficulty grasping the concept of objects and how they relate to classes.
All we were given were the less than helpful "definitions" that a class was something that encapsulates state and behavior and an object was a instance of a class.
Right. Come again? I had some difficulty differentiation between the two, and how those static bits of source code would behave at runtime. Were they classes, were they objects? How do they interact? I was pretty lost, until it finally "clicked".
 
Winston Gutkowski
Bartender
Posts: 10780
71
Hibernate Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jelle Klap wrote:Were they classes, were they objects? How do they interact?


And the last of those was always my problem. I could never "see" a problem from the object's point-of-view because I was always hung up on the procedure.

Just one of the reasons I wrote the WhatNotHow page.

Winston
 
Ranch Hand
Posts: 31
Android Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Barry Burd wrote:What do you find most difficult about learning Java? (... or ... Think about the things that you currently use for learning Java. In what ways are they most lacking?)


I'm still kinda new with learning Java, but I found it difficult to learn Java when there not always a lot of clear examples to learn from.
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Berry,

My hard part is learning how to start a program, the 1st lines of code.

I think that is my spot that blocks me from learning how to write code.

Not sure if this is normal but that is me.
 
Ranch Hand
Posts: 64
4
Eclipse IDE C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Finley Burke wrote:Berry,

My hard part is learning how to start a program, the 1st lines of code.

I think that is my spot that blocks me from learning how to write code.

Not sure if this is normal but that is me.


I've always thought it would be a good idea to, during the beginning stages, to ignore the class and function headers for the moment and focus on learning things like int's and float's and how to do maths and the logic behind what they're doing, but there are always those who want to learn more and get all curious.
 
Winston Gutkowski
Bartender
Posts: 10780
71
Hibernate Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Finley Burke wrote:My hard part is learning how to start a program, the 1st lines of code.
I think that is my spot that blocks me from learning how to write code.
Not sure if this is normal but that is me.


I think it's perfectly normal, but can you tell us what it is about it that you find so difficult? Is it the class/method declarations, and all the qualifiers like public, private, static and final; or is it the code itself (ie, how to solve the problem with code)?

If it's the latter, then I'd definitely advise writing down the steps in English (or your native language) first. Programs don't just write themselves, and unless you understand how to solve a problem yourself, you will never be able to write a good program to do it for you.

Unfortunately, at the start, books and classes (in my opinion) often get you writing code before you've actually thought through the process. They may describe it to you afterwards, but once you get beyond "Hello World" and a few other very basic programs, you need to be thinking about what to do before you write any code.

Writing it down first can also help you to break down the problem into pieces (a very important part of programming) which you can then put into methods, so that your main() method simply becomes a list of "commands" or "tasks", viz:rather than a pile of "logical vomit". You'll probably also find that it makes things much more readable.

(Just FYI, the above is an example of IPO - short for "Input-Process-Output" - a model that still holds true for a lot of programs after 40 years, which is when I was first taught it ).

You may find the StopCoding (←click→) and WhatNotHow pages worth reading; and also MainIsAPain.

And don't worry, it'll come in time. Just remember: Think first; then code.

HIH

Winston
 
Campbell Ritchie
Marshal
Posts: 79177
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
[back to some earlier posts]
Since so many of us had difficulty getting the notion of objects into our thick skulls, at what stage does the book introduce objects, and does it cover things like encapsulation and single responsibility?
 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello.
I'm new to Java, started learning this year just from online tutorials and trying to read the documentation and fiddling around with stuff.
For me I think the hardest part, well not hard but the thing I think is slowing me down is not having any problems to create solutions to. Not seeing enough real world code. Only getting snippets and toy code that shows the way a particular feature works but not a way in which you would integrate it into an actual piece of software.

My main goal is to learn how to program games. Yes yes I know C++ is the standard but I see Java knocking it down from its pedestal where frankly I think it's outdated and overrated and riddled with issues that Java has taken care of. Also because I think Android is here to stay and I'd like to get into that market.
So basically I have no idea how to go about creating a game in Java. I know it's about libraries and learning to use them. But of course all the basics need to be learned first.
What I'd like to see is something that teaches Java from a game programmers perspective. Much like Game Institute do with C++
 
Barry Burd
Author
Posts: 160
11
Android Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In the book, I take great care to describe the relationship between a class and its objects -- an idea that beginners find very difficult. (This material comes up in Chapter 7 -- about a third of the way through the book.)

 
Winston Gutkowski
Bartender
Posts: 10780
71
Hibernate Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Miles Williams wrote:So basically I have no idea how to go about creating a game in Java. I know it's about libraries and learning to use them. But of course all the basics need to be learned first.
What I'd like to see is something that teaches Java from a game programmers perspective. Much like Game Institute do with C++


I don't want to preempt anything Barry might have to say on the subject but, as a bloke who detests "visual" programming with a passion, who has nevertheless designed some reasonable GUI (and webby) apps, my advice to you would be to separate the game from the display as soon as you possibly can.

To create a game (IMO) you need two things: An understanding of how it's played; and a good idea of how to display it and interact with the user.

For the first, you need a good knowledge of basic Java: objects, classes, collections, and how to make them work together for you. For the latter, you need to understand how visual components work and have a bit of "the artist" in you (and that's where I fall down BADLY). Unfortunately, to get to that, you need some basics too.

There may well be courses out there tailored for 'gamers' or GUI-hounds, but don't expect to be able to just jump in, because there's a lot to know before you get to that stage.

The same is true of programs involving communications. I've seen lots of questions from beginners who say: "I want to program a chat room". Well, I've been using Java for 13 years and programming for 35+, and I've never taken on a task like that. It's just too big and too complex; and I've never had the 6 months it would probably take me to complete it.

Small steps...

Winston
 
Miles Williams
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Winston.
I have a basic understanding of programming using object oriented principles. I have been programming in various languages for the last 20 years on and off. First just playing around in BASIC then a little lisp. Stopped for a while then got back into it again with visual basic 6. Then moved into VB.NET and then Python, C++ and finally Java.
I only have an intermediate understanding at most in a few languages like VB and only a beginner in all others.
Java is by far my favourite of them all. But as for having an understanding of the basics I'm rather clued in on most things. Looping, access control, Classes, objects, Inheritance, polymorphism, generics, enums, hashes, containers, simple event driven Frameworks and exceptions. Where I'm lacking is IO, networking, concurrency and graphics and obviously all the more advanced concepts like refactoring code and profiling.
But MOST of all what I am lacking is the knowledge of how to tie all these concepts together and create anything greater than a simple event driven GUI.
I think it comes down to not having enough experience solving problems. But as I said that's because I don't have any problems to solve. Also not being exposed to enough "real world" code.
As I said though I would like to see something that focuses on teaching Java that is specific to games. The only Java game programming book I've seen was a little beyond my level at that time. O'Reillys Killer Game Programming in Java. From memory it has some sort of cat on the cover like a lynx or something.
 
Winston Gutkowski
Bartender
Posts: 10780
71
Hibernate Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Miles Williams wrote:As I said though I would like to see something that focuses on teaching Java that is specific to games.


I presume you're talking about the "interactive" kind; and I'm afraid that I'm simply not qualified to answer.

I suspect, however, that there are some universal components (like "sprites") that pervade all manner of games like this; not to mention other generic concepts like Players, Characters, Capabilities, Energy and Skill levels. However, I'm waay out of my depth here.

The only Java game programming book I've seen was a little beyond my level at that time. O'Reillys Killer Game Programming in Java. From memory it has some sort of cat on the cover like a lynx or something.


Well, O'Reilly are a pretty darn good publisher, so it still might be worth buying. No idea of any others though, because it's just not my field.

HIH

Winston
 
reply
    Bookmark Topic Watch Topic
  • New Topic