• Post Reply Bookmark Topic Watch Topic
  • New Topic

Finished java book, what to do next?  RSS feed

 
Brian Tkatch
Bartender
Posts: 598
26
Linux Notepad Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Warning, i'm going to ramble a bit here. The question is to help me get my thoughts straight.

A while back i asked where to learn java and settled on Schildt's book. I read it slower than i would have liked, but being disappointing with the first two books, it's somewhat understandably that i lost stream. I typed in all the examples, did all the self-tests, except for some of the later code questions. I found the typing quite helpful, and using notepad, javac, and java probably taught me more than i realize. In any case, i just finished it, and am wondering what to do next.

One idea is to read the O'reilly book (mentioned in the other thread). Not to type stuff in, but to get the ideas. A second time, a second approach. lots of history and stuff. It ought to be a good review if it doesn't mix me up. Though it'll hold off coding, maybe. I'm leaning toward doing this if only to make back the cost of the book and justify my original decision to purchase it. :P Actually, i enjoyed reading the first chapters the first time around because of the explanations and history.

Ultimately, i'm learning java to code for the Android, and a decent understanding of the basics is probably a good idea. But how stable does that basis need to me? Can i just jump into Android right now, or should i play around a bit more to solidify the little that i actually know?

Another interesting thing is the Leap Motion. I have one attached to my mac, and java would code for it. OTOH, it's probably too advanced for me. Though coding for the mac might be fun.

I think i got it out now. I just finished and am just tossing everything around, whether it makes sense or not. But what should i do next before i make my millions on Android apps?

 
Campbell Ritchie
Marshal
Posts: 56221
171
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Brian Tkatch wrote:Warning, i'm going to ramble a bit here.
Everybody else rambles on this forum, so make yourself at home.
. . . using notepad, javac, and java probably taught me more than i realize.
Notepad? Repeat the exercises with Notepad++ or some other decent text editor and you will see how much better it goes.
. . . .
One idea is to read the O'reilly book (mentioned in the other thread). . . .
Which O'Reilly book?
Ultimately, i'm learning java to code for the Android, . . . Can i just jump into Android right now, or should i play around a bit more to solidify the little that i actually know? . . .
Probably not, no. I hear that Android is different from simple Java®. Find yourself an Android tutorial. Play around making little Android apps. You may need to learn JavaFX to go with the Android; I don't know. You will probably have to learn some sort of GUI framework for Android.

What do you know about Streams and λs? Or LocalDate as against Calendar? Or Optional<T>?
 
Brian Tkatch
Bartender
Posts: 598
26
Linux Notepad Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Campbell Ritchie wrote:Notepad? Repeat the exercises with Notepad++ or some other decent text editor and you will see how much better it goes.


Heh. I specifically avoided that (i used Notepad++ for comparisons though) in order to learn everything the hard way. Eventually, an editor will make it easier, with completion and the like. Though, i have my own style for formatting and i like to do formatting myself anyway. I know this from SQL, where the auto tabbing messes up my frame of mind. For SQL, i actually prefer Notepad! There are some things i just have to do myself.

Which O'Reilly book?


Learning Java

Probably not, no. I hear that Android is different from simple Java®. Find yourself an Android tutorial. Play around making little Android apps. You may need to learn JavaFX to go with the Android; I don't know. You will probably have to learn some sort of GUI framework for Android.


I understand that much. I just wanted to know Java first. So, by jumping into Android, i mean read about it and move on from the basic Java i have now. Sorry for not being so clear.

What do you know about Streams and λs? Or LocalDate as against Calendar? Or Optional<T>?

He covered Streams, Lambdas, and Generics. No LocalDate or Calendar though. And, while i have some experience typing them in and answering the self-tests, i'm going to need more if i want to know them well.
 
Winston Gutkowski
Bartender
Posts: 10574
65
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Brian Tkatch wrote:I understand that much. I just wanted to know Java first. So, by jumping into Android, i mean read about it and move on from the basic Java i have now.

OK, but I'd make sure that you really do know your basic Java first - and that took me about a year, YMMV.

