RFI: the best way to learn a programming language

Message Bookmarked
Bookmark Removed

I want to (re-)learn Java. I've had a total of 2 years (1 ea. C++ and Java) so I know the fundamentals and I've made a ton of tiny sample programs before (though all my files are long gone and I'd be starting from scratch). Taking an actual course is kind of out of the questions, so I'm thinking either a really great book. So, my questions are:

-book or online tutorial/course/website? Which one?
-should I throw a Linux partition on my laptop for coding or just get a Win 7 compatible IDE like NetBeans or Eclipse? I haven't touched this shit in like 6 years so I have no idea what's good these days.
-is there any reason I should learn something that is not Java? (note that I'd rather learn something thorough than something that lets you do rly powerful stuff rly quickly like Ruby or Python bcz I wanna have like a deep understanding of what's going on under the hood and how all the parts are working together &c)

Homo schaduwkabinet (Stevie D(eux)), Tuesday, 19 November 2013 19:13 (ten years ago) link

so I'm thinking either a really great book or some sort of online thing

Homo schaduwkabinet (Stevie D(eux)), Tuesday, 19 November 2013 19:14 (ten years ago) link

I did some basic HTML/CSS refresher stuff on Codecademy earlier this year and liked that ok. and hey it's free.

http://www.codecademy.com/learn

dmr, Tuesday, 19 November 2013 19:23 (ten years ago) link

When it comes to what's going on under the hood, the deepest level would be assembly language, which exactly mirrors the instruction set of the CPU, but accomplishes tasks in painfully tiny increments. The next level up would be the services provided by the BIOS and OS, but that's going to be pretty specific to the OS you are running. Java is going to be another level of abstraction above the chip, BIOS and OS services, so it can retain the same command set across several OSes.

Are you hoping to accomplish something other than just feeling more in the know?

Aimless, Tuesday, 19 November 2013 19:27 (ten years ago) link

Easy answer: learn while writing something you’re interested in, e.g.

A web app: http://ruby.railstutorial.org/

A game: http://landoflisp.com/

Or, a monad: http://learnyouahaskell.com/

Allen (etaeoe), Tuesday, 19 November 2013 19:30 (ten years ago) link

i.e. immersion is crucial.

Allen (etaeoe), Tuesday, 19 November 2013 19:31 (ten years ago) link

i'd suggest taking on a real-life project in the language of your choice rather than going through a book or even online stuff because it seems like only savants learn stuff well that way.
yeah, java doesn't strike me as a language that is very under-the-hood unless you're fiddling with the compiler.

Philip Nunez, Tuesday, 19 November 2013 19:31 (ten years ago) link

Java isn’t the worst language to learn from a pedagogical perspective: it’ll introduce you to a broad spectrum of concepts. However, the tooling (i.e. the programs you’ll use to write and run whatever you write) isn’t the easiest to use for beginners (or experts, unfortunately).

Allen (etaeoe), Tuesday, 19 November 2013 19:34 (ten years ago) link

One more: if you’re interested in computation, rather than, say, writing applications: The Elements of Computing Systems is EXCELLENT. The first chapter covers Boolean logic, the next, Boolean arithmetic, a few chapters later you’re constructing a CPU, then a compiler, and finally an operating system and a game (a Tetris clone). This may sound like a lot, but it truly isn’t. In fact, this book is a very readable few hundred pages and assumes no prior information (it’s used in freshman computer science courses). Moreover, all the materials are free on the website: http://www.nand2tetris.org/

Allen (etaeoe), Tuesday, 19 November 2013 19:39 (ten years ago) link

Java and Python are at similar levels of abstraction imo; they're obviously quite different in other ways.

What's your ultimate goal here? Are you aiming to get a job programming or is it just a bit of fun?

famous for hits! (seandalai), Tuesday, 19 November 2013 19:40 (ten years ago) link

idk I don't really have a specific project-oriented goal per se but it seems like it'd be a good thing to learn for a career in IT and I'm also thinking of tackling Hadoop which is Java-based

Homo schaduwkabinet (Stevie D(eux)), Tuesday, 19 November 2013 19:46 (ten years ago) link

so yeah I really enjoy doing it when I do do it and it would be fun to have someone pay me to do it

Homo schaduwkabinet (Stevie D(eux)), Tuesday, 19 November 2013 19:46 (ten years ago) link

like fixing ppl's Excel formulas is by and far my favorite thing to do at work

Homo schaduwkabinet (Stevie D(eux)), Tuesday, 19 November 2013 19:47 (ten years ago) link

I know so little abt the actual differences btwn different languages; I remember C++ and Java being p similar iirc

Homo schaduwkabinet (Stevie D(eux)), Tuesday, 19 November 2013 19:52 (ten years ago) link

if you write an excel clone in java (or any language) as a learning project, it has a good chance of being better than most excel clones.

Philip Nunez, Tuesday, 19 November 2013 19:56 (ten years ago) link

Whatever language you learn, make sure it has a good debugging environment in the implementation you are using. Novices write buggy code and finding your own bugs and correcting them forces you to see your logical and structural errors much more clearly.

Aimless, Tuesday, 19 November 2013 20:52 (ten years ago) link

Learning java atm using eclipse, but in evening class so obv not struggling for structure or motivation that way

30 ch'lopping days left to umas (darraghmac), Tuesday, 19 November 2013 21:34 (ten years ago) link

IMO 2-3 hours of programming firsthand is probably worth a good 10 hours of reading (once you know the basics of Java that is)

frogbs, Tuesday, 19 November 2013 21:44 (ten years ago) link

Well I mean yes it will definitely be some sort of hands-on thing so if it's a book it will be a book that walks you through actual stuff to program and not just like reading text and doing nothing

Homo schaduwkabinet (Stevie D(eux)), Tuesday, 19 November 2013 21:46 (ten years ago) link

but I still don't know which learning resource to use (I thought abt CodeAcademy but they have no Java ;_;)

Homo schaduwkabinet (Stevie D(eux)), Tuesday, 19 November 2013 21:48 (ten years ago) link

http://pleac.sourceforge.net/pleac_java/
This is an interesting reference project where it recreates a perl reference book in other languages.
There's a lot of it unfinished, and if you contribute to it, you'd not only learn the topics, but you'd help finish a reference used by lots of people.

Philip Nunez, Tuesday, 19 November 2013 21:54 (ten years ago) link

There are layers and layers of theory and practice - obviously you need experience in writing code to grasp a lot of ideas but you can also fall into bad habits if you don't know why and when to use the various tools in the language. Just because you can use a linked list in a given situation doesn't necessarily mean you should.

famous for hits! (seandalai), Tuesday, 19 November 2013 22:06 (ten years ago) link

Yeah would definitely recommend against just hacking away by yourself on a project without supplementary materials. If you want to get beyond the basics you need to have a broad understanding of the pluming of the language (things like performance, memory management and threading) as well as a solid grounding in good coding practices (design patterns, unit testing, code clarity). If your anything like me you'll be lazy when coding on your own and skip all that stuff. I'd try contributing to a well-run open source project that would enforce those kinds of things.

bert streb, Tuesday, 19 November 2013 22:31 (ten years ago) link

I found this, it looks like some p good resources

http://www.onvard.com/tracks/best-way-to-learn-java

Homo schaduwkabinet (Stevie D(eux)), Tuesday, 19 November 2013 22:56 (ten years ago) link

"Yeah would definitely recommend against just hacking away by yourself on a project without supplementary materials."

I agree with everything else but disagree with the supplementary materials part if they refer to textbooks and "how to learn X" kind of things. In contributing to a well-run open source project like you suggested, I suspect you'd be exposed to material and practices that are way more conducive to learning than explicitly pedagogical stuff.

Philip Nunez, Tuesday, 19 November 2013 23:45 (ten years ago) link

Like I said in the what you're into thread, I have never been able to just use one of those dummies/21-days/etc books. The way I've learned to program in the past through taking a class (with the exception of QBASIC). The structure of lessons and homework always works better for me. After I've learned the basics of a language, I've gotten more advanced by starting a project I find interesting and use reference books to get it done. I haven't done any programming in several years so I'm afraid I've forgotten it all. I think I'm gonna check out that code academy site!

Viceroy, Wednesday, 20 November 2013 01:09 (ten years ago) link

'hello, world!'

j., Wednesday, 20 November 2013 01:14 (ten years ago) link

Yeah I agree that going through one of those "how-to" books is a total chore. But OTOH there are some things that you're never going to learn just from coding. Like, it's hard to spot that someone is using a standard design pattern without having read about it previously. You need to read something outside of just the codebase you're looking at.

Of course you can do all this with online materials now, but I tend to think of technology books more like handy collections of high-quality essays--with the added benefit of being able to read them without staring at a screen. And really I'm talking more about more detailed books on particular subjects (like the classic Design Patterns book) than how-to books.

bert streb, Wednesday, 20 November 2013 01:21 (ten years ago) link

Yeah, taking an intro C++ class should drill good programming habits into you and Java is very similar to C++.
C++ is less forgiving in many ways. In my experience, C++ forces you to think more about efficient program design, which is pretty key to success.

brimstead, Wednesday, 20 November 2013 01:25 (ten years ago) link

I mean I work 45h a week and cannot really afford the time or money to enroll in a class though

Homo schaduwkabinet (Stevie D(eux)), Wednesday, 20 November 2013 01:34 (ten years ago) link

just get an o'reilly book

j., Wednesday, 20 November 2013 01:39 (ten years ago) link

Nooooooooo!

Philip Nunez, Wednesday, 20 November 2013 01:46 (ten years ago) link

Well, it does depend on how you learn, but I tend to agree with the majority on this thread.

What I would do:

(1) Do tutorials explaining/teaching the basics (don't get too bogged down in the stuff you don't understand)
(2) Build stuff. Anything. However easy. Most likely you'll first want to build stuff that is way over your heard, so contributing to a bigger project is a good call.
(3) My contribution to this thread: GET A MENTOR!

(3) is so nice, if you can get one. Doing stuff for the real world helps a lot, and speaking with others who are far more experienced will help you improve faster. Sometimes there are communities around town; have a look.

Good luck!

c21m50nh3x460n, Wednesday, 20 November 2013 02:02 (ten years ago) link

just don't be one of those assholes who writes spaghetti code

brimstead, Wednesday, 20 November 2013 02:48 (ten years ago) link

comments! understandable variable names! comments! understandable variable names! comments! understandable variable names! comments! understandable variable names!

Aimless, Wednesday, 20 November 2013 03:41 (ten years ago) link

Gonna post thoughts in this thread but first I need to go buy some Drano

i too went to college (silby), Tuesday, 26 November 2013 17:57 (ten years ago) link

I'm working through the Java Tutorials on the Oracle website atm and trying to supplement them with other exercises.

Homo schaduwkabinet (Stevie D(eux)), Tuesday, 26 November 2013 18:34 (ten years ago) link

If you want me to zip u my course material and weekly assignments let me know...

30 ch'lopping days left to umas (darraghmac), Tuesday, 26 November 2013 18:39 (ten years ago) link

This doesn't apply for everyone, but what works for me is to sit with a stack of manuals and jump straight in at the deep end... think of something to code, and then gradually figure out how to code it and achieve the results you want. That's basically how I learned 68000 assembler years ago, although I don't recommend this method to everybody... it requires a lot of time and patience, and you may crash the shit out of things a fair amount of times, but ultimately it's rewarding.

zip-a-dee-doo-dah, motherfucker! (Turrican), Tuesday, 26 November 2013 18:48 (ten years ago) link

Whatever language you learn, make sure it has a good debugging environment in the implementation you are using. Novices write buggy code and finding your own bugs and correcting them forces you to see your logical and structural errors much more clearly.

― Aimless, Tuesday, November 19, 2013 8:52 PM (1 week ago) Bookmark Flag Post Permalink

^ Absolutely agree with this, although one doesn't necessarily have to be a novice to write buggy, awful or unclean (spaghetti) code! It's going to be inevitable at some point that there's going to be a bug in something you've coded and it helps to have the tools to help find those bugs. Especially if it's quite a long slab of code!

zip-a-dee-doo-dah, motherfucker! (Turrican), Tuesday, 26 November 2013 18:53 (ten years ago) link

68K assembler.. hm.. sega genesis had 68k processor.. hm.. turrican was a game for genesis.. hm..

Philip Nunez, Tuesday, 26 November 2013 18:54 (ten years ago) link

you can always just trace your code ON PAPER

j., Tuesday, 26 November 2013 18:54 (ten years ago) link

68K assembler.. hm.. sega genesis had 68k processor.. hm.. turrican was a game for genesis.. hm..

― Philip Nunez, Tuesday, November 26, 2013 6:54 PM (1 minute ago) Bookmark Flag Post Permalink

There were a few platforms that used the 68k series, from what I remember? I learned on a Commodore Amiga, though.

zip-a-dee-doo-dah, motherfucker! (Turrican), Tuesday, 26 November 2013 18:58 (ten years ago) link

If you want me to zip u my course material and weekly assignments let me know...

― 30 ch'lopping days left to umas (darraghmac), Tuesday, November 26, 2013 1:39 PM (22 minutes ago) Bookmark Flag Post Permalink

omg for java? for real? I would be like infinitely grateful!!

Homo schaduwkabinet (Stevie D(eux)), Tuesday, 26 November 2013 19:03 (ten years ago) link

Sometime this week i'll get time....let me know how to get them to ya

30 ch'lopping days left to umas (darraghmac), Tuesday, 26 November 2013 19:05 (ten years ago) link

OK gonna dump some thoughts in here, ymmv and I apologize if any of this seems too elementary to be relevant to your current needs.

First of all, there are two skills that are indispensable for programming: being able to touch-type quickly, and being able to program in your head. Typing quickly is a prerequisite (practice!), and being able to program in your head will be your barometer of when you've got the hang of things.

It's really important as a learner that you be as comfortable with your programming environment as possible. Learning a new tool or a new operating system on top of learning a new programming language or learning the concepts of programming in the first place will up the difficulty level of your task unnecessarily. You've had a couple years of school experience with coding already, so you may be familiar and comfortable with a certain set of tools already. No two workplaces will have the same standards and systems for coding, versioning, and building software, and there's not really a point in trying to simulate a particular kind of "professional" experience while experimenting and learning on your own. In other words, just keep doing whatever you're doing. Setting up a Linux partition or VM could be a great learning experience too but learning Linux system administration is a whole separate set of skills that involves rather a lot more cursing than programming does on its own.

i too went to college (silby), Tuesday, 26 November 2013 19:22 (ten years ago) link

The choice between learning Java and some other language is not a particularly dire one. You can re-learn Java now and learn Python or Ruby (or both!) later. The languages mentioned in particular differ fairly little in style, and the differences between Python and Ruby are almost entirely aesthetic for your purposes. Java won't give you a particularly more "low-level" or "thorough" understanding of programming in and of itself than Python or Ruby would. All these languages have loops and variables and objects and whatnot. You can find a lot more accessible and interesting introductory material using Python or Ruby as the teaching language compared to Java. (At least such is my perception.)

If you find yourself getting stuck or bored after working through tutorials for a while, that's the time to figure out a project or goal you want to work on. Setting up and running something on Hadoop would be a rad goal, but of course that again brings up the issue of having to trudge through all sorts of ancillary environment setup concerns just to try something out. The thing that motivates me most to learn stuff is to come up against a problem that I know I can solve by writing code, but don't yet know how to solve. Most recently, at work, I started learning to use R (a programming language and environment for statistics) so I could generate some cool graphs and statistics about my team's trouble-ticket load. It was great! Really anything will do. Various kinds of text processing often motivate Linux/command line nerds, plenty of people want to make neat websites and so learn JavaScript, if you're modding a game that has Python or Lua hooks you can learn that, you can write your own text adventure, or just decide to implement a data structure in Java.

i too went to college (silby), Tuesday, 26 November 2013 19:37 (ten years ago) link

Which brings me to this: Any sort of "intro to CS in Java" book or curriculum, once it's taught you about functions and variables and loops, is going to basically have you learn about and implement a variety of elementary algorithms and data structures: sorting, searching, recursive functions, stacks, queues, heaps, and trees; and will also introduce a bunch of object-oriented programming concepts alongside this. (This is kind of insane pedagogically in my opinion but that's not germane.) You likely did all that jazz, possibly twice, in college, so if you don't want to do it again, don't bother. The Java Collections APIs come with all that stuff prebuilt, of course, and you're never going to have to implement quicksort outside of a test or an interview. (Which, the interview thing, might make it worth learning after all.)

