Prep for Beginning CSIS: Java Programming - java

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.

Related

How to master Java? [closed]

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

How Long Does it Take to Learn Java for a Complete Newbie? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
I have absolutely no programming experience but need to learn Java - enough to take a J2ME fasttrack course. I only have 10 weeks. Can I do this? What's your advice about the best resources I can use ?(currently using Sun's Java Tutorials).
10 weeks? Apparently you can do it in 24 hours!
http://www.amazon.com/Sams-Teach-Yourself-Programming-Hours/dp/0672328445
EDIT:
Okay, so only 1 person found my answer amusing, but not amusing enough to upvote. The real question is how good do you need to be in 10 weeks?
If you get yourself a good book (the one linked above has some good reviews on Amazon), then in 10 weeks you might be proficient enough to do something useful in Java, but it takes years to become expert. Any time spent between 10 weeks and several years will move you from beginner towards expert.
Oh and read Teach Yourself Programming in Ten Years.
OK, based on some of the previous answers, I am expecting to get downvoted for this, but, I think you are delusional to think you can learn, on your own, how to program in Java in 10 weeks with no programming background. No person, with NO programming experience, other than some sort of prodigy, is going to learn to program in Java or almost any language in 10 weeks.
For clarity, copying and running hello world from a book does not make you a programmer. Hell, it will most likely take days just to get that working in some IDE.
Now, can you study and potentially pass some test? Maybe, but that depends on the depth and format of the test.
If I asked if I could become a doctor in 10 weeks, I would get laughed at for asking, so I am somewhat surprised at the answers that indicate that it is somewhat possible. I can stick a bandaid on my daughter now, but it hardly makes me a medical professional, it just means I managed their version of hello world.
The main question is whether you've done any programming in the past since that may be the main effort. I would suspect that if you had not, you could get by but not necessarily do well. You indicate that you didn't have any programming experience, so this is where you are going to have most problems and spend most of your time. Java would not necessarily be faster or slower to learn than other similar languages.
Sun's Java tutorials are great, but unfortunately programming is one of the things where practice is necessary, and that depends on your free time. It's also necessary to stop and practice frequently rather than after reading half a book. If you devoted 10 weeks full time to it - yes, it's quite doable for some people. After all, college students become passable developers in one academic year where they take other unrelated courses.
I would focus on figuring out Java fully first without trying for J2ME. Then you can make the switch.
In addition, realize that there's a big difference between the language and the standard library. The important thing is to learn the language. There are certain standard library calls that everyone uses and are critical to learn, but they're not part of the language. However, you'll never really know the entire library (Though you'll learn from exprience). It's more important to learn how to find the functionality that you're looking for then to know exactly what it is or where to find it. The important thing is to avoid reinventing the wheel.
Also, realize that you may only be a passable developer at the end. Experience takes time and often can't be hastened.
In addition, even if you learn to program you will miss some of the critical general CS knowledge like data structures and algorithms. Programming books rarely teach that, you will have to learn that yourself (see, for example, the TopCoder tutorials).
Okay, there are a lot of people here saying, "yes" and "yes, but it will be hard" so I'll differ.
No.
The problem isn't "learning Java" in 10 weeks, because I think that by the time 10 weeks is up, you'll be able to program some things and have an idea of what to do to solve some simple things.
But that won't make you ready for a J2ME fast track course. Fast track courses tend to be for people that have a strong background in the prerequisites. You might be able to do many of the things as you are going along, but without the background to understand the why of what you're doing, it will seem like a lot of semi-random things to memorize by rote, and will likely quickly vanish.
Basically, I think it just takes time: time to let lessons sink in, time to experiment and fail a few times so that the why suddenly jumps out at you...
Ultimately, I suspect that you could get through it, but that you would not end up being very proficent at all. (the final two paragraphs of Uri's post say it all.)
I don't want to be a complete downer, and I definitely hope you do well and succeed...but I would hate to bet money on it.
(Understand, I don't know you from Adam...so I'm making statements based on my experience with how it was for me, and people I've worked with...so this isn't a slight against you...just an observation that this is a very big meal you're setting down to eat.)
Learning to program for the first time is kind of like learning a foreign language. You will easily be able to recreate the phrases you are taught, but you will lack the understanding of the context for why it is done that way, and will thus be unable to solve new problems effectively. It simply takes time.
If you're a first-time programmer, I really can't recommend Java. Python would be much better (disclaimer: Python fan-boy, but for good reasons).
However, I don't think a beginner could do much better than Head First Java
The main problem you're having is that you're learning programming for the first time with Java and I think Java isn't the best language to start.
I suppose that you're addressing a work project, Is this the case? That pressure might make things worse. Depending on how complex the project is you might success but learning Java in 10 weeks without background knowledge is another issue.
I teach Java Programming at a high school, and our course runs 14 weeks. This is enough time to give students a solid foundation in object oriented programming, but students are not experienced enough to develop and large projects or anything too complicated.
Many schools use the textbook by Lambert & Osbborne:
Lambert, K. & Osborne, M. Fundamentals of Java: AP Computer Science Essentials for the AP Exam. 3rd ed. 2006. Thomson Course Technology.
I'm computer science student who just finished my first Java course.. I'd say it's possible to learn Java on 10 weeks if you hard work on it. But you'll only get an intro! Programming is much more than just knowing the language (API, syntax etc)..
Best Java book ever: http://www.amazon.com/Introduction-Java-Programming-Comprehensive-Version/dp/0136012671/ref=sr_1_1?ie=UTF8&s=books&qid=1242328533&sr=8-1
It depends on how hard you want to work, but yes it's possible. The problem you are going to have is that you have to learn to program along with learning java. These are two very different things. Programming is knowing how to read and write logic and Java is a language you write it in. If you have a math or physics background, this is going to be a lot easier, as you are already exposed to thinking in such a manner.
If you don't have books on beginning Java I would go buy one of those.
I would also pick up the book Code (I would try and get through this in a few days, if not over the weekend if possible). Actually with 10 weeks I would do this first as it will be a foundation for what you'll need to know to program Java.
With 10 weeks, you are going to have to pretty much study every night to get the hang of it by the time you go to class. My best advice is that when you take the class, take lots of notes, and don't expect to understand everything. Most of what gets thrown at you there will probably go over your head at first and you'll forget. That's ok. After the class if over, go back and review the notes etc until it starts to make sense.
My experience in Java programming for beginner is not difficult to learn; however it is really depended on how your object-oriented programming skills are. As you posed that you had no programming experience , I guess that I recommend a web site, http://www.exampledepot.com/ , and type any java keyword such as Swing, FileInputStream, it provides a lot of practical examples that you can apply into a project.
Please, buy a java book (Sams'java 6 in 24 hours) as reference. It will give you really basic skills for java within a short time. and I sure you will have enough time to learn about the java and J2ME within 10 weeks. Good Luck.
Tiger
I have to say that you are taking on a lot in just 10 weeks, I just finished a semester of Java programming at Indiana University Southeast, and I don't think I have begun to scratch the surface yet. Java is a very strict language in that its syntax is very tough to get a handle on if you have no programming experience at all. I will offer these pieces of advice go to www.bluej.org and down load there, Java compiler it is said to be the easiest to work with and that most college's use this. It is also, what we learned on and from what I know now I can say, they are right. Java is an object oriented language, and Bluej gives you a great understanding of objects. They also show you how to design, classes, methods, array, array list, hash maps, all of that is on this site and it is free. I hope this helps and good luck with your challange.
There are different schools of thought regarding how much time you need to become expert in programming. I'm not going to add to it.
I suggest if you have absolutely no programming experience, learn C first. Then move to Java.
The following site is very good for learning java.
http://www.javapassion.com
Doable, yes. But you'd missing out on a lot of theory behind programming so even though you may know the language well enough to code in it, you won't know how to program well. I'd suggest picking up a few beginner's books on object oriented design while you're at it. The best (for me at least) teaching and helping tools for a new language are tutorials and forums like this (don't forget to google first though, there are a lot of beginner questions answered with a simple search).
Good luck!
You can definitely get a good understanding of Java in 10 weeks, but as mentioned before, practice makes perfect (or at least better...). A couple of starting places:
The Java API will be your friend:
http://java.sun.com/j2se/1.5.0/docs/api/
Java has a lot of built-in functionality so try not to duplicate it (String functions and whatnot).
Also, an IDE might make some things a little more complicated, but it'll also help you find your way around the API. Eclipse is a good place to start (and it's free)
http://www.eclipse.org/
Hope that helps a little..
Can you learn to draw, sculpt, or paint in ten weeks? Anyone can learn to punch the keys to program, just as anyone can pick up a brush, but it takes time and talent to cultivate the artistry to develop. Do yourself a favor and put the time and effort in to learning, not cramming. The lessons you learn by a concerted effort to know how to develop will serve you much better than binging on it to meet some arbitrary date.
I can sympathise... having once been in a similar predicament, though I did at least have some background. I concur with #ShawnMilo regarding Head Fist Java. Also recommend Sams Teach Yourself Java in 21 Days and, given that you say you have no programming background, I strongly urge you to look at The Oject Oriented Thought Process by Matt Weisfeld. I also concur with all the people on this thread who say that there's WAY more to programming than 'simply' learning one language (especially if it's Java). Having said that, good luck and god speed.
PS I'd +1 #Patrick McDonald for sense of humour, but I don't have enough rep!
PPS And another virtual +1 for #Robin. I was wondering when the Four Yorkshiremen would get in on this thread...
For java, you also need to learn how to use an IDE and setup your environment and this kind of this to make java works...
Then for J2ME, you'll need to know things about embedded/mobile systems....
10 weeks with the tutorials would be ok but it also depends on what you're going to do in your j2me course...
I would go head first in a j2me tutorial (assuming you know a minimum concerning variables functions and OO)...
good luck...
The best advice for learning to program is basically: write a lot of programs.
Project Euler contains lots of problems well suited for this purpose, as the resulting programs are manageable in size while actually allowing you to solve an explicit problem.
http://projecteuler.net/index.php
I worked with some self-taught programmers who read stuff like "learn javascript in 0.01 days". Everyday was worth it's share of thedailywtf.com.
Besides, at a job inteview you get asked "how much javascript experience do you have?", your answer "0.01 days".
so good luck but I hope our path won't cross before a few more years
I wouldn't say I had "no programming experience" but prior to learning J2ME, most of what I'd done was in assembler more than 10 years prior.
I skipped learning "JAVA" and learned J2ME, which appears to be a small subset of java. It's small enough (if you ignore the extensions) that it's very digestable and easily explained in a moderately sized book. From that standpoint, it was a little bit like assembler (somewhat limited amount of stuff to know) although I did need to learn about OOP.
I bought a few J2ME books, but the one I found most helpful was: "Programming Wireless Devices with the Java 2 Platform" by Riggs, et al.
I don't recall exactly how long it took me, but I'm pretty sure I was writting deployable code (it was a mobile time sheet application) in 12 weeks or so.
I had no programming background and wanted to learn PHP. It took me about 6 months practicing beside my normal job to develop my skills enough to write some simple applications for a website. Java is a bit more complex...
10 weeks? Are you crazy? the Java API is massive not to mention Java EE how could possibly get through that in 10 weeks? you could maybe get through 5% of that in a couple of months. I'd say it would take at least a year to lean Java fundamentals for a newbie. I mean you can't just read a chapter on a subject and then think you understand it. You have to spend a good deal of time using that concept or part the API to at least commit it to memory never mind actually have a good grasp of it.
Realistically I'd say at least 2 maybe three years of programming to reach industry entry level standard. And that's if you really apply yourself.
I don't see why you couldn't do it. I am a book person, so pick a book and run through it. Set up some small projects and finish them. 10 weeks is longer then I usually get to learn a new language.
Have fun and hope you learn a lot.
I would post the books I learned java with but they are at home and I ain't.
As others have mentioned, 10 weeks ought to be enough if you have a computer programming background.
Closer to 6-8 weeks, if you're Jeff Atwood.

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".

What's a good way to teach my son to program Java [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
OK, so I've read through various posts about teaching beginner's to program, and there were some helpful things I will look at more closely. But what I want to know is whether there are any effective tools out there to teach a kid Java specifically?
I want to teach him Java specifically because (a) with my strong background in C I feel that's too complex, (b) Java is the other language I know extremely well and therefore I can assist meaningfully without needing to teach myself a new but (to me) useless language, and (c) I feel that managed languages are the future, and lastly (d) Java is one of the simplest of all the languages I know well (aside from basic).
I learned in basic, and I am open to teaching that first, but I am unaware of a decent free basic shell for Windows (though I haven't really searched, yet since it's not my first choice), and would anyway want to progress quickly to Java.
My son is 8, so that's a couple of years earlier than I started - but he has expressed an
interest in learning to program (possibly because I work from home a lot and he sees me programming all the time).
If no-one can suggest a tool designed for this purpose, I will probably start him off with text/console based apps to teach the basics, and then progress to GUI building.
Oh, one last thing, I am not a fan of IDE's (old school text editor type), so I would not be put off at all by a system that has him typing real code, and would likely prefer that to a toy drag/drop system.
EDIT: Just to clarify; I really am specifically after ways to teach him Java; there are already a good many posts with good answers for other language alternatives - but that's not what I am looking for here.
EDIT: What about Java frameworks for 2D video games - can anyone recommend any of them from personal experience? I like the idea of him starting with the mechanics in place (main game loop, scoring, etc) and adding the specifics for a game of his own imagining - that's what I did, though for me it was basic on a Commodore VIC-20 and a Sinclair ZX-81.
You may find some inspiration in this project:
Teaching Kids Programming: Even Younger Kids Can Learn Java
Java Programming for Kids, Parents and Grandparents.
You can find here at the faratasystems web site (direct link here)
Amongst the lessons learned during such a project, the author mentions:
Most of the programming tasks require minimal knowledge of arithmetic and algebra skills. To start programming, a kid needs to understand what x = y+2 means. Another important concept to understand is an if statement.
Kids develop the abstract reasoning abilities by the fourth-fifth grade, and they also easily perform such tasks as browsing the Web, downloading and installing software. Dave have learned how to type, compile and run Java programs in Eclipse IDE in no time.
Kids learn much faster than adults, but they do not have "previous programming experience", which may actually be a good thing, because they do not have to switch from a procedural to object-oriented way of thinking. After learning about inheritance, Dave called my wife a superclass.
Adults are responsible creatures, and they can keep doing boring operations much longer that kids. Programming lessons with kids have to be short. One or two 45-minute lessons per week is enough. High school kids should be able to study more, but I do not have such experience yet.
Illustrations help. In my book I've included lots of color cartoon-like characters that are like a Java-fabric softener.
Kids like to see immediate results and enjoy playing with shorter programs, for example a class Fish has a method dive(int howDeep). Let me try to call this method several times with different arguments...
Graphical programming is the most fun, and even a fairly large program like Calculator, Tic-Tac-Toe or Ping Pong can be explained to children.
Have you looked into BlueJ? I know you said you're leaning against IDE's but it is an IDE specifically geared towards teaching Java. Also it seems to have some things that an 8 year old might find cool like graphical representations of class structures.
I think Greenfoot is better than BlueJ, for 8-years old.
It is developed by the same people that made Bluej, but it is way more graphical, still allowing full Java programming of the applications.
http://www.greenfoot.org/getting-started/
1- download and install JDK
2- then download and install greenfoot, and you are ready to start
3- check out the nice and easy tutorial CrabWorld: http://www.greenfoot.org/scenarios/files/crab.zip
I recently used GreenFoot to discuss Java programming in a very short introductory course for high-school students at our university: http://aaue.dk/~av/brobygning2008-software/ (if it could be of any use).
If supporting Java is not a fundamental feature, you could also try MIT's scratch (a stand-alone version of squeak): http://scratch.mit.edu/
It is very good for starting, and I used it 2 months ago in a PR activity involving 2 13-years old. After less than 1 day of fiddling with scratch they made their own videogame:
http://aaue.dk/~av/personal.html (the "Damn" game, they called it like that :> )
but it is programmed in its own (visual) programming language...
Just make the learning fun and all the rest will follow !
Amazingly Scala might be the easiest language if you try Kojo
(Scala is better Java, you have access to all Java libraries of course)
I know its not java but a friend of mine homeschools his kids and he's using
alice - teaching programming in 3d
I know you asked for Java, but I am going to go out on a limb and suggest looking at the Ruby-based Shoes: http://shoooes.net/ and http://hackety.org/press/
I believe it was originally written as a teaching aid.
If I was a kid learning to program, this would interest me.
i would try python because
1) Python comes with a decent REPL - Idle .. rather than writing long files of code, javacing and then javaing it.. having your expression evaluated the moment you put it in might better suit the attention span of an eight-year old... u can still make functions and modules and stuff.. but in a more interactive environment
2) python does not have strict typing and allows you to play with dictionaries and variable-sized linked-lists with very little syntax.. that way.. you could teach him some of the big ideas behind programming first and leave learning lots of syntax for later when he is already very involved in this stuff
check out http://openbookproject.net//thinkCSpy/
I'd go for scheme. Anyway, take a look on this site, it has some Java and pedagogical resources: http://www.teach-scheme.org/
There is an interesting Google Tech Talk on Teching Kids to Code - it covers a piece of software called Greenfoot which is an introductory programming tool that uses Java. It uses drag-and-drop and other visual methods of interacting with classes.
I would not start a child with Java. Teach him something more conceptually clean first. Something like LISP, or Logo. Logo is a surprisingly powerful programming language, and it's a blast to learn since it's visually engaging right out of the box.
Find something that would be interesting to him as a project, particularly if you can work out a way of it not involving a GUI. I believe that GUIs help to get people interested, but they're fundamentally hard - trying to learn both a GUI framework and a language at the same time is too much, IMO. I like console programs - a short console program has everything right in front of you, so you can understand every single character relatively easily.
For instance, if he's interested in football you might have a text file with results in, and make a project which read in the data, worked out who had how many points etc.
EDIT: Another thing to think about based on VonC's point about "let's try ..." - perhaps start with an interactive language such as Groovy (which is very like Java) or find a "Java shell" of some description to allow your son to "explore" the language by executing things immediately.
I'll be very interested to watch this thread - I really want to teach my kids to program
in a few years, and I'd like to write an introductory C# book before then...
I randomly noticed today that Sun/Oracle has a page dedicated to young developers. I thought it might be a useful reference page.
It has links to BlueJ, Alice, and Greenfoot (all already discussed), as well as a couple of other resources.
I suggest "Programming Video Games For The Evil Genius" by Ian Cinnamon. The author was 15 at the time he wrote the book..... Anyway the book is relatively easy to follow and teaches you how to do some gamelike things with Java. Because let's be honest, most kids want to make video games. Back when I was 10 or so I was making Visual Basic programs that were text based adventure games. This dream of making video games sticks throughout high school. Anyway the book shows a lot that you can do with Java on that front.... Nevermind what a 29 year old would be doing with a book written by a 15 year old whistle. I was 28 when I bought it......
Anyway Java having so many libraries makes it fairly easy to get graphics up. Qbasic had sucky graphics but it had fairly simple calls to turn pixels on and off and draw lines and when I was 12 or 13 a lot of us would just make weird effects with the graphics in QBasic using loops, etc... While it was a complete waste of time, it further helped to strengthen the concepts of iteration, arrays, etc....
So anyway based on my experience and the experience of my friends who could program at the time, I'd say kids like bells and whistles graphic effects and to create video games. Even text games count. The fact that Java has tons of libraries that do a lot and free the programmer from the implementation details means that if Java was around when I was that young, I would probably have been tinkering with it. Add in a book written by a 15 year old on simple video games in Java (note he's not a normal 15 year old, the kid was a Sophomore at college at the time....so think Child Prodigy) and you have a recipe to hook your kids interest.
If Java's verbosity is too much to keep your kid's interest, try Python. I think I remember seeing a library for making 2d games there....... But at the very least it can probably make much better text adventure games than qbasic :)
Once you got your son started you can try CodeInvaders, competition can be very useful to get him thinking, maybe even father-son competition.
CodeInvaders # IBM
This question is similar to https://stackoverflow.com/questions/165905/how-and-when-do-you-teach-a-kid-to-code#165909.
My oldest is also 8 and I know he has the right brain for programming but he takes his time. I think you should keep the assignments small but they must have early results. Else they can get disapointed.

Categories