tags:

views:

233

answers:

16

I'm coming to the end of my intro programming class, we're using java and have been doing command line programs so far, no gui's which I've enjoyed quite a bit. So far in the class the programming assignments have been somewhat challenging but leave me wishing for a bit more. I find myself wanting to write a program when I'm bored but always have a hard time figuring out what to do.

I'd like to know if anyone has any good advice on programs I could write, or work on, at this point in my development to challenge me and help reinforce the concepts that I've been learning in class. The class hasn't been too fast paced, so far we've only covered up through classes and objects(though not yet inheritence or polymorphism) and are working with arrays now. I feel comfortable with all of the stuff we've been doing in class as I had been introduced to it a bit on my own studies before starting classes.

Any advice on things to keep me busy would be greatly appreciated.

+1  A: 

Writing a simple game, like sollitaire, maze, etc. is a good starting pointed for many development issues and concepts.

Am
+3  A: 

This might be a huge step, but if you are familiar with Arrays try looking at some Data Structures they are very useful in understanding Java concepts.

Some of my intermediate projects with Java:

  • Designing simple shapes using the Swing framework
  • Reading contents of a file using FileReader
  • Using the Scanner function to recieve input from user via the console
Anthony Forloney
The swing API is difficult to deal with at times, so don't be discouraged if it doesn't make sense immediately
inspectorG4dget
+2  A: 

Write Tic Tac Toe with a GUI

davidrobles
Try making the AI undefeatable (it either wins or draws no matter what). First on a 3 X 3 and then on a 4 X 4 . This would be a good programming and problem solving activity.
Jonno_FTW
You might want to start out by making a two player version, first. That would be easier to write after which you could upgrade your code to single player mode, which is where you would make the AI undefeatable
inspectorG4dget
A: 

A typical progression path is to study algorithms and [data] structures. This may seem boring but will provide you with important skill for the long haul. To give you an idea of the kind of stuff this is about, check MIT's Open CourseWare 6.006. You do not necessarily need to follow this class in full (just to give you an idea of what is meant by algorithms and data structures.

Alternatively you can try and develop a game, by leveraging existing libraries, but the risk is that you'd develop somewhat of a superficial understanding of things. (Enough to "glue" various things together...)

To be sure a video game would be much cooler to demo to your boy/girl-friend than say a fancy sort algorithm ;-)

mjv
For my Data Structures course in my junior year in college, we had student code contribution and someone did a step-by-step selection sort with a GUI. Its kind of the best of both worlds :)
Anthony Forloney
+1  A: 

Work on something visual...it will be more fun. Create a game and use tweening effects. You'll be forced to think about timing, callbacks, handling user interaction...

milesmeow
+3  A: 

You could look for an interesting open source project that requires assistance and suggest your help.

artdanil
Help may include writing documentation, as you can only write _good_ documentation if you understand the code.
Thorbjørn Ravn Andersen
+8  A: 

I would recommend Project Euler. It's a great way to exercise your mind, and implementing the solutions in an unfamiliar language is a good way to learn that language.

Austin Hyde
correct the url please to http://www.projecteuler.net/
artdanil
Very good suggestion, looks like there is plenty to work on there.
David Barry
Project euler is very good, problems range from basically translating the question into code all the way up to quite difficult mathematical problems.
Jonno_FTW
+5  A: 

I suggest looking for code katas (like these) or programming quizzes. Those are usually small enough to be done as practice and challenging enough to provide a learning experience.

Also, try reading code. Find an open source project that deals with the problem domain you're interested in and have a look at the code other people write.

springify
+1 for "reading code".
Ben Dunlap
+1  A: 

One of my favorite books, ever, on programming is called Software Tools in Pascal. This book has you implement a bunch of simple tools that work well together; basically you are re-inventing the basic command-line tools from UNIX.

I recommend you get a copy of the book (Amazon says used copies start at about $4 including shipping) and try re-implementing the programs from the book in Java. If you have just finished an intro-to-programming class you should be able to understand everything in the book; you may not know the syntax of Pascal well enough to write it, but you will find it easy to read.

If you do this, you will write programs that match strings, search and replace, compute keyword indexes, and expand macros. I guess you don't have to write every program in the book, but I do hope you will at least read through the book.

I read this book years ago, before "Agile" practices had been codified, and from it I learned a useful sort of agile-ish method of development. The book calls it "left-corner-design"; you start with some useful tiny subset of the program, get that working, then keep adding features one at a time until your program is done. The book walks you through examples of this.

I feel that much of my success as a software developer has come from the lessons I learned from this book, and I recommend it highly.

steveha
+3  A: 

You might want to tackle a new language. After Java, you could go down in power by trying C (and then try C++ later) or you could go up in power by trying Python. (Or Ruby, if you prefer, or even LISP/Scheme.)

If you try a new language, start by getting a decent book that teaches the language, with exercises. Try out the exercises, and see if they inspire you to do something new.

Once you have learned the basics of Python, you could use the PyGame library to write some sort of simple game. If you do this, you might want to get the book Beginning Game Development with Python and Pygame: From Novice to Professional.

