How to master Java? [closed] - java

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 12 years ago.
I studied 2 courses in Java:
1- Introduction to programming with Java.
2- Data structures with Java.
In Both courses we used Java SE.
I loved it and I really want to be a great java programmer.
But, I discovered that I should know many technologies involved in Java software development:
Spring, Struts, JSP, JSF, GWT, Hibernate, apache tomcat and many more actually a lot more.
I hope it become simple process like .NET
you choose one language with one framework and IDE that is it.
Could anyone guide me to the best route or path to master Java, please?
What do you think about these two courses:
http://www.oreillyschool.com/certificates/java-programming.php
and
Advanced Java Certificate Series (from the same school, will be available in September).

I think most programmers have about average college graduate intelligence, including myself. What we do have a lot of though is patience.
That said, there are efficient ways to learn and inefficient ways to learn.
If you're stuck on one tutorial/book, try another book. Once you're done with the basics, there really is no "correct" order to learn.
Skim through the standard Java library documentation. Don't bother memorizing it, but be sure that you know the tools are there when you need them.
Make lots of test programs. If you're ever curious about something, try it out and see what happens. Don't know how big an int is? Write a program that prints out a sizeof. Don't know what happens when you call a virtual function of an override instance? Write a program with two classes, one inheriting the other, and try it out.
Read other people's code. Take note of style and structure. And I don't mean silly things like whether the { should go on the same line as the statement, but how they recycle variables, how they organize their classes, how they use loops, where they bother to optimize and where they don't etc. Emulate what you like.
Practice building "stub" programs -- you can do this in your head once you get the hang of it. Find your favorite program, and write out all the classes/methods as you think would have been used to build it. That'll help you with architecture.
Spend lots of time naming your classes. Don't use fancy names, just descriptive ones. It's a good mental exercise to think about names, even if you don't expect to ever share your code.
Try Project Euler if you're into that sort of nitty-gritty mathy stuff. I don't believe that programming is all about math, but you might like it.
Learn C sometime. C++ probably isn't worth it if you're doing java, but C will teach you how your computer works. You don't need to master it, but at least get to the point where you understand memory management and pointers. That'll help you make decisions faster when you want your code to be really fast.
Learn functional programming someday. Haskell's a good choice, because it's a pure functional language. It's extremely difficult at first, but the concepts you learn from it are valuable regardless of what language you program in. You'll be making design decisions a lot faster, and your code will be a lot more robust.
Keep up to date. Trends come and go in this industry as fast as in the fashion industry. A lot of it is crap, but a lot of it is crucial both to employment and productivity. Always keep an eye out, or you'll go the way of the dinosaurs.

The best way to become good at something? Practice, practice, practice.
Don't focus on a single framework just do lots of Java, take a look around open-source projects, find something that needs fixing or implementing and do it or think of something that you want but doesn't exist and make it.

Practice doesn't make perfect - perfect practice makes perfect. If you continue to make the same mistakes, you'll only succeed in developing bad habits.
You need to read this.
Your Java roadmap ought to look like this:
Concentrate on core Java JDK classes to start. Don't worry about Java EE until you're comfortable with interfaces, classes, and the basics. JDBC is an important part of core Java, so be fluent with it. You'll have to know about relational databases, normalization, and SQL. GUI technology here is Swing.
Once you have that, take up servlets, JSPs written using JSTL exclusively (no scriptlets), and JDBC. You'll have to understand something about Tomcat (or another servlet/JSP engine), HTTP, HTML, CSS, and a little JavaScript as well. You can go a very long way with just these.
Once you've mastered 1 and 2, you'll have to make a choice of framework. I'd recommend either swallowing Spring or EJB 3 whole. I'd recommend Spring first, but I'll admit that I don't know EJB 3 well.

I get the impression from the phrasing of your question that Java is your first programming language. I laud your desire to "master Java", but if I might, I'd like to suggest that you try a little breadth before you get too much depth!
It's easy, I think, with a CS degree where most courses are taught in Java, to fall into the trap of believing that all programming languages are:
object-oriented (and with single implementation inheritance and multiple interface inheritance)
statically-typed (with no type-inference)
imperative (i.e. making use of iteration constructs and mutable state)
verbose
and therefore that all programming must look roughly like Java programming.
I'd humbly suggest doing some reading on different paradigms and languages: learn a dynamically typed language (coming from Java, I'd suggest Python or Ruby), learn a non-OO language (like C)---and implement OO, learn about functional programming (Haskell's a great eye-opener). At least take a look around before diving head-first into Java alphabet soup (Java culture highly values acronyms---but I'll pass no value judgments on this here).
Just my US $0.02!

