Interpreted vs. compiled labguages (30)

1 Name: #!/usr/bin/anonymous : 2011-03-07 12:48 ID:Aep/pjix This thread was merged from the former /code/ board. You can view the archive here.

Would you say it's easier for a newbie to pick up programming by learning an interpreted language ?

2 Name: #!/usr/bin/anonymous : 2011-03-07 20:49 ID:my34MICF

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.

3 Name: #!/usr/bin/anonymous : 2011-03-10 17:38 ID:wrk12DB5

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.

4 Name: #!/usr/bin/anonymous : 2011-03-10 22:04 ID:ra5tCMAc

>>2

can I learn C from an interactive prompt ?

5 Name: #!/usr/bin/anonymous : 2012-01-26 01:56 ID:qGoZU+7A

>>1

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.

6 Name: #!/usr/bin/anonymous : 2012-02-19 20:46 ID:iYY5jLgh

>>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.

7 Name: #!/usr/bin/anonymous : 2012-02-19 20:52 ID:iYY5jLgh

>>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.

8 Post deleted.

9 Name: #!/usr/bin/anonymous : 2012-02-24 22:58 ID:Heaven

>>7

>compile programs
>pointers

Really?

10 Name: #!/usr/bin/anonymous : 2012-04-11 02:54 ID:GfmQ0aq6

>>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.

11 Name: #!/usr/bin/anonymous : 2012-05-19 20:05 ID:xWXd4FLl

>>6

>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

12 Name: #!/usr/bin/anonymous : 2012-05-22 14:39 ID:XdI8fTaE

13 Name: #!/usr/bin/anonymous : 2012-05-24 12:47 ID:yoaK5Bs/

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.

15 Name: #!/usr/bin/anonymous : 2012-06-14 20:50 ID:z3psBPne

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.

16 Name: #!/usr/bin/anonymous : 2012-06-18 13:30 ID:nCLwiqu9

17 Name: #!/usr/bin/anonymous : 2012-07-01 01:26 ID:E6kT7erT

ITT: Pussies who don't have the brain plasticity to learn assembly

18 Name: #!/usr/bin/anonymous : 2012-07-04 00:51 ID:Heaven

>>17
I wasted all my grey matter on eroge and 4chan, leave me alone.

19 Name: #!/usr/bin/anonymous : 2012-09-14 05:23 ID:6GcFPCrk

>>13
ASM is not a clusterfuck. C and its undefined behavior is a clusterfuck.

20 Name: #!/usr/bin/anonymous : 2012-10-09 13:52 ID:hKPHxe0D

>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.

21 Name: #!/usr/bin/anonymous : 2012-10-20 13:39 ID:77BK0eUh

>>19

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).

22 Name: #!/usr/bin/anonymous : 2012-11-24 14:31 ID:/vjq3rnG

>>20
Please don't start with PHP, for the love of God. That is the worst thing anyone could do.

23 Name: #!/usr/bin/anonymous : 2012-11-24 22:29 ID:Heaven

>>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.

24 Name: #!/usr/bin/anonymous : 2012-11-29 18:32 ID:7Bu9YmDM

>>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.

25 Name: #!/usr/bin/anonymous : 2012-12-06 19:55 ID:Rm+oYDsT

PHP is an actual programming language. It is, however, not a general-purpose programming language.

26 Name: #!/usr/bin/anonymous : 2013-07-11 19:01 ID:seY6nZns

>>21
Okay then, is there a static code checker that is programmed to detect [b]every[/b] possible UB there is?

27 Name: #!/usr/bin/anonymous : 2013-08-03 10:45 ID:2RNh0GIN

>>20

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.

28 Name: #!/usr/bin/anonymous : 2013-10-16 12:49 ID:GkO8z4RU

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.

29 Name: #!/usr/bin/anonymous : 2014-04-12 09:46 ID:4xxaYzhl

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.

30 Name: #!/usr/bin/anonymous : 2014-04-21 19:17 ID:N/YH8931

>>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 ?

Name: Link:
Leave these fields empty (spam trap):
More options...
Verification: