Beginning Java Objects
Coming to Java from ColdFusion and ASP has been a long and arduous journey. Those languages lack the strong typing, the formal structure, and the incredible power that Java offers. In the course of grappling with concepts completely foreign to those languages, I have purchased and read many books. I've read Thinking in Java, Java: How to Program, and Java in a Nutshell, all in a futile effort to learn the language in a systematic and useful way. Each book came up short in the teaching department: one covered Java too abstractly, another too concretely. Reading these books' turgid style was a surefire turn-off to the language. After a while, I realized that the problem wasn't totally with me -- that these books were not designed for newcomers to the language.
I then came across two books that changed my view of Java introductory texts completely. Both Beginning Java Objects (hereafter BJO) and Head First Java (hereafter HFJ) take beginner-centric approaches to instruction. They both seem to understand that reading computer language overviews is a necessary evil and that most books fail to connect with their readers. They both take active roles in guiding the reader through Java, though their executions are wildly different.
Two Different Styles The fundamental difference between the two books is teaching style: they're both obviously the products of serious pedagogical thought. BJO's pedagogical considerations are understated, while HFJ's are explicit and pronounced. BJO moves the reader from start to finish on a single project, introducing Java syntax and language elements as needed and largely in the final third of the book. HFJ, on the other hand, divides major topics into smaller units interspersed with pictures, diagrams, and tables in order to break up the monotony.The effect of BJO is that each chapter builds on the previous one, thus discouraging browsing through the book haphazardly. This was the first computer book that I have read cover-to-cover, though it took me forever to get through at over 650 pages. It starts with an introduction to objects and object-oriented programming. This first section gets you thinking about the concept of objects, gradually working in the seeds of the book's example project, so that you're thinking about what objects you'll eventually need. The second part involves modeling those objects you deemed necessary in the first part using UML. It's by no means a complete guide to UML, but the author wants you to realize that UML is a vital part of the design phase.
The final part introduces the majority of Java syntax and focuses on implementing those objects you've modeled. First, the author works on a command-line version of a university registration system using the file system to persist data. Finally, she implements a GUI version using Swing that still uses the file system.
HFJ, on the other hand, reads like a computer book version of Alton Brown's cooking show Good Eats. Syntax lessons share the pages with funny anecdotes, cartoonish diagrams, silly exercises, and sidebars of various kinds. Some of the jokes and visual aids will make you groan, but they are, by and large, helpful and not too lighthearted. At first, the style seems like a gimmick but you quickly lose that sense of novelty. The book is organized around 17 topics that the authors think are important. Each chapter only marginally builds on the previous, so skipping around is both possible and suggested. The topics range from the common (objects, polymorphism) to the rare (RMI, sockets, exceptions). There's also an appendix that covers briefly 10 items that didn't quite make the cut for the book but were too important to leave out entirely. If I had to characterize HFJ's teaching style, I would describe it as visual.
Which is Better? So they have different styles, which one should you buy? I think that if you have to choose one or the other, you need to evaluate your learning style. Think back to when you learned your last language or important subject. How did you learn it? Did you systematically follow a tutorial? Or did you come up with an application and learn what you needed as you needed it? I would describe the first method as a hierarchical learning style and the second as a visual learning style. There's much more cognitive psychology here that would better inform such casual definition, but that's beyond this review.For the hierarchical or systematic learner, BJO is the book for you. The author's presentation of an application from start to finish is very well done and the application actually bears a striking resemblance to something that would exist in the real world. The introduction of UML to the design process will warm the cockles of a systematic learner's heart. What's more, the natural progression from one topic to the next will help those learners who need structure and rigor in their instruction. HFJ might strike this type of learner as cutesy and flighty. While it's definitely a more soporific read, you really have a sense that you're learning from every paragraph and page.
The visual learner would probably not get very far into BJO because there's little code to read or practice with until the third part of the book. HFJ is perfect for this type of reader since it encourages flitting about while it entertains your brain into learning. The topics aren't covered as thoroughly as in other books, but that's because the authors are trying to present only what's necessary in order to avoid cranial overload. The book's breezy style makes for very easy reading and I more than once found myself eager with the anticipation I normally reserve for fiction of the page-turner variety. In addition, the book covers some topics, like exception handling, that I hadn't encountered in my introductory Java book adventures and it does so in a very compelling and memorable way. There is an application that is developed over the course of the book, but it's not as well integrated into the book as the one in BJO is. Unlike BJO, this book sometimes leaves you unsure of why you're learning a particular item until later. Often, though, these lapses are addressed in a sidebar they call "There are no dumb questions," but I would have preferred to see more of them.
Anything Left? Neither book, though, is perfect. For example, both books whizzed through some subjects that really deserve more treatment: exception handling in BJO and variable types in HFJ. Also, neither discussed persistence beyond the file system. In the real world, I have a feeling that file-based persistence is one of the least common varieties. I can understand, though, that dealing with JDBC and the like would have increased the lengths of the books as well as their complexity. Finally, neither book did a good job of telling the reader what the next steps in learning Java should be. Java is a huge topic and it is very confusing for the beginner to get a bearing in the Java ocean. Having an expert say "If you're interested in JSP, you should find books on these subjects next, and then these" is of inestimable benefit. Heck, it's even hard to know what areas of Java you might be interested in if your introduction to Java is casual and not demanded by work needs.BJO omits any mention of unit testing your applications, but I think that's largely a shortcoming of having published the book in 2000. HFJ revels in test-driven development and includes writing a test as the second step of the three-part development process. Each code sample includes a test class and the authors stress repeatedly the importance of TDD. Unfortunately, they don't mention JUnita, glaring omission since the two are practically synonymous. Tests are emphasized but the reader isn't shown how to use them effectively. With the value attendant in a test-first development process, these omissions are of serious concern.
Concluding Thoughts These two books combined make for a very solid introduction to Java. Though they take different tacks, I think the categorization of people's learning style into a simple dichotomy is not realistic. People learn through a variety of means, yes, but often that variety is present in an individual. Reading both books will ensure that your learning style is covered as well as reinforcing the basic principles of good Java programming through repetition. There really isn't enough overlap between the two books to make the reading of them both tedious.Once you've read these two books (or just one if you're a cheapskate), you should probably consider moving on to Bruce Eckel's Thinking in Java and perhaps finding a good book on JDBC or Java and XML. Eckel's book covers much of the same ground as these two, but there are some sections in his book that you absolutely must read to progress as a Java programmer (or learn them on your own, of course). Where you go after that is up to you and I would recommend a quick survey of the topics at prominent Java Web sites to see what sort of areas are available.
You can purchase Beginning Java Objects: From Concepts to Code from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.
It all started my freshman year in college. I was lugging my bags to my room when this sexy ass nigga Ron came hollaring from behind me. "Yo you need help?" Of course I didn't resist I did bring mad shit. "No doubt." I said as I undressed him with my eyes. The nigga was hot. I was the only freshman in the room. My roommates were on the ball team. There were two bedrooms, Ron and his boy Dre shared one and I was in the other with some nigga named D-Rap. Ron was tall and slim about 6ft. Brown skin, Ceaser cut, big juicy lips which he licked when he talked. The nigga was just hot. His boy Dre was a shortie about my height 5'8'' slim tone 145 weight. He was brown skin chinky eyes and one of the pretty boyz on campus. The girls was all on the nigga dick. He represented Uptown Harlem world and always represented his boro right on 125th street near the famous Apollo Theater.
G-Rap was also from uptown I didn't really like him though. He had sex appeal but he just talk a lot of shit. He was a shortie too just like Dre. He was a lil darker a light cesear cut and a tight lil frame body. He was like a clown and he played too much. He thought he was a lil gansta since he was from uptown and he hated on Brooklyn niggaz like me. I think he was jealous of me cause I was a freshman had a whip, good looking, had the shorties on me cause of my eyes which he always joked were contacts. Now that you know about these niggaz I can get to the meat of the story. (Now is the time to go get that lube and slowly stroke it as I tell this story.) A year later I got to know these niggaz a little better. They annoyed the fuck out of me cause since they were on the ball team they would come in late making mad noise cooking breakfast 3 - 4 am in the morning. On study night niggaz always joking and smoking and doing crazy shit. Ron and me were close. Every time I saw this nigga he was excited to see me. One day I was out in the parking lot and this nigga saw me from way somewhere yelling "what up dick." don't ask me why niggaz on the ball team called each other dick I don't know and personally I thought it was some homo shit. Every time Ron saw me he saw me he would grab both my nipples real quick, give me a pound and massage my shoulders. I'm not gonna front I liked the shit and looked forward to it. The was the nigga twisted the tips of his index finger and thumb around my hard nipples sent a shiver down my spine and right to my dick. Of course I had to front. I pushed him back cause I would get hard to quick and out in public he would catch me off guard. In my head I always wanted this nigga. One time I was in his room and he was on the phone wit his supposedly baby momz. He had his hands in his pants and he was slowly stroking it till it got hard. After he got off the phone we would talk about shorties and he would always ask me when was the last time I had pussy. I would always say its been a minute and that I just broke up wit my girl. I was lying. Well I saw his shit through his blue basketball shorts. I always knew Ron had a big dick. Damn that shit was thick and I was the imprint of the head of his dick and that shit was rock. Yall niggaz don't know , that day I was ready to just say fuck it and just deep throat his shit until he nutted in my mouth. What took me out my daze was when Dre came in. "Yo Dick I need a favor son." I replied. "Nigga my name not Dick its Sean." Dre then apologized and said "all jokes aside I need to borrow some money to get home. Take to the train station and I pay you back when I come back." I got my shit and did this nigga favor. I took Dre to the station and left Ron in the bed beating his shit. Since D-Rap went home for the weekend Dre could beat his his before we got back.
I drove Dre as fast as I could to the station. I knew if I hurry I could catch the nigga beating off. When I got back what did you know. The nigga left the door slightly open and I could see his shit standing at attention wet at the tip. My shit sprung up and I slowly beat my shit a lil. Dam
the reason i dont like java is because it doesn't come with a compiler. i like the idea of it being able to run on various operating systems, but without a compiler, its pretty much useless.
Why does my PHP server has much lower CPU usage than my Java server (using JSP) despite the same number of users and comparible complexity? Does Java get tired and need a rest?
As the mastermind behind this innovative post, I feel as though it is my responsibility to inform you of something quite important: After getting quite a ways down this post, you'll come to realize that it's a lot like going to dinner with your buddy, saying, "How's business?" and writing it off as a business expense. A staid, steadfast comment, its life more closely resembles a pantomime of images, as opposed to a tame chapter of sounds. Because by leveraging innovative technologies, content providers streamline compelling enterprise solutions. As common sense would indicate, when one reads gobbledygook like this, one is bound to realize that what the author has done fits well within the aforementioned business dinner analogy, as the author has said about 2 words that were on topic, yet all that followed diverted from that original focus, nay, is completely off topic.