I wanna learn programming. (40)

1 Name: #!/usr/bin/anonymous : 2008-02-06 09:53 ID:gJEwoq1Z

I decided yesterday that I' like to try to learn programming. The only thing I understand about it is that there are many different programming languages... where do I go from here? Any sort of information would be appreciated.

2 Name: #!/usr/bin/anonymous : 2008-02-06 11:30 ID:ms1IeRMS

What kind of computer experience do you have?

3 Name: #!/usr/bin/anonymous : 2008-02-06 15:31 ID:Heaven

I'd complain that there already is a thread with almost this exact topic, but on second thought it is very, very shitty, so let's pretend it doesn't exist. In the future, though, take some care to check if there are already threads about the subject you want to discuss.

Anyway, http://4-ch.net/code/kareha.pl/1109963434/ discusses the problem from the opposite point of view. It may give you some clues, or it may not. Worth checking out, though.

4 Name: #!/usr/bin/anonymous : 2008-02-09 01:42 ID:/6E1GEP0

do you go to school? go take a class at school.

5 Name: dmpk2k!hinhT6kz2E : 2008-02-09 09:41 ID:Heaven

I think learning to program at school is one of the worst ways to start off, unless it's being taught by an exceptional teacher.

6 Name: #!/usr/bin/anonymous : 2008-02-09 12:34 ID:gTCBBZfC

>>2
My experience with computers= prowling around the internet for about 2 years. I learnt to copy and paste a few months ago. lol.

>>3
Usualy, i do check, this time i got lazy. sorry, lol. I'll go look at it. thankyou.

>>4
I go to university. I have no time for any more official classes. This would have to be something i learn when i have spare time.

>>5
Good.

7 Name: #!/usr/bin/anonymous : 2008-02-09 14:03 ID:Heaven

Programming will change your life, and if you don't make it until the end it will change your life for the worse.
Are you prepared for that?