Write programs in it. Find open source programs that use it and fix their bugs and add functionality to them. The best way to get experience is to experience it.

If you really want to know what you should be studying, within the realm of your examples (Spring, Struts, JSP, JSF, GWT, Hibernate, apache tomcat), then find some podcasts and blog posts that allow you to survey these technologies. You can then choose the ones you are most interested in for further study.

I agree with the other two respondents (practice, particularly with open-source projects, is the best way to get good at a language). However, I wanted to add one thing. It's unclear from your answer how much experience you have with object-oriented design, and with Java, that's essential. I'd recommend looking into advanced OO design to get a sense for what's out there. My favorite book on OO design is available for free and linked below - see if it's at your level. If not, find something more/less advanced and work from it.
http://homepage.mac.com/s_lott/books/oodesign/build-java/html/index.html

Java Technologies are very vast, from mobile phones, to enterprise level servers. You might want to first narrow what you want to learn.
Your first talk about Java SE(applications programming) and then start mixing in Java J2EE, and Java EJB.
If you want to go down the web route or enterprise server then you need to learn J2EE,EJB,Hibernate,Spring,etc otherwise these technologies aren't seen as often when programming applications.
It still seems like you have a long road to go, probably the most beneficial for you to learn next would be Java Swing(gui).

Practice and learn frameworks as you need them (or come across them). There are way too many frameworks out there (for Java and for .NET) to learn in one shot.
Learning the standard Java class libraries is always a start

The best way to become good at something? Get a job that allows you to use that technology. Get paid while practicing.
There is a time to stop reading books and articles, and get to work building a project.
As you are working, learn from others who are better than you. Continue to read articles on topics that interest you, and apply what you learn at work.

Find a mentor and pick his/her brains often. Once you are working in the field ask for code reviews from senior developers. This will get you out of your own habits, and reading people's suggestions for how you can improve will give you plenty of insights. Don't sit around reading, solve problems on a per-problem basis and work your way up from there.

Its not that easy to became a master in Java, what i have done to study java is
1)try to convert all the apps i have seen into java,
eg:paint to java
2)used to went to JAVA user groups and conference in my state
3)Went to Groups in Goolge for checking Codes of Java
thats all i do, i cant say i am the master, but i am able to do the stuff

Related

