Announcement: Be excellent to each other.


Caravel Forum : Other Boards : Anything : I want to learn programing (Tips will be wellcome)
New Topic New Poll Post Reply
Poster Message
Blondbeard
Level: Smitemaster
Avatar
Rank Points: 1486
Registered: 03-31-2005
IP: Logged
icon I want to learn programing (0)  
Once again I turn to the friendly forum of death for advise. I am a master of science in physics, and as such I am expected to know programing. The bad news is that I don't. Our programing courses never covered the basics (our first lab was to create a program that could calculate how light beams falling towards a system of lenses would be bent).

Does anyone know some good literature that gives you an intuitive feeling for what programing and it's functions is all about. Asume that I'm inteligent, and good at learning, but doesn't know that much to begin with. ;)
01-09-2009 at 06:13 PM
View Profile Send Private Message to User Show all user's posts This architect's holds Quote Reply
stigant
Level: Smitemaster
Avatar
Rank Points: 1182
Registered: 08-19-2004
IP: Logged
icon Re: I want to learn programing (+2)  
I like this tutorial, but I'm somewhat biased towards Scheme and away from imperitive languages like c/c++.

____________________________
Progress Quest Progress
01-09-2009 at 07:05 PM
View Profile Send Private Message to User Show all user's posts Quote Reply
eb0ny
Level: Smiter
Avatar
Rank Points: 484
Registered: 09-12-2007
IP: Logged
icon Re: I want to learn programing (+1)  
If you want to begin learning programming, you should concentrate on two aspects: algorithms and their implementation.

For the first part I could recommend you Programming challenges book. Chapter on Dynamic Programming is kind of weak, but it's a good starting point overall. After you get acquainted with what can be done, learn what is computational complexity (see stigant's excellent explanation here) and attempt to solve more difficult programming tasks which require more intricate techniques. The key point here is to understand why some algorithms are better than others and that underlying concepts and math are THE things that matter (NOT a language you are writing with! NO!).

At the same time you should be learning some programming language, to know how to implement the algorithms. The choice of language depends on how deep you want to go in CS. If you are going to write, test and fix code for a living, start with something low-level, like C/C++, to get exposed to stuff like dynamic memory management or pointers. If you are interested just in the algorithmic aspect of CS, go with python. I can't recommend you any literature here, because my own studies were sort of fragmented - a little bit from here, a little bit from there.

The last thing remaining is practice. If you want to see some "pure" algorithmic problems, try usaco or uva judge. Check out project euler if you want to see how programming could help you with math (and, subsequently, physics) problems.

Hope this helps.

____________________________
Click here to view the secret text


[Last edited by eb0ny at 01-09-2009 07:58 PM]
01-09-2009 at 07:55 PM
View Profile Send Private Message to User Show all user's posts This architect's holds Quote Reply
Kwakstur
Level: Smiter
Avatar
Rank Points: 385
Registered: 05-05-2006
IP: Logged
icon Re: I want to learn programing (+3)  
You know when you type something really long and then get sick of typing but don't want to just leave it be since it took you 6 hours to type?

Well, um, yeah. I really wasted too much time on this to not share it. It's far from complete (I didn't even get to the part about taking Input), and has quite a few incomplete thoughts (even incomplete sentences near the end), but I'm going to have to just post it as it is because I was typing from 2:00 to 8:00 before it finally occured to me that I'll never finish it. I have homework to do and an RPG script that is only two hours away from completion if I ever manage to get back to it.

What am I going to do with myself when I have a job... sigh...

Secreted for length.
Click here to view the secret text


____________________________
Also known as ExpHP everywhere else.