At first you will be in confusion, that is normal.
The more general knowledge you have the better.
Try a programming language like PHP.
While PHP is horrible it'll teach you some basic stuff.
Then you can choose to be hardcore and attempt to learn C (you will fail, first time won't work)
Learn some more stuff about networking, how computers work, etc then attempt C again.
Once you learn C, read about more abstract stuff such as algorithms and more specific stuff such as IPC, networking, implementations of [..] etc.
Also, learn scheme and if possible haskell. they are very handy, even though you will rarely use them.
Stay away from PHP, ruby, perl, java and all those horrible languages, which are, at most, useless.
You don't want to learn programming languages, you want to learn about concepts and paradigms, and learn a language or two at most. (C, Haskell, scheme, perhaps C++ at a later point)
Stay away from tutorials. Try to get some books on subjects that interest you, and try to get good books.
Stay away from people in suits with flashy certificates using big words pretending to be programmers.

Try not to become a fanboy of C/UNIX/Haskell/etc.
Do not waste your time trying to argue about these, or trying to prove while one is better than the other.
Once you become a programmer, time is the most valuable thing you have.

8 Name: #!/usr/bin/anonymous : 2008-02-09 14:39 ID:Heaven

> Try a programming language like PHP.
> Stay away from PHP [...] and all those horrible languages, which are, at most, useless.
> Then you can choose to be hardcore and attempt to learn C.
> Try not to become a fanboy of C...

Good sir, your logic is flawless and I would like to present you with an award!

9 Name: #!/usr/bin/anonymous : 2008-02-09 14:45 ID:Heaven

>>8
Hardcore because ISO C has a lot of semantics, not because C is 'fast' or has 'pointers' or 'memory management' or whatever the hell a newbie programmer would spit out when asked about the benifits of C.
If you can understand ISO C you can properly isolate concepts and then understand how and why they are related.

10 Name: #!/usr/bin/anonymous : 2008-02-09 15:47 ID:Heaven

>> 9
> If you can understand ISO C you can properly isolate concepts and then understand how and why they are related.

Could you elaborate? I've been using C for many years, but I can't really break it down into "concepts" and whatnot.

11 Name: #!/usr/bin/anonymous : 2008-02-09 16:31 ID:Heaven

I am part of an elitist superstructure that advocates assembly as a starting point for beginners. Hell, we advocate that ALL programmers use assembly for ALL tasks.

12 Name: #!/usr/bin/anonymous : 2008-02-09 17:35 ID:Heaven

>>10

> Could you elaborate? I've been using C for many years, but I can't really break it down into "concepts" and whatnot.

ISO C has very loosely defined terms and no system-specific functions or operations.
ISO has defined a number of rules that any standard C implementation must conform to.
Once the reader understands that, he understands what a standard is, what an implementation must conform to and what he really writes.
Then, he can also understand what POSIX is, what IEEE does, why, for example, fgetpos()/fsetpos() exists, why my libc is not your libc however both standard, et cetera.
After that he can also understand why there are file formats and protocols, what to do when two standards overlap, what is a library, why you would want to use one, how to write portable programs with a standard in mind and other stuff.

Isolation and abstraction, two very importand concepts, will be learned properly if one reads and understands ISO C 9899 1999.

13 Name: #!/usr/bin/anonymous : 2008-02-10 06:21 ID:+rfgAmQr

>>1
Get a Scheme interpreter for your computer. Then go read the wizard book. http://mitpress.mit.edu/sicp/full-text/book/book.html

14 Name: #!/usr/bin/anonymous : 2008-02-10 12:27 ID:Heaven

>>13
While SICP is a very good text, I personally think it's not a very good introduction. It's a great second text once you get the general idea of how to think in terms of algorithms and program structure, but it really can be confusing to start off reading it with no prior programming knowledge.

The problem is there's no really good beginner's text, so far as I know, that tries to teach the general fundamentals of programming. That is, I really wish there was a book that went something like "ok when you're writing a program you have loops and stuff, and here's how they work diagram now suppose you want to handle input of some sort flowchart" rather than focusing on a particular language.

15 Name: #!/usr/bin/anonymous : 2008-02-10 15:15 ID:ulxS/JmF

>>1
Since you are at Uni I would expect you want to learn programming to fulfill a certain requirement.

First ask yourself the question: Why am I learning to program?
And: What manner of tasks would I expect to solve with it? (a general idea would be fine)

Although most languages nowadays can do everything well, you have to consider that when seeking employment. Certain ones are more relevant, and putting your initial effort into it will make it work better in the long run.

16 Name: #!/usr/bin/anonymous : 2008-02-10 15:41 ID:Heaven

>>13

Unfortunately, it turns out that the mathematical purity of functional programming does not translate into intuitive simplicity or easy of learning. Imperative languages remain much easier to beginners to learn.

17 Name: dmpk2k!hinhT6kz2E : 2008-02-10 18:06 ID:Heaven

SICP is pretty stiff for a first text, unless you're a physicist or mathematician by vocation. Most people in CS are afraid of math.

I've heard good things about HtDP as an alternative. It too uses Scheme and is free on the web, but has less of that scary math and seems more focused on real-world issues.

Or you could just fire up something like Python and start playing around with some tiny examples. It's the best way to do things.

18 Name: #!/usr/bin/anonymous : 2008-02-10 18:54 ID:Heaven

>>17
Math? Oh come on.
Consider this simple problem from SICP.
More than half of the programmers I have met cannot think of the1 solution in 1 minute. It might take more time, or they may never come up with the solution.

Here is the problem:

``Write a procedure that takes 3 arguments and returns the sum of the squares of the two larger values''

Ignoring the squares and the sum part, this problem essentially asks you to find the two higher values in 3 values and do something with them.
That is ridiculously easy. I insist that if someone cannot work it out, programming is not for him.

Before you read further, try to solve it.

The solution is simple: Use min and max.
(max x y) will tell you which is larger, x or y.
You can safely assume that is one of the two larger values.
What remains, is z and the other value.
The other value, we can determine with min.
(min x y) will tell you which is smaller from these two.
Then, we again have two values and need the higher one.
We will use max again
(max (min x y) z) will do the trick. Simple.


________________________________________________________

1 There are many solutions, some efficient, some not. Some dumb, some clever. I am refering to the smart and efficient solution as ``the'' solution.

19 Name: dmpk2k!hinhT6kz2E : 2008-02-10 20:06 ID:Heaven

>>18
One example of many, and my point stands. Anybody who doubts is free to look at any random section of SICP.

I rather suspect most people starting to play with languages do not give a hoot about random things like the Fermat test. They're having fun, and the math is a boring chore that's quite besides the point; things like bouncing sprites is more like it. If you like math, good for you, but most people appear to need something a bit more concrete than shoveling numbers around for no apparent purpose.

I believe math pedagogy is one of the worst out there, which is why so many people falsely believe it's dull. Ask yourself why so many people manage to (re)teach themselves linear algebra when they discover they need them for pretty pictures.

We really don't need that kind of inept teaching creeping into other disciplines. SICP is not a good beginner book.

20 Name: #!/usr/bin/anonymous : 2008-02-11 11:53 ID:Heaven

>>19
Fine, you are correct.
I would not suggest SICP to someone who doesn't know programming at all.
SICP, however, is a great book.

Also, off-topic but I have this feeling that everyone is misusing sage here.

21 Name: #!/usr/bin/anonymous : 2008-02-11 16:51 ID:Heaven

>>20
You must be new -- I suggest reading the 4-ch guide. Particularly:
Unlike imageboards, sage is not an insult. Within imageboards, many users can "sage" a thread filling it with enough posts to have it filled, and thus no longer able to reach the front of the board. Since it takes 1000 posts to close a thread in Channel4, this method is futile and you will just clog up a perfectly good thread, which could get your posts deleted, or even get you banned.

22 Name: #!/usr/bin/anonymous : 2008-02-13 00:33 ID:9ceEdRkZ

>Most people in CS are afraid of math.

lol that explains why I know so many CS graduates who can't program.

OP, if you can copy and paste bits out of The Java Cookbook you can get a job as a programmer.

23 Name: #!/usr/bin/anonymous : 2008-02-13 05:55 ID:Heaven

... And if you can more-or-less understand what it does, you can get promoted to project manager.

24 Name: #!/usr/bin/anonymous : 2008-02-13 09:12 ID:0vXZpJgG

i went to college for 2 years studying CS. i took classes in data structures, c++, java and assembly (as course requirements). i liked java because it made sense to me. of course i can see the use for c++ in certain areas (not my kind of areas).
i got a part-time job programming web sites for a startup company who was looking for students with work-study financial aid (they paid me half and the school paid the other half). after 2 months they offered me a full time job and i took it.

4 years later i'm working at a bigger company doing web development in c# and php (depending on the application) and making more than my parents (who are in PR and construction).

the bottom line is: learn something you like to do and start doing it for money as soon as possible. i still owe the state about a quarter of my salary for the 2 years and no degree.

25 Name: #!/usr/bin/anonymous : 2008-02-13 20:15 ID:Heaven

>>24
Strongly attesting to your last statement, I'm in the same situation. Sometimes the trouble is getting your foot in the door, but if you live in a decent sized city and are doing more to look around than just sitting the couch, it really isn't nearly as difficult as some people make it seem.

26 Name: #!/usr/bin/anonymous : 2008-04-20 15:19 ID:NeaQvXmw

>>18
Another way would be to compute x^2 + y^2 + z^2 - min(x, y, z)^2 where min(x, y, z) is defined as follows:

x if(x <= y and x <= z)
y if(y <= x and y <= z)
z if(z <= x and z <= y)

Dunno if there's a slicker way to test for the minimum of more than simply two numbers, but it's not bad for a naive function.

27 Name: #!/usr/bin/anonymous : 2008-04-20 19:31 ID:7mS6yNfc

>>26
min(x,min(y,z)) is another way.

28 Name: #!/usr/bin/anonymous : 2008-04-20 20:34 ID:Heaven

>>26
x<y ? (z<x ? z : x) : (z<y ? z : y)

Amicoolyet?

29 Name: #!/usr/bin/anonymous : 2008-04-21 06:43 ID:Heaven

>>28
((x)<(y)?((z)<(x)?(z):(x)):((z)<(y)?(z):(y)))

30 Name: #!/usr/bin/anonymous : 2008-04-21 21:58 ID:Y01//Xyu

you should try using Qbasic its easy as pie and its what L33t hackers use to progRAM!

31 Name: #!/usr/bin/anonymous : 2008-04-23 08:07 ID:9U1c1SHz

"I wanna learn programming" is bit vague.. you want to learn how to make things with computer I suppose, but a question like this will only get you canned replies:

* programming is hard, first you'll need to develop an analytical mindset using mathematics
* you need theory first, read SICP
* you can't program before you know how a computer works, learn assembly.
* and the classic: X is a disgusting language, stay away from it, use Y

None of these replies are completely wrong -in fact they're laregely correct- but they're not very useful either. Are you really going to start reading books? I didn't... Do you want to know assembly? What's up with these replies than?

It seems like a fucking chore now, huh, "learn programming"? Well, the truth is: yes, but you don't need to worry about it. Because you probably don't even want to learn how to program, if you're like me [b]you just want to build shit[/b]. a website, an IRC bot, some small tools ... shit such as that.

Well, [i]that[/i] is not so hard... and as with most things in life you don't need to be very talented to do such things, just interested. start copy pasting in a working codebase of some language that you think will be able to use for your tool (both the codebase and the language). Don't go read to many tutorials or whatnot, just try things. Welcome to the hacker mindset. After a while, all by itself, you will start reading tutorials untill your eyes drop.

It should be mentioned though, that having a very solid mathematical background allows you to progress a lot faster: Haskell for example was a breeze to me because I already knew most of the concepts. But I would have never chosen to get the background if I didn't spend 4 years in highschool hacking PHP and mIRCscriptings :D

in short: don't waste time learning to program before building stuff. simply take a working program and start extending it. mIRCscripts and PHP websites are what i used for this.. and it worked.. but that was 10 years ago. Right now i'd go with python (but ask some younger anons first)

32 Name: #!/usr/bin/anonymous : 2008-04-23 14:59 ID:Heaven

>>31
Hello /prog/ regular, we don't use bbcode here ;)

33 Name: #!/usr/bin/anonymous : 2008-04-23 15:22 ID:jjmdgogq

>>1
You should start learning Python.

34 Name: #!/usr/bin/anonymous : 2008-04-23 17:00 ID:gxzHM5th

>>1
You can learn the Ruby programming language in 15 minutes at this website:

http://tryruby.hobix.com/

It'll give you a feel for what computer programming is like, without having to hit the bookstore or install weird things on your computer. And it'll make learning other languages easier if you just get started on one.

35 Name: #!/usr/bin/anonymous : 2008-04-26 11:19 ID:Heaven

LISP

36 Name: #!/usr/bin/anonymous : 2008-05-11 09:06 ID:rSmf+1zk

Ruby / Python / Pascal (old as crap)
any of these are good to know or start with

37 Name: #!/usr/bin/anonymous : 2008-05-11 11:24 ID:nceUP+Bp

>Stay away from tutorials. Try to get some books on subjects that interest you, and try to get good books.

Strongly agreed. In particular, the "tutorials" which are just "copy this code into the editor, do this, do that, and it'll work"; if the author doesn't know exactly what he/she is writing about, then it becomes a case of the blind leading the blind.

I'll start off by saying that computer programming has a VERY large body of theoretical knowledge that goes with it; unless you want to just "learn programming" and become an ad-hoc code monkey, you WILL have to learn the theory, and this entails a not so trivial amount of mathematics (especially working with integers). If math is not a strong point for you, programming will likely not be one either.

As for the actual material, I recommend a mix of both theory and practice for the beginner; the two textbooks for my introductory programming courses are K&R and SICP. The former for learning the C language itself, and the latter for the theoretical principles.

Another area that should definitely be studied but perhaps with less intensity is the low-level stuff -- CPU, memory, boolean logic, Asm, etc. For this, it's sufficient to understand only the basics how a computer works, so grab e.g. a Z80 or the Intel CPU manuals and give them a quick read.

In addition, don't be tempted to go with whatever fad language seems to be popular these days; once you grasp the theory (via SICP) and the general semantics of procedural languages, any other procedural language should be easily learned -- providing that you have been educated in the right manner; tying concepts to syntax will almost certainly be a pitfall of this, as instead of understanding e.g. the way a loop works, one memorises the syntax of a loop, unable to adapt to a slightly different syntax of another language.

>>34
Err... I can only think of one phrase to describe that: WTF?

OP, go read SICP and K&R (both can be found on the Internet, the latter a little more difficult to locate but it's a PDF). If you are interested in what you see, then you'll enjoy learning programming. Otherwise, you'll probably get to hate it.

38 Name: #!/usr/bin/anonymous : 2008-05-11 12:40 ID:Heaven

>>37

>If math is not a strong point for you, programming will likely not be one either.

It's funny, I used to think maths wasn't a strong point for me but then I got interested in theory of computing and discovered that it is.

Otherwise I agree with and endorse this post.

39 Name: Anonymous : 2008-05-11 17:32 ID:Heaven

Read SICP.

40 Name: #!/usr/bin/anonymous : 2008-05-13 16:18 ID:Heaven

>>39

Go back, /prog/, &c &c

This thread has been closed. You cannot post in this thread any longer.