Would you say it's easier for a newbie to pick up programming by learning an interpreted language ?
That's a false dichotomy. You can compile or interpret any language. There are interpreters for C, and compilers for Python. That's just an implementation decision, and on a level that the beginner won't even notice.
I think what you're trying to ask, though, is whether it's easier to learn a language with an interactive prompt, and I think that it's definitely easier to get a grasp on a language if you can "play with it". That's what makes stuff like logo so inviting to beginners, you can type stuff and see immediately what each line of code does. If you have to write a whole file to be processed all at once, there's a disconnect between the program and its evaluation, and it takes an extra mental step to understand the relationship between the input and output.
I am pretty much an advocate of the idea that what really matters when you are trying to pick a first language is how easily you think you might give up if you face trouble and how much time you have to deal with learning how to fix problems with it. If you really want to learn programming and have a reason to stick with it, I don't see why someone can't just start with straight C.
As far as interpreted versus compiled, I would argue that interpreted languages can be less demanding about how you write your code, but the things that they do to be accommodating require some thought on the programmer's part as to what the interpreter will do to accommodate, which may be viewed by some as adding to it's complexity. This is, of course, not a hard-and-fast rule, but it makes the answer to your question more difficult.
can I learn C from an interactive prompt ?
You can learn programming much better with a high-quality compiled language that has excellent debugging support, compared to an immature toy interpreted language which has poor debugging support (e.g. interpreter just dies with segfault, or a message that you have some error somewhere in the script).
There is a potential for interpreted languages to make better learning environments because they can have better introspection, debugging and interactivity. However, implementing those things takes work, and you may find that many developers of interpreted languages duck out of them, because usually those people are after the primary result (the language interpreter executes correct programs as fast as possible) and neglect those other things, which are more difficult to do (backtraces, breakpoints, single stepping, etc.)
For instance, most Unix shells have no debugging means, even though they are interpreted. (There is a Bash debugger written in bash, but it's too slow to be useful.)
Awk interpreters (GNU gawk and classic ones) are another example. No useful debugging, and no "REPL" (read-eval-print interactive loop). You're better off doing C or C++ where you can use a debugger like gdb to step through the code.
So whatever tools you are looking at for learning, you have to evaluate them on a case by case basis, not based on what category they fall into.
>>5
You are seriously comparing debuggers for C to awk and shell languages??
Try matlab, python, perl, lisp, and so on. Matlab has an excellent debugger. Probably python has one, idk.
And it's ridiculously easy for people to pick up matlab (or octave, I guess), what with the debugger and the REPL and the whole programming environment/desktop thing.
>>6
While in C, you have to figure out how to compile programs, deal with all the pointers crap, memory management, no easily available datastructures (though C++'s STL has some, thank you STL). There is a shitload of things you have to figure out in C/C++ before you can begin to program actual stuff. While in python or matlab, you can just start using a book or tutorial. It's shit easy and probably Logo is easier, never used it. ...My point being that interpreted languages are on the whole easier. And C/C++ is definitely fucking not easy and no one should ever start programming using them.
>>9
Yes, really. It seems to me you've never programmed anything more complicated than sorting an array. I hate the fucking around with arrays that I have to do in C to do any kind of vector/matrix stuff. Then there is the using libraries and making sure the fucking thing compiles properly. Making sure all of the fucking versions are correct. Yes, compiling is fucking annoying. Pointers suck especially with regard to keeping track of the levels of pointers and free-ing stuff. Then there is the ridiculous fucking shit that is loops instead of function maps/folds. It is absolutely fucking shit.
>And it's ridiculously easy for people to pick up matlab
Ah Matlab. Run a script for an hour only to get a "Inner matrix dimensions must agree." somewhere and you have no clue where it happened or why. That's when I decided to port all my stuff to a compiled language where it took 2 minutes to run.
That sort of sums up all my resentment of popular interpreted languages. Very few of those(Python especially) can do any kind of compile time checking.
I started with compiled languages, and stuck with them. I wouldn't recommend anything else to anyone
It would be nice if someone designed a CPU intended to have a 1:1 mapping to a higher level programming language. So you'd basically write in an assembly language, but it wouldn't be a complete clusterfuck.
For an absolute beginner, I would say that a good interactive interpreter would be the best choice. Much as snobs like to sneer and poke fun at it, BASIC was designed for just this task: Letting novices learn about programming.
Then, Python. Definitely Python. Let C wait for as long as possible. It's a systems programming language. There are better user programming languages.
I would also advocate learning a LISP and a FORTH for their totally different views, and your machine's assembler to see how things really happen on the floor.
Finally: Read a lot of source code. Write a lot of source code. There are no magic bullets that can replace that.
Two good docs for would-be programmers:
http://www.catb.org/~esr/faqs/hacker-howto.html
http://www.catb.org/~esr/faqs/smart-questions.html
ITT: Pussies who don't have the brain plasticity to learn assembly
>>17
I wasted all my grey matter on eroge and 4chan, leave me alone.
>>13
ASM is not a clusterfuck. C and its undefined behavior is a clusterfuck.
>Would you say it's easier for a newbie to pick up programming by learning an interpreted language ?
I would say it depends on what are you like/want to do more.
I'd recommend starting with PHP and continuing with C. Because it's easy.
I dare to object. Every self-respecting C compiler should spill warnings about UB, until you bend over. To top it off for a bit, stronger typing of C++ treats some UB as hard errors (while creating plethora of new ones in it's wild-west approach to OO).
>>20
Please don't start with PHP, for the love of God. That is the worst thing anyone could do.
>>22
I mean, feel free to learn it at some point as I fully understand it is necessary to know in some lines of work, but to learn it as a first language will give you bad habits that are hard to drop if they're the first things you learnt.
I recommend learning Scheme while reading SICP. It will start you off with a nice, high standard. Python is okay too if you would rather.
>>20
No, oh my god no. PHP is no. Just no.
Is you want to pick up an actual language that is easy, go with Python or Ruby.
PHP is an actual programming language. It is, however, not a general-purpose programming language.
>>21
Okay then, is there a static code checker that is programmed to detect [b]every[/b] possible UB there is?
PHP is a bad language for a beginner. It is far too difficult to find mistakes and the semantics are confusing. A beginner should take a language, which is clean and strict, so he will learn some discipline he needs for more loosely defined languages.
Look for strongly typed languages. Check if they don't have erratic behaviors like:
0 == "0" && 0 == "" && "0" != ""
Look how errors are handled. If these things look sane, it is useful as first language.
Paradigm doesn't matter. You can choose whatever style you want.
Sure, interpreted languages may seem easier at first, but if you want to get into advanced computer programming and computer science, you'll probably be using compiled languages.
Sure, interpreted ani may seem easier at first, but if you want to get into advanced anus penetration and penetration science, you'll probably be using compiled ani.
>>27
Had this issue when using empty() to check if a set of radio-button options had been filled in, but ticking the option with value 0 failed at validation. found out that empty() uses == rather than ===.
0 !== "0" && 0 !== "".
When you're more experienced, PHP teaches you to assume nothing... so why does (int) "" === 0 ?