[Last edited by Kwakstur at 01-11-2009 01:16 AM]
01-11-2009 at 01:02 AM
View Profile Send Private Message to User Send Email to User Visit Homepage Show all user's posts Quote Reply
stigant
Level: Smitemaster
Avatar
Rank Points: 1182
Registered: 08-19-2004
IP: Logged
icon Re: I want to learn programing (+2)  
For beginners, you definitely want to start programming in a language with a good IDE. An IDE lets you do all this and more:
I'm not sure I entirely agree with that. I think its much more important to:
1. Understand how and WHY code is written as it is. You need to get a firm understanding of the details of the syntax (assuming that you'll be doing at least SOME non-visual/text coding)
2. Understand what each line of code "does"

The attributes that you listed for a good IDE (code completion and generation, visual programming) are great for getting a project up and running as they take care of the mundane details that experienced programmers don't want to deal with every second of their working lives. But they do little to actually help you learn a language because they prevent you from actually learning the syntax and figuring out why and how the code does what it does.

I would recommend an environment that has a nice simple REPL (read-eval-print-loop) which allows you to try out single commands/expressions rather than having to write a fully functional program right away (sort of like being able to sit at a piano and play simple notes and chords rather than diving into a symphony). Of course, that means learning an interpreted rather than a compiled language first. Which is part of why I recommend Scheme over C++. (The others are that Scheme is a functional rather imperative language and its syntax is very simple and sparse). I expect from your first post that you may be using some sort of mathematical toolbox like Mathematica. If I recall correctly, Mathematica's language has a lot of functional ideas and is interpreted and has a simple REPL to play around in. If so, that wouldn't be a bad place to start.

____________________________
Progress Quest Progress
01-11-2009 at 03:45 AM
View Profile Send Private Message to User Show all user's posts Quote Reply
Kwakstur
Level: Smiter
Avatar
Rank Points: 385
Registered: 05-05-2006
IP: Logged
icon Re: I want to learn programing (0)  
No argument there. The reason I said that is because I didn't know there were any such thing as interpreted languages for the computer (not counting batch files).

Yes, I would definitely recommend an interpreted language over a compiled language with a good IDE, for the same reasons you said. In fact, I myself started with TI-BASIC. When I tried to start coding in C++, I pretty much blew my head off trying to get a working program. After I looked at C#, Java, and GML, I figured they were all like that on the computer.

____________________________
Also known as ExpHP everywhere else.
01-11-2009 at 05:00 AM
View Profile Send Private Message to User Send Email to User Visit Homepage Show all user's posts Quote Reply
Briareos
Level: Smitemaster
Avatar
Rank Points: 3516
Registered: 08-07-2005
IP: Logged
icon Re: I want to learn programing (0)  
Kwakstur wrote:
No argument there. The reason I said that is because I didn't know there were any such thing as interpreted languages for the computer (not counting batch files).
Well... JavaScript (which you use all day long on this very site) immediately comes to mind... :P

(Not that I'd suggest it as a beginner's language - roughly half the web is evidence of the horrors a beginner with JavaScript can inflict on unsuspecting visitors... ;))

np: Coldcut - Rubaiyat (Let Us Play)

____________________________
"I'm not anti-anything, I'm anti-everything, it fits better." - Sole
R.I.P. Robert Feldhoff (1962-2009) :(
01-11-2009 at 10:40 AM
View Profile Send Private Message to User Send Email to User Visit Homepage Show all user's posts Quote Reply
Blondbeard
Level: Smitemaster
Avatar
Rank Points: 1486
Registered: 03-31-2005
IP: Logged
icon Re: I want to learn programing (0)  
stigant wrote:
I like this tutorial, but I'm somewhat biased towards Scheme and away from imperitive languages like c/c++.

I have started this. Feels quite good, so thank you :)
01-12-2009 at 03:14 PM
View Profile Send Private Message to User Show all user's posts This architect's holds Quote Reply
b0rsuk
Level: Smiter
Avatar
Rank Points: 489
Registered: 11-23-2003
IP: Logged
icon Re: I want to learn programing (+2)  
I'd recommend my favourity language, Python. It is a very well-designed and clear programming language. It is general purpose, meaning you can at least attempt to do everything in it. This is unlike say, Javascript, which is good only for web pages. It excels at everything that doesn't require high performance (like realtime games, 3d graphics etc). Because Python is very powerful, you can't really grow out of it. You may need another language for a very CPU-intensive task, bu that's it. Python is a high-level language, it makes many things easier so you can focus on the problem you're actually trying to solve instead of struggling, for example, with very verbose formal syntax or memory allocation.
Python is a multi-paradigm language, you can try a couple ways of programming, like classic procedural/imperative programming, object-oriented programming (very good support for OO), and elements of functional programming, too. (lambda, map, reduce, generator expressions etc). Python's functional programming capabilities are not as complete as those in a pure functional language, but they still let you experiment and give you general idea.