But this is why finding the right kind of instructional material in Java might be a challenge, if you're not into the elementary algorithms and data structures thing as a path in. Java is well-established as Thee Enterprise Language currently, and college curricula (caught between academic and industrial pressures) are often based around it as a result. You can find tons of generic CS1/CS2 Java textbooks out there in the world, they're probably all interchangeably boring, and none of them are likely to teach you anything about programming in context and solving problems of any relevance to you. Any advanced or industry books are likely to focus on a specific technology stack that uses the Java platform, like for web applications or mobile/embedded apps or god knows what Enterprisey shit there is, and will again not be relevant to where you're at.

i too went to college (silby), Tuesday, 26 November 2013 19:46 (ten years ago) link

If you do want to work with data structures and algorithms as a motivating force in your learning, every CS program in the world has a class called "introduction to algorithms" or something to that effect, and many professors cheerfully post all kinds of class materials, problem sets, and programming projects online. They might be in different languages or involve no programming at all, just math, but all of them will cover some interesting stuff, and every algorithm that gets discussed you can challenge yourself to implement in Java. (Even better, challenge yourself to implement it in a way that uses standard Java interfaces like List, Map, etc.)

If this approach intrigues you, the programming contest a friend of mine did in high school has a pretty cool interactive training setup that will pose you various challenges and acutally compile and run your code for you and tell you how you did: http://cerberus.delos.com:790/usacogate