Practice your micro-architectural skills [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I've googled a lot and can't find what I look for.
I look for some architecture practice. I mean there are a lot of books about Design Patterns, but I want something like analysis of common mistakes in architecture of EE applications. All I've found - antipatterns like string concatenation or something else that can be found with help of FindBug or Sonar.
How I figure it out:
Book with next steps: task definition, wrong decision, why it is bad, right decision.
Educational resources. I heard there are such resources for testers. Some applications are opened for testing and each who want to learn testing can test it; and after some period discuss own result with other people or see the percent of bugs he has found.
Maybe other ideas?
Why I think Design Pattern books are not suitable for me:
A developer may know many design patterns from such books, but can be incapable of selecting the correct one for the specific situation. IMHO, this is because these books don't give you any practice, and fail to educate the reader as to which design pattern(s) should be applied to any situation. Those books just get you a ready solution.
EDIT:
There aren't any answers any more. So I want to expand my question:
I believe, no I'm certain that exist courses dedicated to improve architecture skills, show the common mistakes in designing of web applications and so on. Also I know that there are a lot of conferences linked with this subject.
Advice me where should I look for them, please.
Holub on Patterns is a fresh and interesting perspective on design patterns.
Lots of code. Lots of pro and cons, very hands-on and practical. I learn something new every time I re-read it.
It has been my go-to book as the "next step after GoF and Head-First Design Patterns". I love it, and it has been very well recieved by the ones who have tried it.
Can I assume that you know how to create independent objects using Dependency Injection? If not, this would be an excellent are in which to cultivate reuse and create a more robust architecture. Using DI would be an excellent way to re-architect an existing solution. (Contrast that with much evolved code, which becomes brittle because of interdependency.)
While you're not looking toward Design Pattern books, I'd ask you to glance at Refactoring to Patterns by J. Kerievsky.
Kerievsky takes you through some real-life refactorings which have titles like "Move Creation Knowledge to Factory." (It's "real-life" in that he uses actual code, not a contrived example.)
Finally, I have been encouraged in our recent use of Spring Integration as an Enterprise Integration Pattern. If you architect and implement even a modest project in Spring Integration, you'll get quite a lot of experience with both DI and EIP.
If you're writing enterprise applications, I'd recommend Patterns of of Enterprise Application Architecture when you're done with the basic design patterns.
It was written about ten years ago and some of the more modern things about how to shard tons of big data across cheap servers you will not find in there. The cloud did not exist when it was written. But it seriously discusses a lot of things that you won't find discussed elsewhere, and coins names / patterns for elemental building blocks of applications. I'd call it a classic rather than old.
See http://www.martinfowler.com/eaaCatalog/ for an index of the patterns that are discussed.
In my experience, the role of an architect is defined differently for different companies and often has less to do with code structure and patterns and more to do with your business requirements and practices. Employers seem to be more interested in what systems you might integrate into your solution or how you expect to interact with varous customers under conditions imposed by your company.
Correctly using a DI framework or design patern is something ever programmer should be able to without specific guidence from an architect, but researching and choosing which DI framework to use that might best fit your task is something an Architect might do.
They also tend to do more advanced impelementations--One of the better architects I worked with implemented the more difficult parts of our system, he wrote a custom Java classloader that loaded classes from a database and designed how it interacted with a GUI builder he designed so our customers could edit a GUI with Drag and Drop and we would save a .class file into the DB so it could instantly be loaded by all the client machines hooked to that server.
Some companies have different definitions than others--a company I worked with that did set-top cable box software had some architects that hardly programmed or had anything to do with software design, they were responsible for things like decomposing communication protocols and interacting with customers to help understand their problems (I viewed this more as Analyst work than Architect, but it was much more technical than most Analyst work I've encountered)
I guess I'm saying that an awful lot depends on the company you are working with. I suggest you go to your manager (or an existing Architect) and tell him you are interested in such a path and ask how you should progress.
When asked pretty much this question, one of the Architects I've worked with said that it's something you are always working at--you don't study up and finish, keeping up to date all the time on as much as you can is your new job--Where others might read a book or play a video game, you should be reading articles about software design, installing and playing with new software languages/tools/libraries and learning more about the specifics of your business.
In my views what I think going through the Class Diagrams of the Design pattern will help you a lot.
What more i will suggest is to take a brief of the Book "Head First Design Patterns". As per my experience this book has some very good example related to every Patterns which will help you in the pattern selection.
As per the selection of Design Pattern is concerned you can develop it by implementing more and more pattern in different scenario.
Take a look at Adam Bien's book
Real world java EE 6 Patterns
You can download an introduction based on this book at java.net
Real world java EE Patterns (pdf)
The first step is learning general good practices for developing applications. Knowing design patterns is very useful as it is a type of a language, so if you call something a "Controller" or "Request/Response" that automatically tells other developers the patterns you are applying and how to use it/work with it. Also, large software is typically built using them, so you have to know design patterns. Doesn't mean you need to squeeze every single one into every application, just saves you the trouble of solving problems others have already solved. As far as best practices at code level, Sonar is a good code analysis tool that taught me tons of do's and don't's.
Second, you need to narrow down the context and determine what types of applications are you planning on architecting. For example, web applications have different architecture from embedded applications, if you specialize in one you don't necessarily need to know all the ins and outs of the other.
Third, read up on Enterprise Integration Patterns.
Fourth, do hands on work with Apache Camel. It's a Java enterprise integration framework, great documentation and really easy to get up and running.
To me design patterns look like solutions to isolated problems. In real practice we have to deal with combinations of problems, which are highly dependent. I have never seen any pattern used purely. I can recommend one book which gives a wider view of software architecture: Domain-Driven Design: Tackling Complexity in the Heart of Software. It says how to approach to software design, instead of giving a set of common tools. With some examples it explains how to solve a set of problems in combination.
One more book gives an explanation on how to design classes and their collaboration: Interface Oriented Design: With Patterns. To write good understandable and maintainable code. It explains a lower level approaches rather then DDD.
My two cents :)
I agree with your observation that simply learning design pattern is of little consequence. A typical thing which generally occurs after learning design patterns is that the developer tries to map the a ready made solution (pattern) to a problem which is not the right way and will create more problems than what it solves.
IMHO, being an architect is more a matter of experience than academics. An architect is at core a Problem Solver or Solution Provider. By problems, I mean the large scale design problem and not the day today programming problems.
The problems could be from whether to use OR mapping tool or not to larger and more profound problems like whether to go for SOA or not and likewise. Its not about WHAT to do but HOW to do.
These things are a matter of experience. A problem can be solved by thousand different ways but while designing a system, due consideration should given to technical feasibility, performance, scalability, deployment, maintenance, extensiblility and many such non-functional requirements. Now unless you have been-there-done-that, its difficult get hold of these things which are very vital for today's software system .
Nobody can deny the importance of books(apologies for not introducing to new books as people here have already suggested wonderful books). They are written by very intelligent, sharp and most important experienced, people. I view this as a way of sharing once's experience and view point and they help you in chalking your path.
Apart from books, the other very important way to understand or learn about system design is ability to dissect the existing systems. For example, you might want to explore how a typical web server like Tomcat works or a DI framework like Spring works. Open source makes these things possible.
The best single way to be a great software architect, developer, or programmer is to work.
Get the basics down, and then work on something - especially something you are interested in. Hard work will pay dividends in the form of experience.
Surround yourself with people smarter than you, and listen to what they have to say. Trust that their experiences can help lead you into a better understanding.
Wisdom is not something that can be bought with a $50 book, or even a $100K college degree. Software craftmanship is something that you must earn.
If you have free time, working on a popular and successful open source project will help you gain great experience.

Prep for Beginning CSIS: Java Programming

I am going to begin my Computer Science & Information Systems degree in April. My first class is an introduction to Java programming.
Lately I have had an interest in Objective-C, but slowly declined due to lack of persistence and comprehension difficulties, (mostly some OOP). Obviously I would like to do well in my classes, so I am asking what is the best way for me to prepare?
Should I complete the Alice training and then start learning some Java on my own? Continue to work through Objective-C religiously until I see results? What do you think a newby should do?
edit: I have been reading reviews for a lot of Java books, just curious, are there any other well written beginner books? Thanks!
Objective-C probably has some barriers that will be problematic if you're learning.
I would suggest picking up a copy of either Thinking in Java or Head First Java and reading through that to get started.
When you're learning it can be useful to not be distracted by too many details. Master the basics. Learn about basic OO design. Frustration is the biggest enemy. If what you're doing seems daunting, the greater the chance you'll just give up. So keep it simple so each time you do something it feels like you're making progress.
Firstly pick one of the two languages, either Objective-C or Java, as learning both at once might not give you encouraging results and you're gonna have a lot on your hands than you can handle at one time. So, I'd suggest you go ahead with Java as Java is also going to be your first class. Java is huge, so keep it simple in the beginning and concentrate more on the fundamentals and you can build on top of that as you progress. And you can always ask questions here on SO. Also you probably might find the java classes easy as you've already been doing your homework.
In addition to the java books already mentioned, I'd suggest you go ahead with the Sun's java tutorials.
As a java beginner, you might also find this free book helpful:
http://www.greenteapress.com/thinkapjava/
I think one of the best ways of learning the basics of programming these days is by playing with Ruby. You will have to spend something close to 0% of your time worrying about infrastructure issues (compilers, header search paths, etc), and you can experiment with the interactive mode (irb) to rapidly learn how to use various features.
You can start out with Ruby without having any concept of what objects or functions are, yet you will gradually learn about quite advanced object oriented topics, and even functional programming-style patterns.
Chris Pine's "Learn to Program" teaches the basics of programming using Ruby. I haven't read it, but had a look and it made a good impression.
(There are also many other books teaching Ruby.)
There is nothing inherently bad about learning programming through Java, and it gives you a general understanding of OO design, but it is a pretty limited language. Ruby is just much more fun and you get to learn a lot of advanced techniques that aren't even possible to use in Java by just experimenting with it––many of which will be useful when you're learning Objective-C later.

Should web developers still learn JavaScript? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
Now that frameworks like GWT, Morfik etc exist which compile Java client side code into major JavaScript dialects, is it still worth learning JavaScript?
In my book, yes.
I'm a strong believer in understanding the underlying technology beneath whatever toolkits you're using.
Abstractions are leaky - you'll run into trouble down the line if you try to get away with only understanding a high-level toolkit, and not the underlying technology. Sooner or later you'll need to debug your project at the JavaScript (or whatever) level.
Understanding the technology behind your framework reduces the time spending on debugging the things you do with your framework. so in my opinion it's always good to know whats going on behind the scene.
Yes,
...and I speak with experience: I've never learned javascript and only used parts of it, when I encountered it in google searches for questions.
Now that I'm building a Web application, I notice that not all abstractions away from javascript have the desired functionality, and I need to go into javascript to solve it.
I notice that I miss the fundamental knowledge I have with other languages, just like I miss the 'javascript programming language' book (I'm not sure it exists but I have similar copies for C, C++ and Java). So today I ordered Javascript:The good parts and I will learn it...
ABSOLUTELY. In my opinion, abstraction is important, but knowing how that abstraction works is equally as important.
I've seen developers who live and die by their frameworks (javascript: jquery, yui, etc... or php: zend, cake, etc...), but have no clue how to do anything productive without them.
Who would you rather be (or hire)? The guy who knows how everything works, but improves his productivity by using frameworks and libraries... or the guy who uses these resources with no idea how they actually work?
Stretching this further...
Should you learn assembly language nowaday with so many higher level languages?
Should you learn how to do basic arithmetic like subtraction and addition by hand when now we have calculator and computer that can do this for you?
Well, I'd say maybe you won't need to if you don't have any reason to go deep down, but someone will have to still.
As with all things, there is a balance. Know that it will be to your disadvantage if you don't know the lower level stuffs, but sometimes it is necessary to skip it so you can be deep in something else. You have to admit there are so much technology out there that you won't be able to be an expert in all things. In that case, knowing someone else who does is a good thing.
So pick your choice and go with what interest you. If you think you are interested in learning JavaScript go for it. If not, you can stick to your level of abstraction and get a JavaScript buddy that can help you when you are stuck.
I think the reality of browser bugs will make being able to diagnose and understand the generated JavaScript necessary for a long time. I worked with a Spreadsheet company for OS/2, and they had to read the generated assembler from the C++ code because the IBM compiler would generate buggy machine code at times. So while they may not have known enough Assembler to write a whole project in it, they certainly had to know enough to track down problems.
That being said, there are also many web frameworks that require you to code your own javascript, and a given toolkit won't necessarily do everything that you need to do without directly writing some javascript. You can choose frameworks that avoid it if you prefer, but it isn't at all obvious that, unlike say Assembler for application development, the Web development community has decided to abstract away any involvement with it. You may well end up on projects that need it.
Actually, drawing a parallel to assembly language is a bit missing the point. Assembly was platform specific and the move to C enabled a certain level of platform agnosticism, allowing the developer to be more productive on multiple platforms. Hence, there was a real productivity effect.
Learning all your rich web chops on something like GWT is more limiting. It is, after all, based on Java, and the web is way larger in scope than just Java. You'd be seriously limiting yourself if all you know is GWT but not the inner workings of the generated Javascript (Can't comment on Morfik as I don't know it).
However, employing something like JQuery in order to be more productive when coding Javascript is much better. JQuery can be used on any browser running on any OS, so it doesn't limit you.
I'd say yes. I've met people who claimed to know javascript, when all they could do is do a couple of jquery function calls. Javascript (ECMAscript) is a beatiful little (ok, not so little) language.
Abstracting a bit from javascript - define "worth learning". This kind of thinking was always a conundrum to me. Are you, per chance, afraid of learning something new?
I guess, this kind of thinking is what really separates a coder from a programmer.
A web developer who does not know Javascript is like an auto mechanic who does not know how to change a tire.
JavaScript is the core of interactive client-side development. It is absolutely essential. After you know JavaScript you might decide to try out other things that compile to JavaScript if you find them easier.
Also if you want to work professional in web development for some company then you are going to have to know JavaScript. Besides, JavaScript is getting more and more popular as the execution of the language in the browser gets faster and as it becomes more popular in Server-side development as well.

How can I quickly improve my abilities as a programmer?

My question is broader than merely expanding language specific skills. I'm wondering what sort of advice anyone might offer to someone with a desire for knowledge, but a lack of direction. Feel free to skip down to the question.
Background: I've taken a single computer science course in java at my University, but i'm planning on majoring in Computer Science and Electrical Computer Engineering (ECE). My java class was quite rudimentary. We were provided with a framework and merely edited/created a few methods and classes to perform a simple task. We made a version of Breakout, and created an AI for a simple connect-four game. Although I'm somewhat familiar with big O notation, I haven't actually studied it in class (My next CS class covers this). In my introductory ECE course we also programmed BOE-Bots in PBASIC to compete in an obstacle course of sorts. As an engineering student, I was also introduced to matlab, although I've only used it for linear algebra homework. In summary, I don't have much programming background, but I've loved pretty much everything I've done so far, and I'm looking for ways to build a more valuable skill set.
Steps Taken: After paying more attention to the programming section of reddit, I found a link to Project Euler. This summer I've been hacking away at those problems (finished my 42nd solution yesterday), but I'm looking for some more direction. I've been reading blog entries and SO heavily. I'd like to learn something about php, and perhaps create a dynamic webpage, but fundamentally I want to do anything in my power do to improve myself and prepare for the working world.
Question: What would direction would you recommend for me? Should I learn a new language? Keep attacking Project Euler? Read some books on programming? Start a coding project(I wouldn't even know where to begin)? Wait until school? Learn about more fundamental programming principles?
I guess with all the paths available, I'm just a little overwhelmed, and I don't want to fall into a path that might be detrimental to my career opportunities. I'm also really bad at making decisions. Your advice would be greatly appreciated!
The word quickly worries me... I suggest you read Teach Yourself Programming in Ten Years - Why is everyone in such a rush?
~~ Peter Norvig
Forgive yourself if you're not setting the world on fire three weeks after sitting down at the keyboard... maybe you're destined to be a late bloomer?
;-)
Most everyone is suggesting doing more programming. Whilst that's obviously important, I think it's important to understand the environments that your programs work in.
I would investigate how operating system work (how they allocate resources for you, how they schedule programs and threads), how networks work (routing, TCP/UDP behaviours and limitations etc.), and some database theory.
I see a lot of junior programmers with great language knowledge, but beyond the sandbox of their program they don't have a clue how the computer/network enables their stuff to run.
Knowing something of the above will make you a better programmer in terms of how you write your programs, and how you understand how they'll work (and indeed, how to debug them or analyse their failures)
There is only one thing that can improve your skills as a programmer: Program.
Reading books about programming is akin to reading books about cycling. It's not going to turn you into a cyclist.
Program something that you'll use and have a vested interest in. Then just put your head down and do it - reading any supporting information as you go.
Programming skills are just a small part of what makes a successful programmer, IMHO. Being able to read specifications, ask questions and interact with other people to extract the information you need to program are very important too. Pay attention to your 'soft' skills, they will help you a lot in being a successful programmer in a commercial setting.
I'd reccomend you take a multi-pronged approach. Reading books can only take you so far, since they don't provide you with practical experience in developing an application from scratch. Programming is much more now about writing code; you have to be able to design applications, read documentation, and know how to solve the needs of a customer who doesn't know how to tell you what to write.
If you're still in college, try to find an internship with a development firm. You'll get access to people and resources who already have this experience. If you for some reason can't do an internship, find and make a friend who is a developer. The impact of having someone who knows what they're doing to bounce ideas off of is immeasurable.
In addition to surrounding yourself with people with knowledge, you should also take on writing an application all your own. Pick something that interests you, but at the same time try not to make it too complicated, you don't want to frustrate yourself by writing a boring application, or choosing something that has too steep of a learning curve. Remember that the application is at it's core, a tool to assist you in learning, so it's OK if it turns out to be less complex then you imagined, or if the code you're practicing doesn't apply within the scope of what you're trying to write.
You definitely need to write code in order to become a better programmer. If you don't have a particular idea for a program to write, pick an open-source program (ideally one that you use), contact them and find out what they need done; contribute something. Fix a bug, implement a feature... start small and work your way up. This will help you learn about working on a team, writing maintainable code, preventing problems, and working on useful tasks. Much of what people write while learning to program is just exercise code, and not actually useful or representative of anything realistic. That is why a real, useful program is the best thing to do.
I saw an interesting link for a site called CodeKata that might help you. The important thing to get your skills going quickly is to actually code for practical problems that you will be likely to encounter in any real job.
Besides picking an interesting project and implementing it from scratch, reading others' code can also be valuable in improving your skills. Scott Hanselman has a good series on reading code: Weekly Source Code
Since you already know the fundamentals of programming, and obviously have the desire to learn I would start a pet project.
Nothing has forced me to learn great deals about a technology, language or idea more than having a fairly challenging pet project to throw my self into.
I would recommend, like rein mentioned, picking a project you really have a true interest in. Other wise it will get boring pretty fast and you'll have no idea why you are working on it. I think it would be wise to make the project fairly non-trivial. I always found the less trivial a project I was working on, the more I learned and took away from it.
Also If you live near a college/university research labs on campus are pretty much always looking for summer interns to work on code in one shape or form. Some will even pay you. I did this for 4-5 years through high school and some university and it was a great learning experience.
Obviously participating in an open source project is a great way to gain experience at working with other developers. Check out stuff on github, sourceforge, bitbucket.
I'd only caution you to ask for help and bother the core developers of a project you are very interested in and you are going to stick with. Generally open source developers dedicated to there project are few and far between. Their time is really valuable to the community and to waste it on someone who is just going to fly by night and never be seen again is kind of a shame.
It sounds like you are writing programs happily, and are a decent java programmer. So writing more might not be your most productive way of learning new things.
As a result, I'd say learn a new language - knowing more than 1 always exposes you to new concepts. As a java programmer I'd suggest C/C++ as they've immensely popular but they fill areas that the 'managed high level' languages don't go, the low-level high-performance, to-the-metal applications. If you learn C# (for example) you'll find you're just doing a different dialect of java (roughly) and you won't learn too much.
If you don't like the idea of C/C++, get into a scripting language instead - bash, VBScript/WMI, or perl or python. they'll be sufficiently different to teach you some good stuff.
Or do both!
You already know how to program; in order to prepare yourself for a real life job, the most important thing is probably not how to program better, but to learn the things you'll have to do that aren't programming.
In your workplace, you most likely won't be asked to write line "fire and forget" programs, but work in a team on large applications. In order to do that effectively, you need to learn:
How to communicate effectively with analysts, customers, managers and your fellow programmers
How to plan and coordinate work: using source control systems and bug tracking systems, working with written specifications, following a development process - "software engineering"
Perhaps most importantly: get used to working with other people's code - third party libraries, frameworks, and of course colleagues' code.
This, too, can most effectively be learned through hands-on experience in a real project. For me, the big eye-opener was working in a group of about 10 students in an experimental project organized by university with some industry support. Perhaps you can find or organize something similar at your university? If it has a chair dealing with software engineering, they should be happy to do something like that if they aren't already. Failing that, joining an open source project is good too.
Write programs to automate things that you do manually on a daily basis.
Like, todo lists, keeping accounts, checking RSS feeds.. the list could be endless. If you do some business on the side, write some simple code to assist you in that.
The essence is: to improve your programming, do programing! :D
Contributing to open source projects has a surprisingly high impact on your ability to develop software, as opposed to the ability of writing code:
you get to work on code written by others, which is sometimes brilliant and sometimes abysmal;
collaborate within a geographically distributed team;
get introduced to team politics ( yay! );
understand what it means to have actual users.
to quote just a few. Some good places to look:
Codehaus
Sourceforge
Google code
Find out about best practices (for example training videos on windowsclient.net). Get any problem and solve it using database as input and database as output. Start over several times. That's as close as you can get to the real world scenario. Read books recommended by Joel.
Here's my multi-prong suggestion:
1) Big picture work - Look at various Software Development methodologies and see how when you program you follow one of these approaches. You did some Java work, was that web, windows application, console application, or something else? Learning a little about the other types may also prove useful
2) Medium picture work - Have you looked at Refactoring and Design Patterns? These can be very useful but may require a bit more coding experience to see how they can be useful.
3) Small picture work - Study various algorithms and understand various trade offs one can make in choosing various implementations of a data structure, e.g. linked lists vs. arrays. There is a big white book about Algorithms that some use when studying them.
My multi-advise:
Keep training, and write code. Participate in small open source project.
Read standard book (here is the Jeff's list)
Learn from your mistakes, or better from the mistakes of others by reading site like www.badprogramming.com
From 99 ways to become a better developer:
Program! and try to diversify your work as much as possible
Find a mentor
Be a mentor
Learn about the different aspect of software development other than code (business of software etc.)

Best approach for learning Java after C++?

I've been using C++ for about 6 or 7 years now, and I consider myself fluent in it. I've never bothered with Java until now, but I find myself out of the job (company went under) and I need to expand my skill set. Someone recommended Java, so I am wondering if there is any advice for where somebody like me might start. I am also interested to know what the key aspects of Java are that are most likely to come up in an interview.
There are some popular areas that I think of when we talk about Java
Concepts of OOP: I'm sure this will not be much different from C++:
Class, Abstract Class, Interface,
Polymorphism, Overriding,
Overloading, Inheritance, Static
member, ... Interface will likely be
area that you might want to focus.
Since this is not directly available
in C++, I don't know.
Core Java: Such as the basic syntax and the common classes such
as Math, String, System.out,
Scanner, Basic file I/O, Stream.
Know the concept of Garbage
Collection, Reference Type (since
pointers are not available here.)
Know the Java platform/technologies,
J2SE, J2EE. Basic GUI with Swing and
its layout managers. Web
Applications with Servlet/JSP.
Popular tools, frameworks, and libraries: This may not as
important as above bullets. But
maybe you should know what Eclipse,
Netbeans, Spring, Struts, Hibernate,
EJB, Ant, JUnit, JavaDoc, are for.
You can always search for "C++ to Java" in Google. I'm sure there will plenty of good start points. Don't forget not to put * in front of var name next time you code Java :)
I recommend you read the book Effective Java cover to cover. Not only will you learn lots of good programming practices, but you will also learn more about Java than you otherwise would. Highly recommended. :-)
As a simple example, in Java, rather than rolling bitfields by hand (which is rather painful to do in Java, and for good reason), you use an EnumSet instead. This is documented in Item 32.
BTW, if you don't mind reading a PDF (no DRM) version, it's cheaper than hardcopy too: http://www.informit.com/title/0132345285
There are a number of great "in depth" Java books that will teach you not only Java, but also best programming practices.
If you're just interested in syntax and an introduction to the Class Hierarchy, Java in 24 hours is pretty good. From there, you will know enough to go and explore more on your own.
I highly recommend thinking of a small project to help you learn. In fact, think of a teeny tiny project -- it will turn out much bigger than you think! ;) Maybe a simple shoot-em-up or a Daleks- or Asteroids-alike, or some such.
The main thing being: for an expert-level programmer, don't try to learn Java from a book. You can get introduced to Java via a book, but then you have to go learn on your own (or from another.) It's like learning to drive a car -- you can get the basics from a book, but you need to explore & try stuff, and someone who knows how can be very helpful.
Some things that will help:
Download and bookmark the HTML Java docs. You will reference them often.
Have a small project, a simple game or utility app that you estimate will take a couple of days to write. Spend a couple of weeks writing it ;)
Note that "Java" is 3 things:
Java the programming language. Like C++ or Lisp or Perl.
Java the Class Hierarchy. Like STL or Cocoa.
Java the run-time virtual machine, the JVM.
People use the word "Java" to mean all 3 things, and slip between them without much notice, so pay attention to that, when you start talking Java to people.
Good luck!
(And let us know when your game is available :)
The biggest issue with the C++ to Java conversion is that they're so similar -- you'll find yourself doing C++-isms for a while. But it's no big deal: as suggested, read Josh Bloch's book, and run through the tutorials on java.sun.com and you'll do fine.
In my opinion, Java sets itself apart from C++ in three ways:
Automated memory management
Simplified syntax (and no preprocessor)
The Java standard libraries
As a former C++ guy, the first two shouldn't be a problem. (In fact, I would wager they will strike you as rather refreshing.) To get used to the libraries, I recommend Bruce Eckel's Thinking in Java - the 3rd edition is free to download. Though the beginning chapters will probably be a little too basic, the sections about GUI programming, concurrency, and the various container classes will be very helpful.
Beyond that, the best way to learn any language is to read good code.
I started by reading the Java Language Specification, version 2 at the time (2001).
In my view it is quite readable as specifications go.
Effective Java is good advice.
Java Puzzlers is good to learn corner cases and possible pitfalls.
The Peter Norton's Guide to Java Programming, "Making the Transition from C/C++ to Java".

Categories