Why choose Python ?
http://python.org/about/
For you it may be important that Python has good scientific capabilities. If NASA uses it, it should be enough for you too. It has complex numbers support right from start, for example. It can handle very large numbers and has nice libraries like NumPy. (It's third party stuff, but Python standard library is also worth mentioning. It's remarkably well designed, thanks to the 'batteries included' philosophy)

Here's the freely available book bookThink Python, formerly known as Thinking like a Computer Scientist. It teaches you the basics without treating you like an idiot.

http://www.greenteapress.com/thinkpython/html/index.html

Chapter 1 The way of the program

The goal of this book is to teach you to think like a computer scientist. This way of thinking combines some of the best features of mathematics, engineering, and natural science. Like mathematicians, computer scientists use formal languages to denote ideas (specifically computations). Like engineers, they design things, assembling components into systems and evaluating tradeoffs among alternatives. Like scientists, they observe the behavior of complex systems, form hypotheses, and test predictions.

The single most important skill for a computer scientist is problem solving. Problem solving means the ability to formulate problems, think creatively about solutions, and express a solution clearly and accurately. As it turns out, the process of learning to program is an excellent opportunity to practice problem-solving skills. That’s why this chapter is called, “The way of the program.”

On one level, you will be learning to program, a useful skill by itself. On another level, you will use programming as a means to an end. As we go along, that end will become clearer.

I have a tip for you. If you truly want to learn programming, make it fun. Have a goal that's fun to you. For me it's automating the monotonous actions at work (Yes, I've actually got permission to use Python at work !) and writing a roguelike game. Learning programming for the sake of programming will get you nowhere. It's like learning a language at school only to let your skills atrophy. Never, ever learn a language you have no intention of using (I had 8 years of French at primary school). If you have big goals, find some smaller realistic goals to keep you occupied and motivated in the meantime. For example a script which prepares a random selection of music tracks to copy to your digital player (my iriver t30 has only 1 GB of memory so it's constant choosing). Write a simple search engine to organize your documentation (possible with just Javascript getElementsByClassName and CSS !).

In relation to other posts in this topic:
- Python doesn't really need an IDE. It's not compiled, but interpreted. It tries to have as nice and clean syntax as possible. Bruce Eckel said in an interview that he can't remember how to open files in Java, and he's written chapters on it. In Python, it's very simple and easy to remember, like:
 f = open('data.csv', 'r').
It fits in your head. With Python, the only thing I really can't live without is syntax highlighting and line numbers.
- in response to stigant: Python has at least 1 thing he values, namely interactive shell mode. Instead of running programs or scripts, you can try things out without any big commitment, just play around with it. As a result, I've made a habit of using it as a calculator.


____________________________

http://www.gamasutra.com/features/20051128/adams_01.shtml

[Last edited by b0rsuk at 01-15-2009 07:38 PM]
01-15-2009 at 06:43 PM
View Profile Send Private Message to User Send Email to User Show all user's posts Quote Reply
Blondbeard
Level: Smitemaster
Avatar
Rank Points: 1486
Registered: 03-31-2005
IP: Logged
icon Re: I want to learn programing (0)  
The thing I probably will use programing for is a potential job. There's lot's of programing jobs available in Sweden at the moment, and most of the programing isn't done by real problem-solvers nor "educated programers". I could probably get a program job now, if I wanted to. I have actually completed a Python course, with the highest grade, since the exam tested problem-solving rather than if we knew the basics of the programing language, and programing in general. I want to feel a bit more comfortable with the basics of programing before I get a job, though. I don't know how many job-oportunities there is where you will use Python, but I will consider learning Python anyway. My plan was to take a quick look at Java after completing Stigant's tutorial, but maybe it's better to look at Python... But I can't spend too much time learning to program, and not having a job (I have some saved money to keep me alive in the meantime, and a working girlfriend).

[Last edited by Blondbeard at 01-15-2009 08:58 PM]
01-15-2009 at 08:56 PM
View Profile Send Private Message to User Show all user's posts This architect's holds Quote Reply
zwetschenwasser
Level: Master Delver
Avatar
Rank Points: 200
Registered: 05-22-2007
IP: Logged
icon Re: I want to learn programing (0)  
www.java.sun.com
www.javaranch.com
www.wickedlysmart.com

Some sites to introduce the learner to the wonderful, powerful, beautiful world that is Java.

____________________________
Currently working on GaTEB and KDD (never finished the silly thing). :yahoo:

[Last edited by zwetschenwasser at 01-16-2009 12:12 AM]
01-16-2009 at 12:10 AM
View Profile Send Private Message to User Show all user's posts Quote Reply
b0rsuk
Level: Smiter
Avatar
Rank Points: 489
Registered: 11-23-2003
IP: Logged
icon Re: I want to learn programing (+1)  
Blondbeard:
If that's how the situation looks like, I guess it's better to go with Java. Python has fraction of the popularity Java has, and is only recently starting to see wider adoption (scripting, but also web frameworks like Django, Pylons and Content Management Systems like Plone. If you want to check Python job availability, Django, Pylons, Zope and Plone are the keywords to look for). Python is often chosen by hobbyists, because it's very pleasant to work with and rarely gets in your way. Python enthusiasts often claim you can be 5-10 more productive in Python than in Java (meaning you accomplish things 5-10 times as fast). And improved clarity really helps in the long run

The thing is, people at work often just don't care. They use C++, Java, PHP, MySQL (this stuff is very popular) with explanation like "we use it because everyone uses it". I've prepared, configured and demonstrated an upgrade to our documentation system, based on Plone. Everyone liked it except the admin, who doesn't want to see Python on servers. End of story.
I chose Python for my 'serious' programming because 1) I already have a job so I'm not in a hurry 2) I'm stubborn 3) I'm idealistic. If I decide to find a new job, I'll likely spend some time looking for it because here in Poland there are only occasional Python opportunities. In meantime, I can play around with Python on my workstation (scripting and database access).