i too went to college (silby), Tuesday, 26 November 2013 19:53 (ten years ago) link

In conclusion, programming can be fun and cool, but it can also be a nightmare boring slog, possibly at the same time. You will make progress as long as you are able to avoid discouragement and boredom. The best way to learn to program is the way that gets you writing code and having fun with it. Doesn't matter if that's writing assembly code for a Commodore 64 or implementing red-black trees in Java or building webapps with Ruby. Just keep doing stuff!

i too went to college (silby), Tuesday, 26 November 2013 19:58 (ten years ago) link

i think (at least i hope) that the paradigm of what programming is will shift in a few years so that all these things and their attendant headaches are more or less completely optional, in the same way that grandparents who would have been forced to get a computer years ago can now just get an ipad.

Philip Nunez, Tuesday, 26 November 2013 20:07 (ten years ago) link

Typing quickly is a prerequisite (practice!)

http://typingclub.com/

Free, doesn't require an account (if you visit the site from the same computer every time it'll remember your progress). Two slight disadvantages: words use the Americanized English spelling, and the site assumes you're using a US keyboard layout.

fashionably early Christmas themed display name (snoball), Tuesday, 26 November 2013 21:20 (ten years ago) link

Most programming languages use Americanized spelling, too, no?

Matt Groening's Cousin (Leee), Tuesday, 26 November 2013 21:23 (ten years ago) link

