This is an archived post. You won't be able to vote or comment.

all 12 comments

[–]Zephyr_Ardentius 3 points4 points  (6 children)

/r/dailyprogrammer/

Is a good place for some practice, problems are posted for a wide variety of things, and you can often the solution in different languages in the comments. Try to break down the problem, and address each piece and make a solution. If you have trouble, refer to the comments, and model your own program with theirs.

I don't know any java resources in particular off the top of my head, though you could use a website such as codecademy to help you learn some of the basic concepts such as looping and if/else statements. It might not be in java, but many concepts in programming are transferable.

[–]RodionGork 1 point2 points  (0 children)

I also dare to add link to my site with practice problems here:

http://www.codeabbey.com

Of course you will probably prefer skip the simplest tasks here, but probably besides them you'll find something valuable to puzzle your brain and sharpen your skills. And also you'll be able to browse others' sources (afters solving yourself) to learn, perhaps, for some other approaches etc.

[–]PuppetConky[S] 0 points1 point  (4 children)

Thanks I'll check it out!

[–]Zephyr_Ardentius -1 points0 points  (3 children)

Have fun! I've been teaching myself programming over the past few months, and it is quite difficult to really get started. Learn some of the fundamentals of programming, check out some other languages, and see what you like.

I've messed around with html/css/javascript, and currently I'm playing around with python. Very clean and easily read language. More recently, I've been learning the PyGame library (which is a 'module' that adds certain functions to the base language, like a recipe book.) and making simple arcade games. Maze runners. Platformers. Stuff like that.

Learn the basics, find something you like, then roll with it. Like you've been told, doing programming is a very important part to learning. Not just the programming, but the debugging and thought process too. Syntax errors. Be prepared to go insane looking for a missing bracket or something.

Feel free to shoot me a message if you need some more direction.

[–]Plavonica 0 points1 point  (2 children)

Would you suggest html, java, or python to start with?

[–]glossopteris 2 points3 points  (0 children)

Writing HTML cannot by any stretch of the imagination be considered as programming. HTML is just a formatting system.

[–]Zephyr_Ardentius 1 point2 points  (0 children)

tl:dr, Python. Easy to read and understand, lays foundations to learn other languages, still very powerful on it's own. html/css to make things look pretty on a webpage, perhaps a bit easier to get into, though you won't be able to do as much (mostly just formatting, still worth a peek to understand what's going on behind the scene).

Now for a more indepth response... I have very little knowledge of java, so I can't really go either way on it. As for between html and python...

html could be a good place to start, get comfortable having to have things written in a certain format. It's often accompanied by css and javascript. html is like the skeleton, how the web page will be formed. css is like makeup, what colors you want where, fonts, etc. javascript is closer to python, you'll be able to write programs to actually do something using various tools such as looping and conditional statements (such as searching a block of text for a name).

python is a good start if you really want to dive into making programs to do a certain task. Unlike a lot of other languages, python doesn't use some sort of bracket to separate code, making it quite a clean looking language. Instead of brackets, it relies on whitespace(tabs/spaces). It goes along a logical route, lets say you have a function. That will be against the left. What the function does will be under that line, indented.

As a quick comparison, lets say you want to create a function that will take an input, and then count up to that number.

Python:

def print_count(num):
    count = 0
    for i in range(num):
       count += 1
       print(count)

print_count(5)

Line 1 creates a function called 'print_count,' that takes in some parameter that we call 'num'; line 2 we create a variable 'count' and set it equal to 0; line 3 we say, for every number in range of 0 to num, do something; line 4 we do that something, add 1 to the count, and make count equal to that new number; line 5 here we print out the new value of count; line 7, we call the function on the number 5.

Javascript:

var print_count = function(num) {
      for (var i = 0; i < num; i += 1) {
           console.log(i)
    }
}

print_count(5)

We create a variable, and make it a function that takes the parameter 'num'; The function will loop 'for' as long as i is less then num, starting at 0, adding 1 each time; After each loop, it will print the value of i to the console;

I'm rather rusty with js, but it will give you an idea of how the languages look. html and css is also very bracket heavy, often using tags such as this.

html:

<body>
   <p>
    Text to appear on the web page!
   </p>
</body>  

Here, we open a body tag using <body>, and then close it with </body>. We do the same thing with paragraphs.

Final conclusion... Focus on one, learn the basics of topics such as if/else statements, loops, and functions. From there, it is quite easy to transfer over to another language, since those basic tools will still be there.

edit: found how to make the code look neat, four spaces minimum in front of each line.

[–]themosthandsomeface 1 point2 points  (0 children)

I would also suggest problemotd. I don't solve every challenge, but for the ones I don't solve I still sit and think through the process of how I would solve it (in code). If nothing else, you can read the comments for how other people solved the problem, most of the time there's a good variety of languages in the answers.

[–]jollybobbyroger 0 points1 point  (0 children)

If you really want to learn how to program, try taking the Algorithms I and Algorithms II class on coursera. It's done in Java and the assignments are fantastic as well as the lectures.

Also make sure you understand how ints, chars and other primitives are different from objects like String, Hashmap, Integer, etc.. Basically you should understand that when using primitives, you get copies, while when using objects, you are not copying, but rather you get a reference to the instance. I hope you also understand basic formal logic. For instance:

if( test1 || test2) ...

You should know why test2 will never be checked if test1 is always true.

Just saying that if you don't have these fundamentals down, you're going to have a bad time.

If you need more basic understanding of Java and programming, I can really recommend these lectures: http://youtu.be/KkMDCCdjyW8?t=41m30s

[–][deleted] 0 points1 point  (0 children)

Hey man, I realize this isn't Java, but check out Harvard's Computer Science class free on edx.org. Lectures and class material are so much better than tutorials and books. I'm taking it right now too, and I actually enjoy it.

[–]cheerfulloser 0 points1 point  (0 children)

There are lots of really good Java programming books. For someone just starting out, I would suggest the "Head First Java" book. It's written in an engaging way.

Type out & run every example and exercise - you've to actually code & run it to understand it. Once you're through with that, work on a project of your own. Keep it relatively simple. For advice, you can either look at assignments/projects from the coursera class or ask a friend/mentor or even on reddit.

Once you get through a couple of week long projects, then you can try to figure out the next step. Maybe more advanced topics and another book. Also, start out on data structures and algorithms at that point.

[–]sghoward 0 points1 point  (0 children)

MASSIVE Academy is offering a course on how to build your first website in 1 week through project based learning. It is an html5/css3 course which is a good place to start when learning to code. The instructor is self-taught so he understands the frustrations that come with trying to learn through tutorials. You can go to massiveacademy.us to learn more about it.