So if you have a pragmatic point of view and can't afford to wait much, consider Java, C++, PHP. I also strongly recommend learning SQL. It's easy to learn, won't take you much time. Knowing SQL is not so much an advantage as it's a disadvantage _not_ to know it. Databases are ubiquitous, so SQL is ubiquitous too. You may know SQL already, and are likely to have some HTML/CSS knowledge (also easy to learn, nice to have and learning it won't consume much time).

Learning Python anyway won't be a bad move. Python is easy to learn and not too big. Java, by comparison, is monolithic and you'll spend lots of time learning various toolkits, libraries, frameworks and whatnot. You'll be able to use Python as a scripting language for things Java is not great at (like string operations). Another use for Python is prototyping. You can write a working program in Python much faster and see if the design works (or unwieldy and problematic, because you haven't thought about something). Then reimplement it in something else. By the way, Python can be embedded in Java applications if you use Jython.
By the way, as a result of learning Python my code in other languages (like Javascript) has become more readable, too ! Especially when it comes to indentation :-)
------------

Ok, back to ground. Whatever language you choose your first step should be writing a couple of very mundane, pragmatic programs or scripts and learning the standard library. If it's scripting, then learn file operations, how to search for files, read csv (Python has a 'csv' module), zip files, use a html parser etc. It's time for a few personal projects. You can also download some open source programs with good reputation and see how they're done.
Another path you can take is to learn some Java-based, complicated system like jboss. jboss is written in Java, but mere knowledge of the language doesn't suffice. It's a topic all in itself. There are people who specialise in jboss ONLY and that's all they do at work.

Finally, here are some tips how NOT to write software:
http://sourcemaking.com/antipatterns

I've said I'm not advocating Python if you want to _maximize_ your chances of finding a job, but here's an article advocating Python with Java comparisons. Also contains links to opinions of Bruce Eckel and Eric S. Raymond.
http://www.ferg.org/projects/python_java_side-by-side.html


____________________________

http://www.gamasutra.com/features/20051128/adams_01.shtml

[Last edited by b0rsuk at 01-17-2009 05:56 PM]
01-17-2009 at 05:29 PM
View Profile Send Private Message to User Send Email to User Show all user's posts Quote Reply
New Topic New Poll Post Reply
Caravel Forum : Other Boards : Anything : I want to learn programing (Tips will be wellcome)
Surf To:


Forum Rules:
Can I post a new topic? No
Can I reply? No
Can I read? Yes
HTML Enabled? No
UBBC Enabled? Yes
Words Filter Enable? No

Contact Us | CaravelGames.com

Powered by: tForum tForumHacks Edition b0.98.8
Originally created by Toan Huynh (Copyright © 2000)
Enhanced by the tForumHacks team and the Caravel team.