I type at like 90 wpm

Homo schaduwkabinet (Stevie D(eux)), Tuesday, 26 November 2013 21:54 (ten years ago) link

and I <3 the maths and the logics

Homo schaduwkabinet (Stevie D(eux)), Tuesday, 26 November 2013 21:55 (ten years ago) link

Also I set up Eclipse bcz I heard it's what most real ppl use; it seems to be okay enough so far but I wouldn't disregard switching to NetBeans if everyone started going on abt how much easier it is for beginners

Homo schaduwkabinet (Stevie D(eux)), Tuesday, 26 November 2013 21:57 (ten years ago) link

im using eclipse and it broek hart for first while (srsly i went back to notepad++ and cmd line for a few weeks but im used to most of it's foibles now- tho im prob not really covering a lot of its functionality or anything

30 ch'lopping days left to umas (darraghmac), Tuesday, 26 November 2013 22:13 (ten years ago) link

okay stevie I think you may be interested in this syllabus/course material and as a result this text book or its newer edition. (Though the old one is referenced above and of course can be had for 1/6 the price and is probably almost the same.) Neither of these things have programming exercises in Java, of course, but you can probably survive anyway.

Eclipse is very much a professional tool designed for large software projects. I've never really used it though I might do so in my next job, depending on how "essential" it is. There's probably nothing about it particularly suited to learners or to working on practice exercises rather than big multi-file projects, and I'd be inclined to suggest the notepad++ and cmd line angle. (Not that the Windows command line is a particularly fun experience.)

i too went to college (silby), Wednesday, 27 November 2013 02:30 (ten years ago) link

what eclipse and netbeans give you over notepad or vim is completion I.e. as soon as you type a dot it'll show you all the possible members / methods. invaluable to a beginner, faster for everyone else.

we mostly use netbeans, but sometimes eclipse. I've changed some of the eclipse key bindings to match the netbeans ones.

koogs, Wednesday, 27 November 2013 06:25 (ten years ago) link

Yeah, I'm a vim Linux command line hardman so I'm inclined to look askance at IDEs. It might be a great tool for you, so don't overthink it as long as it works for you

i too went to college (silby), Wednesday, 27 November 2013 06:43 (ten years ago) link

(the thought of hopping between source files in the huge directory tree of a decent-sized java project using something like vim gives me the heebee jeebees tbh. yes, ctags, but still...)

koogs, Wednesday, 27 November 2013 09:25 (ten years ago) link

stevie i tried to send you a webmail let me know if it worked- if not just let me know the address i can send this stuff on to you.

30 ch'lopping days left to umas (darraghmac), Friday, 29 November 2013 04:40 (ten years ago) link

The email you gave me was a dud, sent it to ursurnameatgmail.com instead let me know if thats gone through ok.

30 ch'lopping days left to umas (darraghmac), Monday, 2 December 2013 00:14 (ten years ago) link

Never done any programming before till this year.

Been learning some data integration through using an open source tool that runs on Java (Talend). Do need to learn as much java as I can to do two things: (i) to learn to manipulate strings according to requirements and (ii) guide to errors so I can debug. But through using Talend I am interested to learn as much as I can, its given me a way in.

Things I will do: learn to touch type.

So far I have hacked away at a sams book before giving up. Boredom is the least of it but I will grit my teeth through one at xmas (one problem is it has stuff about android etc and I'm not interested in that as in manipulating flat files or spreadsheets).

Hardest thing is to make up challenges to yourself that might mirror challenges I'll face professionally.

I need to find a way of acquiring enough background to develop solutions to problems - and I'm getting there but I'm not as comfortable as I want to be.

Ultimately I think "Just keep doing stuff" for a while every day is probably the best advice.

xyzzzz__, Tuesday, 3 December 2013 13:56 (ten years ago) link

If you're really motivated to use a specific tool that runs on java, that will probably trump everything, but in general, I'd say java is not a very friendly environment to be learning one's first language, and there are a lot of other languages that do flat files and spreadsheets with less headaches involved.

'processing' has a much friendlier environment and is practically java if you wanted a less steep curve to climb.
Tutorials, documentation and example projects are built-in, and you can make neat art pieces with it!

Philip Nunez, Tuesday, 3 December 2013 17:05 (ten years ago) link

Interesting...will look into it.

xyzzzz__, Tuesday, 3 December 2013 19:45 (ten years ago) link


You must be logged in to post. Please either login here, or if you are not registered, you may register here.