Once you have the game working, be sure to share it with the world by putting it up on Github or some other code-sharing site! (Once you have a working game and you share it, someone may be inspired to take your game and add new features to it. Eventually your game may turn into something big!)

Or, instead of writing your own game, look at games written by others, and see if you are inspired to add new features. There are dozens on the PyGame web site, in various stages of completion.

P.S. Yes, I am pushing Python. I love the simplicity of the basic language and the power of its advanced features. You can use Python for everything from trivial system administration scripts to advanced AI. There are other good languages too, and I'm not looking to start a language flame war here, so if you want to learn something else, that's fine too.

I do strongly encourage you to learn by writing programs, and I do strongly encourage you to try different languages. I've found that I learned things in Python that have made me a better programmer even in C, a downright primitive language in comparison. After years of experience with C, I would not have expected a slower-performing high-level language to teach me cool things, but it did.

steveha
Python is the language I've played around with the most before learning java in class, and I should probably go back to it and play around with it some more. As for learning a new language next semester I'll be in the 2nd intro programming class which will continue with java and I'll also be taking c/c++ programming so I'm looking forward to working with a few languages at once.
David Barry
+1 Python, C/C++, Lisp, and Perl could be good choices for broadening the knowledge.
artdanil
steveha
Be aware that LISP and Scheme are functional programming languages and are therefore VERY different from the object oriented/procedural languages like Java, Python and C/C++
inspectorG4dget
That's why I said "*even* LISP/Scheme", because they are more "out there". But if you do learn them, it's a valuable new perspective. One great thing about Python: it includes both functional programming stuff and object-oriented stuff. You can start out with the easy, similar-to-Java stuff, then branch out.
steveha
+1  A: 

I would suggest creating a web-based application. Server-side development is one of Java's primary domains currently, and there are many important concepts that you would be exposed to that are very import and valuable to learn (and often not taught in schools).

Choose a simple data-tracking application that you think would useful to have. A recipe manager, sports stats collector, etc. Choose a database like MySQL to track the data and create a web based front-end to enter and view the data using Servlets. Once you see how painful that is, look at JSP, Spring, and other tools that will make it easier.

If you pick a project that you actually use, you will always have new features and improvements you want to make. This will keep you interested and will drive you to learn more. As you find areas that are repetitive or difficult to code, look for tools and patterns that other people have used to solve similar problems.

Having a real project will also force to you manage requirements, estimate scope, and crate priorities.

There can be a lot of interconnected libraries and many new tools to learn, but if you start with a simple Tomcat server running servlets that read and write to a database and build from there, it is very manageable.

Nathan Voxland
+1  A: 

Here's something fun to try: get one of the "robot combat" games where you write the code that drives a robot, then your robot is dropped into an arena with other code-driven robots and the robot with the best code wins.

For Java, there is Robocode.

There are others, in other languages. It's such a simple idea, it has been implemented many times by many people over the years.

The best games are the ones where strategy is the important part. If you never scan with your radar, you might not see another robot heading right for you. If you spend too much time scanning with your radar, you just sit there and get shot. You need to find the best balance of scanning, moving, targeting, etc. Do you pick one target, chase it while shooting until it is dead, then repeat? Do you drive randomly around in unpredictable patterns, while shooting anything you happen to see? What is the best strategy for a battle robot?

I haven't played a game like that in years. It was really fun; I should do that again. (I've been meaning to learn Java, and I'm planning to use Robocode as part of my Java education.)

steveha
+1 this sounds fun
echo
A: 

Write a program to pull the HTML source from a URL and output all the hyperlinks, one per line, like this:

Link1 Text: URL1
Link2 Text: URL2
...

You'll learn stuff you'll use throughout your whole career.

Hint: stay away from regular expressions for this. And write it in a bunch of different languages.
VB, Common LISP, Ruby, Scheme, ML, Prolog, Go, ...

Oh oh, or write a command-line program that prompts the user for a semicolon-separated string, and then split the string and sort the values using one of several sorting algorithms and print them out. and you get to code up the sorting algorithms!

So the user inputs hello;world;1;two;3;! and the program outputs something like

!
1
3
hello
two
world
echo
Could you actually write that in PROLOG?
inspectorG4dget
+1  A: 

I would strongly suggest doing some web development. Whether Java-based, Rails, ASP is not important but getting intimate with web technology is in my view necessary for a well-rounded programmer. Without web skills you risk getting stuck in the "engine room".

fredw
+1  A: 
  1. Try your hand at a new project. This could be anything that interests you, e.g. a small game, a simple music player, a basic picture viewer/editor, simple web app etc. Just choose something small enough to be manageable but not too trivial. This will help you get better acquainted with the language and its libraries.

  2. Try solving some of the simpler problems at sites like SPOJ, TopCoder and Project Euler. In addition to coding practice, doing these problems help in getting a deeper understanding and appreciation of problem solving and computer science in general.

  3. Get a good book on algorithms and data structures. CLRS is my favourite, but really any good book will do.

MAK
A: 

I would strongly suggest doing some web development. Whether Java-based, Rails, ASP is not important but getting intimate with web technology is in my view necessary for a well-rounded programmer. Start with HTML, CSS, then some JavaScript, Ajax, jQuery. Fred

fredw