The Android JVM is not the same as the one you're used to programming with, and I suspect is likely to be at least one version behind Oracle's, so don't expect to be able to use all those fancy lambdas and streams that everyone's buzzing about here, because they may not be available to you (but again, I really don't know). I think it's also burnt in with the OS, so the version you get may well depend on the OS release.

Personally, I've always found O'Reilly books to be pretty good, so if you can find one of them about Android it might be a good place to start. Otherwise Google is your friend.

Winston
 
Brian Tkatch
Bartender
Posts: 598
26
Linux Notepad Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Winston Gutkowski wrote:
Brian Tkatch wrote:OK, but I'd make sure that you really do know your basic Java first - and that took me about a year, YMMV.


That's what i meant to say in my post. To garner opinions on the matter.
 
Winston Gutkowski
Bartender
Posts: 10574
65
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Brian Tkatch wrote:That's what i meant to say in my post. To garner opinions on the matter.

I should add that I was already a veteran programmer, with experience of both C and C++ (which are where Java gets its syntax structure from), so the "look" wasn't unfamiliar.

However, I was also brought up with procedural languages, so maybe it took me a bit longer than it would someone else.

Winston
 
Campbell Ritchie
Marshal
Posts: 56221
171
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That O'Reilly book appears to have been printed in 2013 so it probably wouldn't cover the newer aspects of Java8. For suggestions for books which will bring you up to speed with Java8, go through our Java8 forum and search for thread titles beginning “Welcome …”. Have a look at the books which people have won there.
 
Brian Tkatch
Bartender
Posts: 598
26
Linux Notepad Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Winston Gutkowski wrote:
Brian Tkatch wrote:That's what i meant to say in my post. To garner opinions on the matter.

I should add that I was already a veteran programmer, with experience of both C and C++ (which are where Java gets its syntax structure from), so the "look" wasn't unfamiliar.

However, I was also brought up with procedural languages, so maybe it took me a bit longer than it would someone else.

Winston


Interesting point. I have a background in other higher level languages, but am no stranger to the structure. I learned both c and c++ to some degree, but never needed them, nor cared to code past samples in them. For the past number of years i have been mainly in SQL. Java seems okay, though i take issue with the naming scheme and reliance on catching exceptions (which, in the SQL world, many consider consider poor practice.) I think all i need now is practice. The question is (it evolves with this thread, i guess ), in my mind, should i practice before i jump into Android, or just get it while coding for it. (And, do i use too many commas when writing posts.)
 
Campbell Ritchie
Marshal
Posts: 56221
171
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, the number of commas looks correct.
There is an object‑oriented paradigm and it takes time to learn. That is what Winston meant earlier.
Do you suffer Exceptions in SQL? The idea behind catching Exceptions is that it allows your program to keep running and recover from errors or at least close down gracefully, though there is much controversy about that point.
 
Brian Tkatch
Bartender
Posts: 598
26
Linux Notepad Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Campbell Ritchie wrote:No, the number of commas looks correct.
There is an object‑oriented paradigm and it takes time to learn. That is what Winston meant earlier.
Do you suffer Exceptions in SQL? The idea behind catching Exceptions is that it allows your program to keep running and recover from errors or at least close down gracefully, though there is much controversy about that point.


FWIW, i see tables as objects and records as instantiations of those objects.

I almost never use exceptions in SQL. An exception means something was unexpected, why would i want to magically handle it? (It should be captured before the user sees it though, to report the error.)

A couple years ago i came across this gem:


Anyway... i understand java is different, in that it uses exceptions to report errors, like a second pipe outside the data stream. That makes it better, but i still don't like it. You know, if they called it Error and removed the redundancy from the names (_exception) i probably wouldn't hate it as much.


 
Winston Gutkowski
Bartender
Posts: 10574
65
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Brian Tkatch wrote:For the past number of years i have been mainly in SQL. Java seems okay, though i take issue with the naming scheme and reliance on catching exceptions (which, in the SQL world, many consider consider poor practice.)

And rightly so, AFAIR. Trying to compare a data-directed language like SQL with a procedural (based) one like Java is really comparing apples with oranges. A Java program is much more like an SQL cursor with an attached procedure - although even that analogy breaks down on many levels.

As an example: One of the things that drives most programming bods like me nuts is: "Give me the top 10 ten students/companies/players in <whatever>".

Not only does SQL not intrinsically allow you to get the "top 10" of any result set; where it has been added to the language, database implementers can't agree on a syntax for it, requiring you to look up "Rosetta Stone" websites to find out how to do it for a particular platform.

In a procedural language it's simple: get the candidates; sort 'em as required; list the first 10. And that applies to all sorts of other things, such as getting the first 10 cards off a "shuffled" deck.

As you may deduce, I'm not a huge fan of SQL - even though I was a DBA for 10 years - but I do understand that both languages have their place. I guess I just prefer telling the language what to do, rather than having it tell me.

Winston
 
Brian Tkatch
Bartender
Posts: 598
26
Linux Notepad Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Winston Gutkowski wrote:As an example: One of the things that drives most programming bods like me nuts is: "Give me the top 10 ten students/companies/players in <whatever>".

Not only does SQL not intrinsically allow you to get the "top 10" of any result set; where it has been added to the language, database implementers can't agree on a syntax for it, requiring you to look up "Rosetta Stone" websites to find out how to do it for a particular platform.


That's not entirely true. Although SQL Server and others have a TOP keyword, almost all languages support rownum, if only through the analytical function ROW_NUMBER(). So, basically, there are two ways that should always work. rownum for the cheapie implementations, and ROW_NUMBER() for the real ones. Regardless, it can always be done by tediously using UNION ALLs.

The point you seem to be making is: SQL is made for sets of data whereas procedural coding is not. We can certainly agree on that.
 
Winston Gutkowski
Bartender
Posts: 10574
65
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Brian Tkatch wrote:Regardless, it can always be done by tediously using UNION ALLs.

Could you give an example? I remember UNION, but not UNION ALL.

But you're right. At the end of the day, it comes down to what you're used to; and as an applications programmer I'm quite happy with functional "what" logic (WhatNotHow; and also the new stream and lambda syntax in Java v8), but I don't like data-directed "what".

Winston
 
Brian Tkatch
Bartender
Posts: 598
26
Linux Notepad Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Winston Gutkowski wrote:
Brian Tkatch wrote:Regardless, it can always be done by tediously using UNION ALLs.

Could you give an example? I remember UNION, but not UNION ALL.

But you're right. At the end of the day, it comes down to what you're used to; and as an applications programmer I'm quite happy with the functional "what" (WhatNotHow; and also the new stream and lambda syntax in Java v8), but I don't like data-directed "what".

Winston


UNION should not be used unless you know you need it. It should have been named UNION DISTINCT (as opposed to UNION ALL.) What was going through their minds, i don't know.

Here's a quick example to demonstrate the difference between UNION and UNION ALL. In lieu of a real table, i will use a CTE (common table expression.) I am doing this on Oracle, so i will use Dual. To run this on SQL Server, just remove the "FROM Dual" part.
CTEs (except recursive ones) can just as well be in the FROM clause (albeit without column names.)



'UNION' NAME
--------- -------------
UNION Brian
UNION Campbell
UNION Winston
DIVIDER -------------
UNION ALL Winston
UNION ALL Campbell
UNION ALL Winston
UNION ALL Brian

8 rows selected.


Note that UNION applied a DISTINCT and 'Winston' is only reported once. UNION ALL does less and stick to just being a UNION.

Anyway, for an example of top 10, we'll get the top 3 names by year in this liddell example. The example is purposefully simplistic, the query is repetitive, and there are many ways to do it:



NAME
--------------------
Edward Harry
Lorina Charlotte
James Arthur Charles


 
Winston Gutkowski
Bartender
Posts: 10574
65
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Brian Tkatch wrote:Here's a quick example to demonstrate the difference between UNION and UNION ALL.
..
for an example of top 10..

Woof. I suspect I'll be at this for a while, but in the meantime, have a Cow. And thanks.

However, I say again: "top 10" is not intrinsic to a data-directed language (especially one ringfenced by Boolean logic), but it's the sort of thing that turns up in the real world all the time.

And that's why I'm quite happy for SQL to harness my data, but NOT what I want to do with it.

Winston
 
Brian Tkatch
Bartender
Posts: 598
26
Linux Notepad Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Winston Gutkowski wrote:
Brian Tkatch wrote:Here's a quick example to demonstrate the difference between UNION and UNION ALL.
..
for an example of top 10..

Woof. I suspect I'll be at this for a while, but in the meantime, have a Cow. And thanks.

However, I say again: "top 10" is not intrinsic to a data-directed language (especially one ringfenced by Boolean logic), but it's the sort of thing that turns up in the real world all the time.

And that's why I'm quite happy for SQL to harness my data, but NOT what I want to do with it.

Winston


Cow! Moooooooof!

BTW, i realized right after i wrote the example, UNION ALL is not even required there. Just need WHERE Year > the not min() not min(). I used UNION ALL because i was trying to prove it could be done, because of my original statement. It may be needed in other cases, but not this one.

The example can be shown step by step, if you'd like.
 
Winston Gutkowski
Bartender
Posts: 10574
65
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Brian Tkatch wrote:The example can be shown step by step, if you'd like.

Thanks, but I think I'd prefer to clank through it myself - probably tomorrow, as I need to get me din-dins and watch some reruns now (Brit TV).

If I run into trouble, I'll shout ... and thanks again.

Winston
 
Campbell Ritchie
Marshal
Posts: 56221
171
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My, this question has got difficult. It can go to another forum.
 
Brian Tkatch
Bartender
Posts: 598
26
Linux Notepad Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Campbell Ritchie wrote:My, this question has got difficult. It can go to another forum.


Heh. I wasn't sure where to post it in the first place. But, maybe some more people here will read the first message and give me some advice.
 
Campbell Ritchie
Marshal
Posts: 56221
171
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It was perfectly all right when it started. The questions became more difficult later.
 
Winston Gutkowski
Bartender
Posts: 10574
65
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Campbell Ritchie wrote:It was perfectly all right when it started. The questions became more difficult later.

@Brian: Yeah, my fault. I kind of went off at a tangent. Sorry about that.

Winston
 
Campbell Ritchie
Marshal
Posts: 56221
171
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What's wrong with going off at tangents?
 
Brian Tkatch
Bartender
Posts: 598
26
Linux Notepad Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Campbell Ritchie wrote:What's wrong with going off at tangents?


I'm terrible at geometry.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!