views:

433

answers:

9

I am a beginner to programming. Should I like learn them side by side ? Now that I know DS and Algorithms form the basis of programming..Should I learn them first ?

I am confused. What should be my learning path ?

I want to be a really good Java programmer.

+15  A: 

I think it's fine to learn the two side-by-side. If you try to just learn the data structures and algorithms first without doing any programming, it will all be a bit abstract - I think you're likely to learn more effectively if you can use what you're learning in a practical context. It also means you can experiment with what you're learning... it's harder to experiment in a theoretical way.

Jon Skeet
okay..thanks for answering :)
Serenity
+3  A: 

I think that you should learn only the very basics of java, then begin to learn about data structures and algorithms side by side with some more advanced java. If you start looking into things like algorithms without learning at least some language constructs, things are going to be hard to grasp.

bennybdbc
+1  A: 

Most data structures books are going to be rooted in some programming language. I would suggest finding one that uses Java and go from there. That being said, DS and algorithms are great, but those alone won't make you a 'really good Java programmer'.

Here's a link to a Google Shopping search for Java data structures books. I'll date myself by saying that I've never read any of them, and the DS book I read in college was written for C.

You should also have a look at the Pragmatic Bookshelf (Google it, I can't paste multiple links with my low rep) as well, they have books about the craft of programming, rather than just languages. Very handy indeed.

WineSoaked
+1  A: 

Definitely my recommendation is to learn algorithms first and data structures after....and then a programming language like Java. I talk by my experience.

Milena
+3  A: 

My recommendation:

1.) Learn the basics

Learning the Java Language

(excluding the Generics chapter, this is more of an advanced topic)

2.) While learning the basics, practice your gained knowledge by solving simple exercises

Coding Bat

3.) Start implementing simple algorithms, learn how to use recursion

  • Bubble Sort (only for practice, don't ever actually use this)
  • Insertion Sort
  • ...

4.) Grab a good book about Data Structures and Algorithms and start learning them

Helper Method
Binary Search is such an algorithm that looks extremely simple but is difficult to implement correctly. I don't think it should be in "simple algorithms"; I have seen my share of incorrect implementations in production code.
Ritsaert Hornstra
@Ritsaert You're absolutely right. When I first implemented it for an assignment, I also got it wrong ;-).
Helper Method
+2  A: 

Often we programmers never learn to be good programmers.

The language we jump into first has too much influence on how we think about problems. Later, we may learn other languages but we continue to write programs as though we were using the first.

Our horizons are clipped by that start language (e.g. Java) or paradigm (e.g. object oriented).

Although we sense we are lacking something, we are too busy fighting alligators to drain the swamp that bogs us down.

My advice is don't jump into Java, or anything else too quickly. Expose yourself to a progression of languages right from the start. You'll end up a better Java programmer.

This is a really good path to follow:

http://www.teach-scheme.org/Overview/

pbernatchez
+1  A: 

I would personally reccomend you learn Java, although most programming languages will do. Although Algorithms and Data Structures are an important part of programming, they are not the only one. It is useful to be familiar with a programming language when studying any subsection of the software engineering realm, such as A.I. or Data Structures, as it gives you a deeper understanding of the inner workings of the algorithms. It is important to be able to read pseudocode and translate it into actual working code.

The Sun Tutorials are great as they cover a large amount of material, both beginner (see the Language Basics section) and advanced.

This free online Java Textbook is great as it can be viewed online, or offline by downloading a free PDF version.

I would then recommend some practice to fully grasp the language, either by working on some small personal projects (simple text games, utilities, etc.) or by studying some open source code. Sourceforge is great for this.

Also, if you enjoy mathematics, Project Euler is an excellent way of learning Java (or any other language as the challengs can be solved in any language). This will also help you develop the skills necessary to work with algorithms and solve them.

Once you feel you have a good grasp of your language of choice, moving on to Algorithms and Data Structures will not only be easier but more enjoyable. Your ability to translate pseudo-code into working code will come in very useful as you can truly understand the workings of the algorithms and data structures and can implement them in test applications.

Dominic Charley-Roy
A: 

As Jon said it is a good idea to learn them side by side I recommend you to use a programming language like python or ruby to practice the implementation of the data structures and algorithms.

The translation of the algorithms pseudo-code to one of these languages is very easy and it looks almost the same. I think it is a little more difficult to translate pseudo-code to Java than pseudo-code to python

Enrique