This is a thread for people who want to learn programming, whether they are non-programmers, beginners, or advanced programmers who want to learn more. If you would like to discuss programming with other people from the LW community, this is the right place.
While programming is not a central topic of this website, it is related to many ideas discussed here. About a third of LW users described their profession as "Computers" in the recent survey. Some users have expressed desire to learn programming. Some users have recommended learning programming to others. There are many other websites (or books, etc.) for learning programming, but talking with the people you already know, following our traditions of rational discourse, could be an advantage.
So this is the experiment. Unlike Open Thread, it has a specific topic, and the beginners are encouraged to ask their programming questions, even if they are completely unrelated to the usual LW topics. Especially the open-ended questions like "how...?" and "why...?". (Maybe we are already strong enough to survive even the mindkilling questions like "which programming language is the best?".)
Here are some older LW articles about programming:
- Why learning programming is a great idea even if you'd never want to code for a living
- I want to learn programming
- Are Functional languages the future of programming?
- Colonization models: a programming tutorial;a tutorial on computational Bayesian inference
- Khan Academy: Introduction to programming and computer science
- Free Tutoring in Math/Programming
- More intuitive programming languages
- Learn to code
- What is the best programming language?
- Computer Science and Programming: Links and Resources
- Advice On Getting A Software Job
- Checking for the Programming Gear
Here are some other resources:
- Computer Science @ Khan Academy
- Project Euler - problems to test your programming skills
- Stack Overflow - for specific questions
...and there are also many links within the articles.
And here is the place for your questions:
I am a big fan of IDEs, because they can remove a lot of trivial (or not so trivial) inconveniences.
I point a mouse cursor at any variable / function / class, and a documentation is displayed; if I press Ctrl and click, the definition is opened. What is the alternative: Remembering everything?
I often rename my variables / functions / classes, because I believe that the name should reflect the meaning as closely as possible, but sometimes when I finish writing something, I realize the meaning is slightly different than I originally thought. IDE replaces all instances of the given thing, but does not touch other things with the same name (e.g. a local variable in a different function, or a method of a different class). What is the alternative: Always thinking hard about the name? Leaving the old name even when it feels wrong? Check carefully whether only the correct words are being replaced?
Generally, when I work with a good IDE, I am not just editing a set of text files, but I feel like I am working with the generated classes and functions directly. Because it is so responsive, it feels more real. When I work without the IDE (or with a bad IDE), it feels very clumsy. For example, I can type "my_obj.my_func()" on the keyboard, but I don't get an immediate response whether an object "my_obj" exists, whether it has a function "my_func", whether the function has zero parameters. The IDE gives me this feedback all the time, it feels so natural, and I become tense without it. Sure, I can get the feedback later, from the compiler. But that's like a difference between walking with open eyes, and walking with closed eyes and shortly looking around once in a minute. I can still successfully navigate to my goal, it just takes a heavy tax on my attention.
My favourite IDE is Eclipse, for Java. In settings it has a long list of things some people consider bad programming style, and you can select which of them will be underlined in the source code as warnings. Just reading the whole list is interesting. Once I tried to turn on all of them and then improve my program to fully pass the test. (Then I turned off one setting. It required localizing all the strings in code; that would be an overkill.) I learned some interesting things from that. But this could be achieved also by using an external tool, such as FindBugs or PMD.
How do you avoid circular dependencies between e.g. "a node is a branch or a leaf" and "a branch contains two nodes"?
I agree with the other things (with the sidenote that some IDEs give you smart compilation and keyboard shortcuts automatically). The idea of an acoustic feedback sounds interesting!