How can I quickly improve my abilities as a programmer? - java

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

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

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.

Roadmap to Android development

I've done a little research, and am interested in developing for Android. I've never programmed before, and have no idea how to go from zero experience to developing for a mobile device. My interest is in eventually making some sort of 2d game.
Is there a lesson plan for starting from the ground up? I would think one would need to learn the Java language to start. Looking at the Sun website, it's a bit daunting. Is there a book, specifically, that would wrap up this knowledge in a bit of a directed lesson plan?
I'm not sure if opengl-es is what would be required for 2d games. I've done a little research on this, and it's even far more daunting than Java itself. I can't even begin to figure out where to start with even just opengl, sans -es. My best guess would be that I need further knowledge in Java to continue with this, but even still, is it possible to learn concurrently with Java?
The typical answer from experienced programmers is that one should start with Java before moving on to Android-specific code, but I disagree. I think the most important thing for a new programmer is to be able to see the fruits of their work quickly and in a context that feels useful to them. In other words, you need to have some sort of personal project that you're trying to complete. This gives you more motivation than working on some random program in a textbook, and you learn by overcoming the specific obstacles en-route.
Now I must add that I am not an experienced programmer, and I have never tried to teach anyone to program. In that sense, CommonsWare's comment should hold more weight as he has written multiple books on the issue and thus has experience as an instructor. However, I speak as someone who has taught himself to program in Android-Java essentially from scratch. I had dabbled in a few languages like VB (for Excel macros) and C, but I never wrote anything more than about a hundred lines of code long and didn't know anything about object oriented programming.
Of course, doing things this way will be messy. You'll often read tutorials and be confused by why they are doing things the way they are, or for example, what they mean by a "private static" integer or class inheritance. You'll also program with poor style, solving problems with a clumsy or inefficient manner. However, I think these problems are outweighed by the benefits of personal motivation. It's much easier to study something if you know why it matters to you.
The trick however is to make sure you choose easy projects to start with. You must realise that programming anything useful will appear complicated and difficult. Trying to start with a 2d game will not work; there is just too much to learn first. The best place to start is the tutorials on the Android Developer's website. Work with those and see if you can modify them a bit to do different things.
After that, see if you can find some simple things that irritate you with your phone (note: I'm assuming you actually have an Android phone), or things that would make life easier. In my case, I wrote a few very basic programs to do things like change the volume of my ringtone at one press, to go from silent to mid-volume and vice-versa.
Once you've done that, you can tackle bigger projects. Of course, eventually you're going to have to knuckle down and read the 'proper' Java tutorials as you can't bumble along half-blind forever. But to reiterate the point, I think it's much easier to learn if you know why it matters.
Above all, be patient and persevere! It's fun once you're past the initial bewilderment!
For learning Java I would recommend a book like Big Java or Core Java. Only once you are comfortable with the language would I recommend moving on to mobile development. I have never done any Android development myself, but recently worked on a J2ME project and I found that books weren't much help. Instead it was best to just start working on tutorials you can find online then gradually work your way into developing small simple apps for yourself. Build your app bit by bit learning as you go.
Probably the most confusing part of it all is learning how the langauge all ports to the new platform and getting your head around building and deployment. But if you start off with small samples you will come across these hurdles early on while it is still easy enough to work out what you need to know, and then you can come back here with specific questions and no doubt there will be a number of people who can help.

strategies for learning complex software packages

I am a fairly novice Java programmer and I am currently working on a project to extend a piece of software that has been developed over a few years.
So it has pretty big code base and the previous developers knew it well, so extending it is not going to be easy without a thorough understanding of the structure and function.
1) I had begun by trying to tackle small parts of the system and document them with mindmap. (particularly I am trying to document the interactions with external systems)
2) I have the book "code complete", which I am working through.
3) I have pointed some tools like "tattletale" at the code to get some diagrams of dependency relationships.
What other strategies should I employ, should I focus on one particular aspect?
10 Start small.
20 Break things.
30 Then fix what you broke.
40 Goto 20
Maybe you could try to model the problem the program is meant to solve. If you have a clear understanding of the problem and limitations imposed on the solution, then it should be easier to understand the program itself. I am just guessing here, as I do not know what sort of program it is.
It is important for you to find a good coach on the project. Go for a nice guy, who knows the system and who likes to answer your questions.
Also have the architect explain you the system. If it is a good one he can point you to the important parts and point you away from the parts you do not need to know (yet).
Then try picking up small issues. Even stupid error messages and go from there. In a few weeks you should be able to grasp the basics of the system.
Good luck!

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