Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

This question already has an answer here:

Yes, practice, practice, practice. I know the drill people suggest that helps learning new programming concepts. But that's only theoretical.

For me, even a line of code like this is new (Java) and really hard to grasp:

Integer.toString((byteData[i] & 0xff) + 0x100, 16).substring(1)

Now, I could start looking at byteData and then trying to figure what 0xff means and so on. But each of those 'elements' leads to more elements, and by the time I start getting what one means, I forget where I was. It all leads to chaining - massive chaining of concepts.

Just last month, I wanted to learn about threading in Java, and one thing led to the other, and after a week of thorough research, I ended up using example code on Javadoc tutorials with few edits. But that's not how learning programming should be, I know. But I have been unable to find how it should really be.

I recently started learning Python, and there seems to be no way (IMO) to learn it in an organized manner. I start with one concept, which leads to the other (while the first one is still incomplete) which leads to the other.. you get the idea.

I'm an intermediary in Java and beginner in Python (although some concepts are transferable from Java). So, how should I go about all this making sure I understand what I venture into?

I'm sorry if this sounds like an off-topic question, it really isn't. It's a genuine question from a genuine guy who really wants to learn many programming languages, and build something useful for people.

EDIT: Just to be clear, I do not want to learn a new language. My question is not about learning a new language, but learning concepts of a language that I know something about.

share|improve this question

marked as duplicate by Caleb, gnat, thorsten müller, Martijn Pieters, jk. Apr 9 '13 at 8:53

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
That line is overly contrived anyway, could have just used String.format("%02X", byteData[i]). –  Esailija Apr 9 '13 at 11:27
    
the man who wrote that line Integer.toString((byteData[i] & 0xff) + 0x100, 16).substring(1) didn't want you to understand. Otherwise he would have defined a little one line function having a pleasing human understandable name telling what the function does and taking an integer as input parameter returning a string. –  Stephane Rolland Apr 10 '13 at 1:14

2 Answers 2

This is a good question. I don't think that there's really a good anser for this, and it's something I've struggled with a lot. I'm a student currently and I have an internship where I do .NET programming.

The biggest thing you can do is to just dive in, and stop referencing tutorials and examples online. Begin to learn the documentation and the language, and you'll be far more proficient, and you will understand the language completely.

If you're a student, take a class which uses the language you want to learn, even if it doesn't teach the language, being in a class will force you to learn it.

If you're not a student, work on a side project. Force yourself to use the language. You don't need to immediately understand everything that's going on, but you figure it out through trial and error. You don't necessarily need to understand everything as you read it, but you begin to understand more and more as you try new things in the project.

Even if it means developing the same project 50 times in 50 different languages, find something that will cover every area of each language

share|improve this answer

I would like to share my experiences how I learned a new language, namely Ruby (I haven't done a single line of Ruby before I start my current job.)

Programming is like swimming. There are hell a lot of theories behind it, but end of the day, what matters is the code that does the job.

TL;DR Create a controlled real environment, and build from scratch something you want to do.

In my case, these steps worked out.

  1. Set a controlled environment and goal. Without this, you will be looking for more questions than answers. For instance, when you want to learn about the threading in JAVA, you need to setup a least working goal for your task. There are will be millions of dependencies related to that, but you should not care those things. Example: I wanted to learn how to do multi-process ruby execution and management to speed up some work that I do in a normal routine. What i did is just assuming that each task needs to have "printf" thing to tell me where they are.

  2. Create your own example. I think this is important. Since most of the time, you are following other people's examples, you will inevitably encounter a bunch of black-box operations. Start fresh, build your own Makefile, etc. Example, I was responsible for creating a universal customized gem for our org. and I had to learn a bunch of modularization technique such as how I should build the gem structure. I started with a empty directory, and it seems everyone loves it now. Have faith in you, no pain no gain. AVOID IDE.

  3. Talk to people. You need to showoff your skills. That is important. Humans are lazy, and they tend to pretend they understood some stuff. By explaining to people, you will find new itchy details about the problem.

  4. Hobby project. This is needed if you have time. Refreshing your knowledge is always fun. :)

I will update my answer if you need more help on more specific parts.

share|improve this answer
    
Thanks for the answer. About the first point you mentioned, my major concern and the point of this question was how do I focus on one concept when it relies on other concepts that I do not know? If I do jump into them, I get lost, if not, then I don't understand it. –  Karan Goel Apr 9 '13 at 15:11
    
I believe there is no way of getting a true isolated knowledge but to accept it. One good way to get over the dependencies is to make sure you are trying to understand/compare the knowledge you want to learn with the knowledge at hand. For instance, you need to first know how to do "hello world" to understand the language basic mechanism. –  Hotloo Xiranood Apr 10 '13 at 10:00

Not the answer you're looking for? Browse other questions tagged or ask your own question.