Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.
This is the best book to learn Java:

"Head First Java" by Kathy Sierra and Bert Bates, O'Reilly, ISBN 0-596-00920-8.

You do NOT need an IDE and you should NOT overload yourself by trying to learn Java AND a compley IDE like Netbeans or eclipse or - horror! - Xcode. Just as Kathy Sierra recommends, a simple text editor (e.g. jEdit, TextWrangler or BBEdit) and the Mac's Terminal window will be sufficient.

Java is already complex enough, so keep everything as simple as possible.

Just buy ONE book and stick to the Java command line tools and your text editor while you work your way through that book. And it might be a good idea to stay away from Internet forums while you're studying that book -- it will only confuse you more instead of helping you get anywhere.

I can second that book for Java.

I'm not using it myself. but my friend says its a very good book.
 
Oh, I understand now. Thanks. I probably would have needed to keep reminding myself that, in C, an array's first element's subscript will be zero. Why not write a C compiler that will make the computer generate code for array-bound checking when a compiler directive tells it to do that? Then, after you know that your program is correct, you recompile it with the array-bound checking turned off.
In C an array is just a block of memory, no bounds checking, no memory protection (at the language level). He's probably talking about something like:
Code:
#define SIZE 10
int array[SIZE];
int i;
for (i=0; i<=SIZE; ++i)
  array[i] = 0;
You can see that the "int i" is probably stored in memory immediately after the array.
 
Oh, I understand now. Thanks. I probably would have needed to keep reminding myself that, in C, an array's first element's subscript will be zero. Why not write a C compiler that will make the computer generate code for array-bound checking when a compiler directive tells it to do that? Then, after you know that your program is correct, you recompile it with the array-bound checking turned off.
gcc, for example, does have a bounds check option. It's usually wrong to assume nobody's ever thought of basic things like this. However, C is highly dependent on pointers and aliasing, this is C's strength and weakness. To write a completely correct bounds checker for all possibilities would be an extremely complicated task, you should try it and soon you'll find out why.
 
gcc, for example, does have a bounds check option. It's usually wrong to assume nobody's ever thought of basic things like this. However, C is highly dependent on pointers and aliasing, this is C's strength and weakness. To write a completely correct bounds checker for all possibilities would be an extremely complicated task, you should try it and soon you'll find out why.

It is, in fact, impossible. If you could make a perfect bounds checker on compile time you could solve the halting problem, which is proven unsolvable.
 
It is, in fact, impossible. If you could make a perfect bounds checker on compile time you could solve the halting problem, which is proven unsolvable.
Is it equivalent? Well since actual programs run on actual physical machine which are not infinite theoretical machines, then the halting problem is solvable. Ha! Okay, so it's so intractable that it's not doable for any meaningful program.
 
This is the best book to learn Java:

"Head First Java" by Kathy Sierra and Bert Bates, O'Reilly, ISBN 0-596-00920-8.

+1 for the Head First books.

They are an EXCELLENT series.
There is also one called "Head First Design Patterns" which is a great book for learning more about OOP.
 
Is it equivalent?

Actually, I think I jumped the gun a bit on that one. I am however, pretty sure that the problem is undecidable but that's more from intuition than proof (and the fact that nobody is doing it).

Well since actual programs run on actual physical machine which are not infinite theoretical machines, then the halting problem is solvable. Ha!

You are obviously completely right :)
 
Wow

I read all the threads by newcomers in programing being new here myself. Haven't programed since my basic, turbo pascal and VB days but starting again since going apple. This is a great thread. Most just say buy this book or that one. Tks everyone.
 
You are obviously completely right :)
Can I keep that quote and trot it out later? It sounds useful. Actually when you get up into some of the the theoretical mumbo-jumbo I don't really pay much attention. My intuition says similar things as yours. If you're writing, for example, a library function and don't have access to the global program then it's got to be impossible. Both for that function, and for the program accessing it, you need to know about both simultaneously. That would be sort of like a potentially infinite machine.

Is this on topic? Oh yeah, the guy wanted to learn Java, but now it turns out he doesn't really want to learn Java necessarily. Hey guy! Pick something and bang your head against it for a while. If you don't think it's working for you, try something else. But don't do 2 things at once, especially not Eclipse or something like that. Get lots of sleep. Keep pestering people with questions. But not questions where you haven't tried to figure it out yourself first, at least a little bit. There's so much quality free stuff out there, especially in the programming area, that you can do this without any out of pocket expense (except for the computer). That's my advice.
 
No, thanks. I can write a compiler, but I doubt that I can write a completely correct bounds checker. I'm not that talented.
gcc, for example, does have a bounds check option. It's usually wrong to assume nobody's ever thought of basic things like this. However, C is highly dependent on pointers and aliasing, this is C's strength and weakness. To write a completely correct bounds checker for all possibilities would be an extremely complicated task, you should try it and soon you'll find out why.
 
No, thanks. I can write a compiler, but I doubt that I can write a completely correct bounds checker. I'm not that talented.
I see you're up at 3am on Saturday night, that's proof right there you're a programmer. If you don't have confidence in your abilities, who will? :D
 
I'm usually up then, but the computer is easy to ignore when there's a book nearby. If I need to choose between reading and poking the keyboard, my computer will be bored or lonely. :) I am a programmer, though. I was just thinking that, if writing a bounds-checker for C is as difficult as solving the halting problem, I don't want to try to write that checker. I've never liked any C-like programming language. So I probably couldn't motivate myself to write a C compiler. I do have confidence in some of my abilities, just not in my ability to write a completely correct bounds-checker for a C compiler.

Ya wanna know a real programmer? A friend of mine double-majored in computer science and electrical engineering, holds two jobs where he does computer work, and keeps about 35 computers humming happily together in his basement. I asked why he owned that many. He said, "It's my hobby."
I see you're up at 3am on Saturday night, that's proof right there you're a programmer. If you don't have confidence in your abilities, who will? :D
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.