Choosing the Best Programming Language: A Guide for Beginners

  • Thread starter Kajahtava
  • Start date
In summary, C is a language which is oriented at making software, it has many constraints which make sense once you understand how a computer works on the inside, but C is not a good choice to begin to learn programming. For most people, Perl or Python are the best languages to learn because they're easy to learn and they just work.
  • #1
Kajahtava
106
1
Mod note:
This thread is an off topic splinter that has been brutally chopped out of the original thread. I am not sure if this thread has any merit but have perserved it for all the effort but into replys.
Integral




Depends on what you want to do.

Contrary to most people, I would not recommend C and C++, you need to understand how the machine and computers works for that (and quite frankly, I've a feeling from reading about how people approach C and C++ here, that they hardly understand C/C++ or its reason to choice it and just use it because they know no other languages)

C is mainly oriented at making software, if you want to program as in, automate tasks or getting a firm grip on structure of programming, it's certainly not the best place to start. C has many constraints which will seem absurd to you if you don't understand how a computer works on the inside, C programs also tend to be very unsafe unless you know what you're doing. All this comes at the benefit of excellent performance, this is why most low-level software such as operating systems and firmware is written in C, regardless that programmes written in C lack security by default.

For most people, Perl or Python is the optimal solution because things just 'work' there as you expect them to work with mathematical logic. Perl and Python though are candy in that they make things quite easy for you, they're also not very 'elegant' languages, they're 'more is more' languages, with various ad-hoc solutiosn to problems.

On the other end of the spectrum you have languages which are elegant and consistent, like Scheme (or Common Lisp?), Haskell and APL, all of which require some mathematical insight, but programming in them will in the end give you a great asset into structured and well-thought of programming. It teach you to think structured and efficient. APL is well known for its capability to place complex programs in one line, programming in APL generally means to first sketch the structure of your program and then implement it, Perl and Python generally you make it up as you go.

Lastly, you have languages such as Smalltalk, Ruby and Logo, these are very 'conceptual', they don't as much deal in abstract mathematical structures but more in human concepts while steal retaining their elegant and well-structured nature.

Also, K&R is archaic and teaches a standard of C that is pretty much recommended against using nowadays, not in the least because it was never really standardized. Also, C is particularly bad for root finding functions and ends up becoming verbose for that, that's not what C was ever intended for, C was intended to write software, system software and application. C is not a tool to help you solve problems, it's a remote control for your CPU because reaching to it and using assembly becomes tiring.
 
Last edited by a moderator:
Technology news on Phys.org
  • #2


Jeff Reid said:
K&R is more of a C language definition book than a learn how to program book.
First edition is, not second. Also, it's a language definition of a very old and never very standardized dialect of C.

What you'd proably want instead is a "primer" for C. Better still would be a training book that starts off a minimalist C program, then goes through a series of programs, each one a bit more advanced and teaching one new aspect of programming at a time. You might consider an assembly primer as well.
I'm still to contend that C is inhaerently a bad choice to begin to learn programming, especially for people still in high school.

C has a lot of limitations which make sense once you understand how a computer works on the inside, but for the most part they will seem absurd on the perspective of the language itself. Also, many people that program in C only do so because they've never learned another language, and program in C badly and program in a style what other languages are much better suited for.

Unless you plan on coding an implementation for another language, an operating system, or a hardware driver, really, there is no reason to program in C. C isn't a programming language in the traditional sense, it's a way to get your computer to do certain things on the machine level.

I mean, some examples of copying a string in different languages:

Perl or PHP
Code:
$a = "string";
$b = $a; # a is copied to b, that was easy.

APL:
Code:
a <- 'string'
b <- a

Scheme
Code:
(define a #f) (define b #f) ;we first have to define them, it already gets more complex.
(set! a "string")
(set! b a) ; but still, fairly straightforward
(Copying strings is by the way not really a thing you'd tend to do in Scheme, you often don't need to change the value of variables at any point, hence it's a bit more verbose)

And finally, C (do not try this at home)

Code:
char *a = malloc(256); //reserve 256 byes of memory, convert the void pointer to a character pointer and store the value that points to the first byte of memory into the a variable.
a[0] = 's'; a[1] = 't'; a[2] = 'r'; a[3] = 'i'; a[4] = 'n'; a[5] = 'g'; //Yaaaaaap, this is how it goes.
char *b = malloc(256); //reserve 256 bytes of memory again.
while(*b++ = *a++); //why can't we just use a simple assignment? why this cryptic construct? Why not just b = a? Is there any reason for this? Sure there is, that's  because strings don't really exist in C, you simulate their behaviour yourself, you also can't directly pass them to functions.
print(*b); // prints "string", voilla.

Now, OP, this is why I would not recommend C. That it works like this has nothing to do with 'candy' or 'making it easy', and other languages aren't 'impure' because it's a lot simpler there. C was never designed to make 'programs' as in, algorithms that solve problems for you in, C was designed to control your processor at the low level in a portable way with the benefit of structured programming instead of the spaghetti hassle of assembler. There were plenty of languages before C that allowed easy string copying and it hadn't a thing to do with the technology of the time.

Also, C will not at all have more performance unless you understand the inside of a computer. C is probably the most abused language on the face of the planet today, too many people use it for things it was never designed to do for. It wasn't even designed to print 'Hello, World!' on a terminal, it was designed to make the terminal 'Hello, World!' is printed on.

And though languages like Perl may copy the syntax of C, they have little to do with C and it's a common error to approach the one as the other.
 
  • #3


malloc is not even used much anymore and there is a call "strgcpy" that copies a string from one to another. there is no need to allocate memory because the memory is either in the strings definition or auto-allocated when the string is copied as defined.
I learned C back just after ANSI C was formed and ANSI C is still used more often to write software than any other language. C++ has finally reached the point where it has an ANSI form too.
I began writing programs in 1978 when I taught myself Basic and did everything "wrong" to save space in my code. Then I moved to GWbasic, Qbasic, Acouple of structured languages and finally C, C++. You can do anything with C and C++ that you can with any language (including cross platform programming in the ANSI versions) but it requires you to be meticulous in planning, writing and execution of your software. You can include ASM code into the program and force fast operation. It was written to handle complex code and that means you can write for games, math, engineering and communication and about anything else you want to do with it. I typically write stand-alone programs as a hobby and have had much better software since I switched to C and C++. It is one of the most powerful programming languages in use - and it is the most popular. That is likely why it is also the "most abused" - how ever you define or justify the comment.
 
  • #4


PaulS1950 said:
malloc is not even used much anymore and there is a call "strgcpy" that copies a string from one to another. there is no need to allocate memory because the memory is either in the strings definition or auto-allocated when the string is copied as defined.
At compile time, not at runtime.

You need malloc and realloc for dynamic allocation.

Also, strcopy looks like that on the inside. It would be even more cryptic if I used strcopy.

You can do anything with C and C++ that you can with any language (including cross platform programming in the ANSI versions) but it requires you to be meticulous in planning, writing and execution of your software.
Of course, it's Turing Complete.

That still says nothing about how convenient it works and above all how C is not the best language for people to start with.

You can include ASM code into the program and force fast operation.
ASM again is not the place to start for people that want to learn how to program.

It was written to handle complex code
What is 'complex code'?

The C example sure looks quite complex yes.

and that means you can write for games, math, engineering and communication and about anything else you want to do with it.
You can also do that in Conway's game of Life.

I typically write stand-alone programs as a hobby and have had much better software since I switched to C and C++.
What other programming languages or paradigms have you used?

It is one of the most powerful programming languages in use
No, it's one of the least powerful programming languages in use, which is a conscious decision to gain performance at the expense of expressiveness.

Python is probably the most powerful programming language in use (also one I don't like because of its ad-hoc nature), but it can do about anything, it has a lot of things C/++ doesn't support like first-class functions, duck typing, first-class strings, first-class arrays, currying, dynamic class generation, closures,

C/++ are extremely minimal and not at all powerful, I mean, do you know any other language in use today that does not support first-class strings or arrays?

and it is the most popular. That is likely why it is also the "most abused" - how ever you define or justify the comment.
I think Visual Basic.NET is more popular, as are PHP and JavaScript, all also very much abused.

But really, I like to see some backing of C being 'powerful', because a conscious design effort was to remove some features which were already standard at that time to better facilitate low-level functions. Not in the least no longer having arrays/strings as a proper data-type but using an ad-hoc solution with pointers in their place. Bounds checking is expensive you know...
 
  • #5


Kajahtava said:
I mean, some examples of copying a string in different languages:

C++:

Code:
string a, b;
a = "I am a string.";
b = a;

In C++, there's also no need to muck around with pointers when using arrays, if you use vectors instead:

Code:
vector<string> names(3);
names[0] = "Larry";
names[1] = "Curly";
names[2] = "Moe";
for (int k = 0; k < names.size(); ++k)
{
    cout << names[k] << " ";
}
cout << endl;
 
  • #6


jtbell said:
C++:

Code:
string a, b;
a = "I am a string.";
b = a;
Either C++ has significantly, and significantly changed since I last used it, not to mention breaking backwards compatibility. Or this isn't copying, this is assigning.

What happens if you do

Code:
b[0] = 'i';

Does a also change to "i am a string" with it?

Furthermore, what is the memory allocation to a and b, is it both exactly 15 bytes?

What if I later on want to concatenate to one of them? The main reason you copy a string into a new memory space is that you want to change it.

In C++, there's also no need to muck around with pointers when using arrays, if you use vectors instead:

Code:
vector<string> names(3);
names[0] = "Larry";
names[1] = "Curly";
names[2] = "Moe";
for (int k = 0; k < names.size(); ++k)
{
    cout << names[k] << " ";
}
cout << endl;

The same in PHP:

Code:
$names = array("Larry",  "Curley",  "Moe");
Foreach $names as $name {echo $name . " ";} echo "\n";
Significantly less verbose, isn't it?

How about this example in Scheme, showing the benefits of structured higher order programming:

Code:
(define names (list "Larry" "Curley" "Moe"))
(display-all (append (map append-space names) "\n"))

Now, I feel an arrogant ***** for saying this, but after reading this topic and the defences of C here for jobs it was never meant to do, I seriously doubt the understanding a lot of people here have of C/++ and above all what makes it good. So I like to ask you people a view quaestions (consider me erroneous if you can answer them)

A: What is the reason all members if an array have to have the same type.
B: Why do pointers have types instead of just being integers?
C: What is 'turing completeness' (Yeah, one comment made me sceptical')
D: Explain in your own words 'static typing'. (Protip: In static typing, variables have types, and not their values doesn't work.)

And last but not least:

E: in your own opinion, justify the use of C/++ for a beginner to learn programming. When there are languages out there such as Logo or Scheme which were designed as teaching languages, as in, designed to let beginners get a firm grasp of well-structured programming from the beginning while C keeps you so much occupied with memory management that the overall structure of the program goes lost.

C/++ really enforces a bad style of programming with various ad-hoc and unsafe solutions to problems simply get get that performance. Which really is not necessary for the most part.

The Scheme code above there is an example of well-structured programming. Of course 'names' is a variable, in Scheme a symbol, that points to the list of names, append-space is obviously a function such that "string" -> "string ", we can use (map append-space '("Larry" "Curley" "Moe")) to refer to the list '("Larry " "Curley " "Moe "), we then use append, to gain the list '("Larry" "Curley" "Moe" "\n") and finally run display-all on that list, which does what you expect.

This is well-structured because of the rule of freest context, each part of the program isolated on its own has a well-defined meaning, it's if you know what 'name' refers, the context of the parts of the program are not relevant to determine what they refer to. Also, scheme is an expression-oriented language, all things are expressions. Which facilitates teaching the mind thinking in well-structured and maintainable code. In C/++, this is not the case and the context is needed to understand the meaning of isolated parts of the program, it's meaning is not lexically inferable.
GreatEscapist said:
Well that didn't make a whole lot of sense.
But I do think that starting with the how/why programming works with computers is a better way to go.
But after that, I shouldn't learn C first? I always thought that's where everyone started. (Minus HTML and java. Everyone knows that.)
They do as autodidacts simply because all people tell them to, I made the same mistake, I later on realized that this was not the way to go. HTML is also not a turing complete language.

A very good piece of literature to learn programming is Structure and Interpretation of Computer Programs (SICP), which uses Scheme as an example language because Scheme is a highly structured language. But A: C is a bad place to start. B: the majority of people that started with C still don't understand C and use it in a way that does not benefits from C's strength, it's low level yet portable nature, and instead program in a style in it that you think 'Get a dynamically typed string-oriented language for this...'
 
Last edited:
  • #7


jtbell said:
C++:
Code:
string a, b;
a = "I am a string.";
b = a;

Kajahtava said:
Or this isn't copying, this is assigning.
It's defined a assigning a copy of the source string. You could have d = a + b + c, to assign a copy of the concatenation of 3 strings.

A: What is the reason all members if an array have to have the same type.
C or C++ get's around this limitation by using structures or classes. APL requires all members be of the same type, APL2 allows each member to have it's own type.

B: Why do pointers have types instead of just being integers?
Depending on the machine, they may be different sizes (for 68000, integers are 16 bit, pointers are 32 bits).

E: in your own opinion, justify the use of C/++ for a beginner to learn programming.
If you keep the initial programs used to learn very simple, such as only using numbers and not strings, then the required sub-set of most languages is simple to learn.

C/++ really enforces a bad style of programming with various ad-hoc and unsafe solutions to problems simply get get that performance.
I don't think a student's initial programming experience is going to be concerened with performance. The classic recursion method for calculating factorial isn't efficient, but it can teach recursion.

Which facilitates teaching the mind thinking in well-structured and maintainable code.
I don't think this is a necessary goal for a new student. Just learning the basics of programming is enough. They need to understand how to program before they start to worry about structured or maintainable code, which are somewhat subjective terms.

In C/++, this is not the case and the context is needed to understand the meaning of isolated parts of the program, it's meaning is not lexically inferable.
Considering most initial programs will be 10 to 30 lines long, I don't think this is an issue.

Perhaps the initial experience should be some interactive language, such as basic or APL, but after a few programs, the student could move onto another language like C, simply based on it's popularity for software development.

I still like this programming teaching tool / puzzle that can be introduced early into the learning experience:

https://www.physicsforums.com/showpost.php?p=1347155&postcount=1
 
  • #8


Kajahtava said:
Contrary to most people, I would not recommend C and C++, you need to understand how the machine and computers works for that
I disagree with that. I work with a lot of people who know how to program in C or C++ but haven't the foggiest idea how computers work.
... APL, all of which require some mathematical insight, but programming in them will in the end give you a great asset into structured and well-thought of programming. It teach you to think structured and efficient. APL is well known for its capability to place complex programs in one line, programming in APL generally means to first sketch the structure of your program and then implement it ...
You must be joking. The only reason for mentioning APL is as an example of one of the many mistakes made in the search for a good programming language/paradigm.

Kajahtava said:
And finally, C (do not try this at home)

Code:
char *a = malloc(256); //reserve 256 byes of memory, convert the void pointer to a character pointer and store the value that points to the first byte of memory into the a variable.
a[0] = 's'; a[1] = 't'; a[2] = 'r'; a[3] = 'i'; a[4] = 'n'; a[5] = 'g'; //Yaaaaaap, this is how it goes.
char *b = malloc(256); //reserve 256 bytes of memory again.
while(*b++ = *a++); //why can't we just use a simple assignment? why this cryptic construct? Why not just b = a? Is there any reason for this? Sure there is, that's  because strings don't really exist in C, you simulate their behaviour yourself, you also can't directly pass them to functions.
print(*b); // prints "string", voilla.
Oh please. That is utter nonsense and you know it.

Code:
char * a = strdup ("string");
Kajahtava said:
A very good piece of literature to learn programming is Structure and Interpretation of Computer Programs (SICP)
Oh please again. The original poster is a *high school student*.

GreatEscapist, I strongly suggest you take everything said in this thread by Kajahtava with a huge grain of salt. There are lots of proselytizers for/against various programming languages, and Kajahtava appears to be one of them.GreatEscapist, to learn to program on your own you I suggest you start with a simple language. Java and Python are simple and you can get free interpreters for both. When you get to college, take a class in computer programming, even if it turns out that computer programming is not your chosen career path. For one thing, in learning to program on your own you will learn some bad habits; you will need to unlearn them. For another, while you might learn to write programs on your own, you are less likely to learn the reasons why those programming constructs work. You won't learn to see the big picture.
 
Last edited:
  • #9


Jeff Reid said:
It's defined a assigning a copy of the source string. You could have d = a + b + c, to assign a copy of the concatenation of 3 strings.
I take it this is an ad-hoc overloading?

Why doesn't it assign a *char pointer?

C or C++ get's around this limitation by using structures or classes. APL requires all members be of the same type, APL2 allows each member to have it's own type.
That's not an answer to my quaestion, it's not a limitation, it's a conscious effort.

Depending on the machine, they may be different sizes (for 68000, integers are 16 bit, pointers are 32 bits).

Well, if that were true we could just declare long and short pointers.

Tip: array[index] is syntactic sugar for *(array+index).

If you keep the initial programs used to learn very simple, such as only using numbers and not strings, then the required sub-set of most languages is simple to learn.
This is most true, however after a couple of days in Perl or Python you're already performing regular expression matches against being frustrated in C why if("string" == "string") doesn't quite work.

I don't think a student's initial programming experience is going to be concerened with performance. The classic recursion method for calculating factorial isn't efficient, but it can teach recursion.
Which can also be done in any other language?

My point was that the only benefit of C is performance at the cost of structured programming, since performance is not an issue, better take a more structured language.

I don't think this is a necessary goal for a new student. Just learning the basics of programming is enough. They need to understand how to program before they start to worry about structured or maintainable code, which are somewhat subjective terms.
Well, I disagree, as Dijkstra said, if you start on the wrong foot you will have artefacts in your style for the rest of your life.

In fact, I daresay the essence of learning to program well is first learning how to design the structure of a program, and only then translating it to a given language. There's portable code, and there are portable structures of programs.

Considering most initial programs will be 10 to 30 lines long, I don't think this is an issue.
It does condition the mind in the end to see programs more structured.

Perhaps the initial experience should be some interactive language, such as basic or APL, but after a few programs, the student could move onto another language like C, simply based on it's popularity for software development.
I think BASIC is a bad teaching language, I'm still to say that Perl or Python are for most people the best way to start, they have a REPL which enables one to get the feel of the language quickly but they aren't 'too structured' for beginners like Scheme and APL.

On the other hand, Logo and Smalltalk are also nice to begin because they're conceptual yet structured.

The only reason one has to use C is performance, and to get that performance one has to understand how the machine works. If not, often Python code in fact has more performance.

D H said:
I disagree with that. I work with a lot of people who know how to program in C or C++ but haven't the foggiest idea how computers work.
I see that a lot too, that's why their C code is bad and what they do would be more efficient, not to mention a lot easier in a language like Perl.

You must be joking. The only reason for mentioning APL is as an example of one of the many mistakes made in the search for a good programming language/paradigm.
For people that don't understand it maybe. That APL still has a strong userbase that defend it and call it brilliant and that all people who've sat through the learning curve and become proficient in it adhaerant it.
Oh please. That is utter nonsense and you know it.

Code:
char * a = strdup ("string");
This does not copy a string.

Why do we want to copy a string? Obviously because we want to change it while retaining the original. So, we want the memory allocation of the new one to be larger than the data itself so that we can concatenate to it.

Oh please again. The original poster is a *high school student*.
It does not assume a lot of prior knowledge.

GreatEscapist, I strongly suggest you take everything said in this thread by Kajahtava with a huge grain of salt. There are lots of proselytizers for/against various programming languages, and Kajahtava appears to be one of them.
I'm not against C, I'm against using C for just about anything because one knows no other languages.

GreatEscapist, to learn to program on your own you I suggest you start with a simple language. Java and Python are simple and you can get free interpreters for both. When you get to college, take a class in computer programming, even if it turns out that computer programming is not your chosen career path. For one thing, in learning to program on your own you will learn some bad habits; you will need to unlearn them. For another, while you might learn to write programs on your own, you are less likely to learn the reasons why those programming constructs work. You won't learn to see the big picture.
So strangely, in the end, we agree but for different reasons? I called Python or Perl for most people the best place to start.

I wouldn't call APL a good place to start by the way for most people, but it is a language that will condition your mind to program in a highly structured and well-thought-of manner.
 
  • #10


strdup does make copy a string. RTFM.

Your straw man portrayal of string duplication in C belies your anti-C mindset. Use of fallacies is against the rules here. Please follow them.

Pperl is anything but a good language for beginners. I like perl (I like it a lot; other languages have regular expressions, but none come close to the versatility of perl's). However I would never recommend that as a choice for someone new to programming learn it. While perl is powerful, it is an ugly, ugly language.

As is APL. APL is one of the ugliest languages I have learned. It was a mistake. The APL fan base is small, probably smaller than the Commodore 64 fan base (who are also quite religious in their fanaticism).
 
  • #11


D H said:
strdup does make copy a string. RTFM.
Yes, strdup... string duplicate... makes a copy. But not like this:

Code:
char *a = strdup("string")

Code:
char a[] = "string";
char *b = strdup(*a);

Is copying a string.

Your straw man portrayal of string duplication in C belies your anti-C mindset. Use of fallacies is against the rules here. Please follow them.
It's not a straw man, it's highlighting a point, you may use 'strdup' yes, but how many memory have you allocated to hold the new string then? All things you have to consider in C depending on what you want to do with that string? I specifically used malloc and commented it to show that I allocated 256 bytes to hold six characters, depending on what I want to do with that string it's a reasonable option.

After that still comes freeing the memory once you're done.

And you've still ignored the point I raised four times already. Why do you want to copy a string, in C, what you plan on doing with it eventually determines how you're going to copy it. If you just plan on changing one character you can use strdup. But what if you want to copy a string to serve as the start of a very much larger string? Then you need to allocate more memory and you're stuck with malloc again.

Pperl is anything but a good language for beginners. I like perl (I like it a lot; other languages have regular expressions, but none come close to the versatility of perl's). However I would never recommend that as a choice for someone new to programming learn it. While perl is powerful, it is an ugly, ugly language.
It is ugly, but that's not very relevant for beginners. And I don't like Perl by the way to work in myself.

As is APL. APL is one of the ugliest languages I have learned. It was a mistake. The APL fan base is small, probably smaller than the Commodore 64 fan base (who are also quite religious in their fanaticism).
APL is one of the most beautiful and and consistent languages out there. APL was really 'thought of', it all follows from each other. It's also hard to understand.
 
  • #12


NeoDevin said:
If you're making a conscious effort to learn, as opposed to simply "getting the job done", you'll come out of learning C or C++ as a better programmer, with a better understanding of computers.
I think this should go in the reverse, first learn how a computer works, then learn C. Not learn how a computer works for C.

In a lot of other languages you can learn to program "well" without ever learning anything about how the computer works or why you should do things a certain way. Your programs will be slower too. For research applications it's important that my code be as fast as possible. While you're writing simple programs, a factor of 2 in performance is nothing. You'll never care if you computer takes 5 milliseconds to run instead of 10 milliseconds. But if you're ever doing complex numerical calculations (I had some programs running for weeks on a super-computer last year to calculate some results) then even a small fractional improvement in performance can be significant, meaning you take 1 week, instead of 2 to get results.
This is absolutely a reason to use C. However, this is not 'learning how to program.'

Also, FORTRAN is also a candidate here.
 
  • #13


What is your hangup against C, Kajahtava?

To GreatEscapist, Yet another reason to learn C is that this is where the market is. Java, C++, C#, and Objective-C all have their roots in C. To do a good job in one of those languages that derive from C it is helpful to learn C. Those five languages (C, Java, C++, C#, and Objective-C) are *the* market, and will be for a long time. Except for Python, the languages that Kajahtava has recommended (Lisp/Scheme, APL, Haskell, Smalltalk, Ruby and Logo) are niche languages that have very limited/non-existent market presence . Some language proselytizers hate C, not so much because it is a bad language but because the dominance of C means their pet languages can't compete.
 
  • #14


Kajahtava said:
quite frankly, I've a feeling from reading about how people approach C and C++ here, that they hardly understand C/C++ or its reason to choice it and just use it because they know no other languages

Eh?

Kajahtava said:
Also, many people that program in C only do so because they've never learned another language, and program in C badly and program in a style what other languages are much better suited for.

Ah, so the plural of anecdote is data...

Kajahtava said:
C isn't a programming language in the traditional sense...

Even by the standards of internet message boards, this is a bizarre thing to say.

Kajahtava said:
C was never designed to make 'programs' as in, algorithms that solve problems for you in, C was designed to control your processor at the low level in a portable way with the benefit of structured programming instead of the spaghetti hassle of assembler. There were plenty of languages before C that allowed easy string copying and it hadn't a thing to do with the technology of the time.

Although nobody who's actually familiar with using C to get work done would ever need this explained to them, this is the reason one uses libraries. Whether these libraries come bundled as part of the standard or not is irrelevant: essentially all languages are "difficult" to use without employing libraries that extend the functionality of the language beyond the core standard. Try using Python without any import statements, C++ without any includes, or C# without any using directives.

Kajahtava said:
Python is probably the most powerful programming language in use (also one I don't like because of its ad-hoc nature), but it can do about anything, it has a lot of things C/++ doesn't support like first-class functions, duck typing, first-class strings, first-class arrays, currying, dynamic class generation, closures,

Currying, first-class functions, duck typing and so forth can all be implemented in C++ using Boost, something any serious C++ programmer will be familiar with.
 
  • #15


D H said:
What is your hangup against C, Kajahtava?
Nothing, it's just a language intended for high performance computing by hardware specialists that already had a firm understanding of how a computer works, not as a language to start learning how to program and design programs in.

As I said in my first post, 'it all depends on what you want to do', I divided languages along the lines of what they were suited for. C is not a teaching language, that's all.

To GreatEscapist, Yet another reason to learn C is that this is where the market is. Java, C++, C#, and Objective-C all have their roots in C. To do a good job in one of those languages that derive from C it is helpful to learn C. Those five languages (C, Java, C++, C#, and Objective-C) are *the* market, and will be for a long time. Except for Python, the languages that Kajahtava has recommended (Lisp/Scheme, APL, Haskell, Smalltalk, Ruby and Logo) are niche languages that have very limited/non-existent market presence . Some language proselytizers hate C, not so much because it is a bad language but because the dominance of C means their pet languages can't compete.
Sure, C has the market, but the OP wanted to learn how to program. C is a language mainly made to design applications and software in, so obviously it has the market. I mean, it's good for what it was designed for, very well designed language for that, but it was not designed as a teaching language and consequently is a bad language to get a feeling for algorithms in.

- Lisp/Scheme, APL will give you a firm understanding of the structure of algorithms, consequently, they are used to write programs that find solutions to problems you might have, that automate tasks.
- Haskell I wouldn't try unless you happen to already know things about lambda calculus and combinatory logic and the term 'Howard-Curry correspondence' has meaning to you. Haskell is used to write applications that depend on complex principles, like writing a physics engine, Haskell is your friend then.
- Smalltalk, Ruby and Logo are great languages to start with, they're 'conceptual' as in, they deal with human concepts instead of abstract and mathematical concepts, but still retain a well-structured data. They can easily be used as scripting languages.
- Perl, PHP, Python are effectively a sort of C that doesn't sacrifice accessibility for performance. Though Perl and PHP aren't as well-structured as Python. But they can all be used to manipulate text files very well.
- C/C++ Java are designed to make consumer applications for the most part, they aren't made to express algoritms.

NeoDevin said:
I would have recommended it if it weren't obsolete and hardly ever used anymore, except for a few aging academics.

I had to learn some FORTRAN to make some of my advisor's old code work with my C++.
Hmm, I'm not sure but I believe that supercomputer benchmarks are still written in FORTRAN.

It also depends on what you want to calculate, if you don't really have to solve a problem, but just have to process a lot of numbers, then C and Fortran are the way to go, if you have to write a program that for instance will calculate for you how to optimally place some objects in a box, then Haskell or some form of Lisp shall be your friend.
 
  • #16


NeoDevin said:
I would have recommended it if it weren't obsolete and hardly ever used anymore, except for a few aging academics.

Fortran is many things, but obsolete it ain't. Show me a pair of programmers, one of whom is an expert in Lisp/Scheme/Ada/etc and the other of whom is an expert in Fortran, and ask the job market who is in more demand.

Hint: it's the Fortran expert, by a mile.


Regardless, this thread has surely strayed far enough from the OP's question. The pseudo-intellectual masturbation about why C isn't as "good" a language as someone's pet niche language is as tiresome now as it was twenty years ago.
 
  • #17


shoehorn said:
Even by the standards of internet message boards, this is a bizarre thing to say.
Not at all, C was radically different when it was introduced. It was machine-oriented and not assembly. In the days C was introduced, almost all languages were already no longer machine-oriented but rather a way to express algorithms. C isn't, it's a way to control a processor.

Although nobody who's actually familiar with using C to get work done would ever need this explained to them, this is the reason one uses libraries. Whether these libraries come bundled as part of the standard or not is irrelevant: essentially all languages are "difficult" to use without employing libraries that extend the functionality of the language beyond the core standard. Try using Python without any import statements, C++ without any includes, or C# without any using directives.
Sure, but it's also a reason why C is not a good place to start when you want to learn how to program.

If you want to give people an appreciation of control structures, surely you want them to just be able to simply use
Code:
if(a == b) ... else ...
instead of hassling with a string compare library?

Currying, first-class functions, duck typing and so forth can all be implemented in C++ using Boost, something any serious C++ programmer will be familiar with.
I'm quite sure we have a different definition of first-class function, duck typing and so forth.

This is actually a pretty common debate, with some C++ programmers advocating that they are first-class and higher-order programmers countering that those people missed the entire point of first-class functions and that it's more than just anonymous functions.

http://lambda-the-ultimate.org/node/1313

Might be interesting to read.
 
  • #18


Kajahtava said:
As I said in my first post, 'it all depends on what you want to do', I divided languages along the lines of what they were suited for. C is not a teaching language, that's all.
That many introductory computer science classes and many classes beyond are C-based falsifies this conjecture.


C/C++ Java are designed to make consumer applications for the most part, they aren't made to express algoritms.
Oh please, again.

Can we get off the anti-C garbage? It isn't helping the OP one iota. Fine, you have a bias (an irrational bias) against it. Let it be.
 
  • #19


D H said:
That many introductory computer science classes and many classes beyond are C-based falsifies this conjecture.
I like to see some backing of this claim. I have never seen a programming class using C as an example language.

Oh please, again.

Can we get off the anti-C garbage? It isn't helping the OP one iota. Fine, you have a bias (an irrational bias) against it. Let it be.
Like I said, I'm not anti C, that's what you make of it. I'm anti C as a teaching language opposed to a language to write (not design) software in.

You also have a tendency to cherry pick the points you go into. And not go into some points which I explicitly marked as relevant. (Why do we copy a string?)
 
  • #20


http://en.wikipedia.org/wiki/How_to_Design_Programs

Anyhow, this also seems like a nice piece of literature. It seems to teach programming in a well-structured way, first asking yourself what the input is, then how the output must depend on the input, and then writing the translation scheme that is your program.
 
  • #21


GreatEscapist said:
:frown:
Now I'm just friggin confused. But it was my fault for not being specific in my OP.
Okay. Well, I have somewhat of a grasp on Java, and I can do DOS. (Hey...I have a real old computer. :wink:)
I eventually want to end up in game design (God, don't tell my mom I want to work on video games...) but I know that I would have to do regular programming first. So, what's good for ending up in games?
For the hard end of it, C, definitely, the firm layer of games must be done in C, the interface between the OS and the game.

Different specific parts, hmm, 3D engines are probably more of Haskell's domain, but the efficiency of Haskell object code greatly depends on the compiler used. But the GHC has a reputation of outperforming C on some parts. (Not making an interface between the OS and the game).

The AI of the game, I guess Scheme or Prolog is the best candidate for that.

(Yeah, I'm pointing out that different tasks need different languages)

And I do want to know how everything works. I'm one of those annoying kids that high school teachers hate because i want to know exactly HOW stuff works. Not why. (That's why I love physics.) So I'm definitely going to pick up a few books on computers anyway. I know ideas of how stuff works, but not a great one.
And hey, now, I'm a pretty damn smart high school kid. :P
Then learning about how a CPU works and all that **** might interest you, look after these terms: Register machine, turing machine, Von-Neumann architecture, RISC, virtual memory, memory location et cetera.

But as I said at the start, it all depends on what you want to do, I keep stressing that I have nothing against C, but it's not a teaching language, if you can code in C, you can code in C, that's it, it's not a language that will teach you good well-structured and thought-of programming. I would still recommend SICP as a teaching book for how to design programs and solve problems. I might give the pros and cons of each language/type.

- The pro of C is obviously very direct control over what the machine does, if you use this well this can lead to high performance, if you use it badly like trying to ad-hoc curry in C, it will lead to worse performance than languages that automate this for you.
- C also teaches you as you go how a computer works on the inside to some degree, but knowing it beforehand could be a plus.
- Obvious downside of C is that it can do very little and you have to do a lot of things yourself which other programs do for you. C doesn't free memory after you used it and similar things.

- The pro of languages like PHP Perl and Python is that they aren't burdened by the limitations of the machine, you can't just that easily store values of different types in arrays, you might wonder why, but it has to do with that arrays are actually not a proper datatype in C but syntactic sugar over pointers. You can't just return strings or directly pass them to functions, you have to use pointers to strings. PHP, Perl and Python are devoid of this as they aren't targeted at the machine but more to be seen as abstract languages on their own. They are thus great for scripting, searching files on your computer and all those things, als great for generating web-pages and any-thing to do with text opposed to with numbers.
- Obvious downside of the first two is that they have no internal cohesion whatsoever, they are 'ad-hoc' (latin for "For this [specific case]" in case you wonder), Python though is relatively free of this. Python is also far more expressive than the former two.

Then you have languages like Scheme/Lisp, there's a reason all books on designing the structure of a program opposed to teaching you a specific language work with Scheme as an example, because it's an extremely structured language. It's in fact so structured that for many people it starts to become difficult to read. They're also 'homo-iconic', this is a fancy term for that there is no real difference between the code of your program, and the data it manipulates. In fact, your program itself is a datastructure, it's in effect a piece of datum that holds the exact steps needed to compute the result. You can find this amazing, or you can find this a pain.

And finally come languages like Smalltalk and Ruby, which work very 'conceptually', it's about modelling the world around you and putting that into your program. For some people this approach is intuitive, to others they think they don't really know any more what they are doing.

So: C is for expensive numeric computation / application software. PHP/Perl/Python is for manipulating files on your computer and similar things, Scheme/Lisp/APL is for structured solving of problems and Ruby/Smalltalk, well, that's a paradigm on its own I guess.
 
  • #22


GreatEscapist said:
:frown:
Now I'm just friggin confused.
That's 'cause you paid attention to the one person who you should have ignored.

Okay. Well, I have somewhat of a grasp on Java, and I can do DOS. I eventually want to end up in game design (God, don't tell my mom I want to work on video games...) but I know that I would have to do regular programming first. So, what's good for ending up in games?
C#, because of the Microsoft influence, and C++ and C.

Best advice: ignore Kajahtava.

After that, start with some simple programs. Pick up a book on those languages that have exercises. Try your hand at a few of those exercises. There are many such texts.

Work your way through loops. Learn to understand what an invariant is, and a loop variant.

Learn about data structures. This is the first step from purely procedural to object oriented techniques.

Most computer game developers use a graphics library to draw those pretty pictures on the screen. Java has a (rudimentary) graphics capability. Learn to make some simple user interfaces. These are simple and slow; eventually you will want to move on to something more sophisticated such as OpenGL.

That's a pretty full plate for a high school student.
 
Last edited:
  • #23


C# is completely useless outside the Common Langauge Infrastructure.

It's essentially a version of Java that is catered towards the CLI and made very type safe. No one designs games on C# and both BSD and the FSF take an active stance against using C# as they fear it's a ploy from Microsoft to make people dependent on a lighter version of Java they have some control over, though it's an ECMA standard.

As far as some one quoted C because of popularity:

BASIC remains popular to this day in a handful of highly modified dialects and new languages influenced by BASIC such as Microsoft Visual Basic. As of 2006, 59% of developers for the .NET platform used Visual Basic .NET as their only language.

http://www.linux-watch.com/news/NS5656359853.html

I'm going to stress it again and again, it depends on what you want to do, different aspects of a game are written with different languages. I've explained the pros and cons of various languages and said why.

Whether you want to listen to the guy who in his first post already said 'depends on what you want to do' and explained the difference between different languages, or to the horde that said 'C!' before they even knew what you wanted to do and to this point keep defending that C is supposedly the best for about every-thing. (And name C# and C in one sentence while the languages are nothing alike except for syntax), that's your own choice.
 
Last edited by a moderator:
  • #24


Can you please stop? You're contributing much heat to this thread, and very little light.

The OP's question was teeth-grindingly simple: What is a good language for a complete novice to learn? Several people made perfectly reasonable suggestions for suitable languages. Only one person had made even a casual point in support of C before you jumped on with your ill-advised - and utterly inappropriate - theories on what C is.

Not only are you spouting off about extremely advanced concepts (almost all of which are entirely irrelevant to anyone without an interest in computer science, and certainly so to somebody with no programming experience whatsoever), you also took the opportunity to have a sly dig at anyone here who even suggests that C might be a suitable first language to learn. This in spite of the fact that there are undoubtedly people here who have written hundreds of thousands of lines of C/C++ code and who are almost certainly more familiar with the language than you.

Your contribution to this thread amounts to nothing other than helping to confuse the OP, who asked a perfectly reasonable question. We get it: you know a little bit about programming languages and want to show off to a newb.

Please stop; it impresses nobody.
 
  • #25


shoehorn said:
Can you please stop? You're contributing much heat to this thread, and very little light.

The OP's question was teeth-grindingly simple: What is a good language for a complete novice to learn? Several people made perfectly reasonable suggestions for suitable languages. Only one person had made even a casual point in support of C before you jumped on with your ill-advised - and utterly inappropriate - theories on what C is.
I had two whole paragraphs about C and the rest was recommending other languages and listing their strengths and weaknesses, after that people quoted my part on C and displayed profound ignorance of the world of programming and not to mention did not go into my entire post and kept ignoring the one point I have marked as explicit for six times now, so again: Why do you copy a sting?

Not only are you spouting off about extremely advanced concepts (almost all of which are entirely irrelevant to anyone without an interest in computer science, and certainly so to somebody with no programming experience whatsoever)
They aren't advanced, they're just concepts that C lacks, if you start in a different language, you'll be experienced in closures in two days and scratch your head around pointer arithmetic.

Also, advanced concepts? I'm saying he shouldn't start with C because it's just too difficult to understand it at first.

you also took the opportunity to have a sly dig at anyone here who even suggests that C might be a suitable first language to learn.
I took a dig at no one, I responded to every single point people direct at me, that's a different thing. I have quoted every paragraph that was directed at me and responded to each and every individual point instead of just cherry-picking them.
This in spite of the fact that there are undoubtedly people here who have written hundreds of thousands of lines of C/C++ code and who are almost certainly more familiar with the language than you.
Let's just assume for sake of argument that this is true. Do you think that this makes these people impartial on to recommend a first language?

Your contribution to this thread amounts to nothing other than helping to confuse the OP
To be honest, better leave the OP confused about what to do, do his own research and pick the language that suits his or her own needs than to just follow the advise of the first couple of people here that said 'pick this language' and never gave a single argument why that language would be suitable or not.

who asked a perfectly reasonable question.
And he got a reasonable answer, I gave two paragraphs at firs, no more no less about why I thought that C was not a good place to start, and I still have not recommended any language to start, I've explained the strength and weaknesses of various paradigms of programming and told him to make up his own mind after that.

We get it: you know a little bit about programming languages and want to show off to a newb.
Psychoanalysisforums.com?

Please, keep your ad hominems out of this thread, maybe that's true, maybe it isn't, but there is no way you can know this.
 
  • #26
GreatEscapist said:
Sorry, but C# makes me think of music. :D
Bingo! that's what's the name is based on.

But on a serious note, what type of game aspects is it used in? Obviously it WOULD be useful/not in different aspects, so elaborate please.
C# is mainly used for web development. But to give you some insight into it:

C# is tailored to Microsoft's 'Common Langauge Infrastructure' a way to compile code written in different languages to be linked into one big piece of software. C# is very much like Java but with more type safety and also adds some support for a different approach to programming.

Type safety is an important thing that C lacks. Type safety basically means that the language makes sure you can do no wrong. For instance, say I have an array of 10 elements in C. That array is called array, what if I try to access the 20th element, as in array[19].

In C this is so called 'undefined behaviour', the standard doesn't say what should happen, because you just shouldn't do that, anything can happen then, it's up to the implementation. C# makes sure to protect you against those errors.

So these are things you have to way down, C because it doesn't 'check for array bounds' is fast, bounds checking takes up resources. It's also unsafe, so, what do you want, that's up to you and your current project. I would personally recommend simulating climate changes in C though, and writing software that works on air traffic control in C#. You understand the difference?

*promptly screams in confusion* This is true- I am confused.. I don't want to have to un-learn stuff that I might learn wrong, so Kajahtava's comments show the cons. That's awesome. But how much weight do they hold? (In a non-rude way) Here's the thing- I want to become a very good programmer. Extremely good. Epicly good...so, where do i start to become a very good game designer?
And, *screams* I feel very lost. I don't this sh** you guys talk about. Or your codes.
If you want to be good at all things, the obvious solution is to learn all languages. Programming has more than one veil, so:

- Efficient optimization, learning the machine: C, assembly.
- Structure of programs and problem solving, understand what a problem is and how to solve it: Scheme/Lisp, Prolog
- Physics, simulations: Haskell, Prolog
- Mutilating your mind beyond recovery: Visual BASIC

First:
It is advanced. TO ME. I'M STUPID. PRETEND LIKE YOU'RE TALKING TO A 16 YEAR OLD WHO ONLY KNOWS HTML, DOS, AND SOME APPLESCRIPT. OH WAIT. I AM.
Well, so are some core concepts of C, pointers are a notoriously difficult thing to master and integral to using C correctly.

Second:
No offense, but this is my research. I looked on the internet, got lost, and confused, so I decided to ask here. Isn't that what this site is FOR? I'm very sorry that I'm annoying you guys, but I really want to know how to do this, and I don't want to have to learn a bunch of stuff (Study the languages completely) just to learn that I shouldn't have learned that.
Well, you aren't annoying us, I am annoying them, and they are annoying me.

I guess the difference is that I'm more in favour of telling people the pros and cons of different options extensively and making them work out their own mind. Whereas they think the pros and cons I list are more overwhelming than C itself.

Is that bad? :frown:
Nahh.

And third:
I'm sorry that you gave a "reasonable explanation". I guess I'm dumb. Cause it didn't much help. It made me realize that this is no better than looking forever on google, where I get the same "C SUCKS DON'T USE IT" vs "C IS AMAZING DON'T EVER DO ANYTHING THAN THAT." Not that you all are saying that. But yeah.
Well, you can always try both at the same time and see which suits you more.

http://mitpress.mit.edu/sicp/full-text/book/book.html

http://www.cprogramming.com/tutorial.html#c++tutorial

Try each, see which suits you more.
 
  • #27


For the OP, which language you use to learn programming doesn't matter much (within reason, I wouldn't start off with Cobol). Since C is popular, might as well use that, but your first programs should be something simple, using a sub-set of the language. Again, the key is some sort of "primer" with a series of simple excercises of programs to write.

The rest of this is for the ongoing debate ..

Jeff Reid said:
It's defined a assigning a copy of the source string. You could have d = a + b + c, to assign a copy of the concatenation of 3 strings.

Kajahtava said:
I take it this is an ad-hoc overloading?
It's part of the defined functionality for the template <string> in C++.

Why doesn't it assign a *char pointer?
That's probably how it's implemented, but the syntax for string template doesn't use pointers, and the rules for standard templates do not require specific implementations, just specific behaviors and syntax.

mixing types in an array
C or C++ get's around this limitation by using structures or classes. APL requires all members be of the same type, APL2 allows each member to have it's own type.
Kajahtava said:
That's not an answer to my quaestion, it's not a limitation, it's a conscious effort.
With reason. In APL2, +.x (matrix multiply) doesn't make much sense if one or both variables include character or string data. (and yes I'm aware that ^.= ("and dot equals" to compare sets of data) would work).

why are pointer different than integers
Depending on the machine, they may be different sizes (for 68000, integers are 16 bit, pointers are 32 bits).
Kajahtava said:
Well, if that were true we could just declare long and short pointers. Tip: array[index] is syntactic sugar for *(array+index).
68000 doesn't have 16 bit pointers. array+index adds a 16 bit signed offset to a 32 bit address (even in assembly). Real mode on x86 cpu in "large" model requires special math for pointers implemented as segment:eek:ffset.

If you keep the initial programs used to learn very simple, such as only using numbers and not strings, then the required sub-set of most languages is simple to learn.
Kajahtava said:
This is most true, however after a couple of days in Perl or Python you're already performing regular expression matches against being frustrated in C why if("string" == "string") doesn't quite work.
if(strcmp(string1, string2) == 0) isn't that complicated.

I don't think a student's initial programming experience is going to be concerened with performance. The classic recursion method for calculating factorial isn't efficient, but it can teach recursion.
Kajahtava said:
Which can also be done in any other language?
Not in classic versions of languages like Fortran, which ran on stackless architectures.

structured progamming
I don't think this is a necessary goal for a new student. Just learning the basics of programming is enough. They need to understand how to program before they start to worry about structured or maintainable code, which are somewhat subjective terms.
Kajahtava said:
My point was that the only benefit of C is performance at the cost of structured programming, since performance is not an issue, better take a more structured language.
The main benefit is that most people will end up using C or C++ in their jobs. I don't think C++ was designed with peformance in mind, the purpose is to take avantage of classes and templates where a large amount of code has already been written.

Kajahtava said:
Well, I disagree, as Dijkstra said, if you start on the wrong foot you will have artefacts in your style for the rest of your life.
People and programmers adapt. Starting off on the wrong foot could be considered part of the learning process. Also coding standards will vary from job to job, not all of them good, but generally you go with the flow rather than trying to "correct" an entire department.

Kajahtava said:
In fact, I daresay the essence of learning to program well is first learning how to design the structure of a program, and only then translating it to a given language.
There are often times when I just sit down and start coding or making comment blocks. Interactive editors make it easy to compose, design, and write code in parallel, rather than doing all the design first. If there's a flaw in your original design concept, you'll discover it much sooner if you compose and design in parallel. If it's a team effort, then you need to design the interfaces up front, but these may change if you run into problems or realize the design can be improved during implemenatation.

I still like this programming teaching tool / puzzle that can be introduced early into the learning experience. I wonder how many here can solve program #3:

https://www.physicsforums.com/showpost.php?p=1347155&postcount=1
 
  • #28


One last point in this silly debate:
Kajahtava said:
I like to see some backing of this claim. I have never seen a programming class using C as an example language.
Northwestern, University of Chicago, UMass@Dartmouth, Columbia, Harvard, ...

Admittedly, the list of schools that use C as a teaching language has been shrinking over the last decade. More and more schools are using Java as an introductory language, and some are moving to Python. And of course some of the tougher schools teach multiple languages right off the bat.
 
  • #29


Kajahtava said:
Examples of Object Oriented languages are Common Lisp, C#, Smalltalk, Ruby, Java, Scheme, Python, Ocaml
You missed C++, a rather important omission.

Next on, higher order programming, in C or Java, functions cannot take functions as argument, this might sound 'obvious', but in a lot of languages that's not a problem.
Functions most certainly can be passed as arguments in C. This is basic to how functions such as sort work. Without function pointers the X Window System would not work. BTW, C# provides a similar functionality to function pointers via the delegate mechanism.

Functions are second class objects in C and C++. They can be stored in variables and data structures, passed as parameters to a function, and returned as the result from a function. They cannot, however, be constructed at runtime. These languages do not support closures or the ability to create a function (i.e., nothing akin to lambda). It is the lack of this missing functionality that makes functions second class objects in C and C++.
 
  • #30


Jeff Reid said:
Most of the examples show how to create a list of prime numbers via an iterative process that tests one number at a time. Since the letter "l" looks like the number "1", it's a bit more difficult to follow. The "declaritive" example uses a language type that you're unlikely to encounter in a game programming environment.
I wouldn't be surprised if the AI of your bot is written in prolog.

D H said:
You missed C++, a rather important omission.
I did, my mistake.

Functions most certainly can be passed as arguments in C. This is basic to how functions such as sort work. Without function pointers the X Window System would not work. BTW, C# provides a similar functionality to function pointers via the delegate mechanism.
That is why I listed C# under higher order. But C and C++ are most definitely not higher order, functions are not first-class there.

Functions are second class objects in C and C++. They can be stored in variables and data structures, passed as parameters to a function, and returned as the result from a function. They cannot, however, be constructed at runtime. These languages do not support closures or the ability to create a function (i.e., nothing akin to lambda). It is the lack of this missing functionality that makes functions second class objects in C and C++.
I was just going to say this, but then I saw you already typed it out.

Edit, I take that back, I'd say functions are third-class and arrays are second-class. Clearly arrays are a class higher than functions. I would also not call passing by reference or passing a pointer truly passing as in passing by value. You pass a pointer, pointers are first class objects. So, pointers and numbers are first class, arrays second because they can by dynamically generated, and functions third class because they cannot.

The 'lambda' keyword is a bit praetentious though, I find simply using 'function', or C#'s => operator a lot clearer.
 
Last edited:
  • #31


Kajahtava said:
That is why I listed C# under higher order. But C and C++ are most definitely not higher order, functions are not first-class there.
That is a very narrow and extremely non-standard definition of "high order language". By any rational account C and C++ are high order (or rather, high-level) languages. You can take an ANSI-C compliant program from a Linux machine to a Mac, a Windows machine, a Cray, or a Harvard architecture machine, and so long as an ANSI-compliant C compiler exists for that machine, the program will execute on that machine.
 
  • #32


D H said:
That is a very narrow and extremely non-standard definition of "high order language". By any rational account C and C++ are high order (or rather, high-level) languages. You can take an ANSI-C compliant program from a Linux machine to a Mac, a Windows machine, a Cray, or a Harvard architecture machine, and so long as an ANSI-compliant C compiler exists for that machine, the program will execute on that machine.
I take it you do not know what the term higher order means from this.

http://en.wikipedia.org/wiki/Higher-order_function
http://en.wikipedia.org/wiki/Higher_order_programming

But that's okay, because wiki to the rescue.

Higher order has nothing to do with high level, though invariably higher order languages are fairly high level. Though some'd argue that Lisps are in fact fairly low level due to their homo-iconicity.

It's also as much a paradigm as a language-type.
 

1. What is the best programming language for beginners?

The best programming language for beginners depends on personal preference and what you want to achieve. Some popular options include Python, Java, and JavaScript.

2. How do I choose the right programming language for my project?

Consider the purpose of your project and the features you need. Research the strengths and weaknesses of different programming languages and choose one that aligns with your project's goals.

3. Is it better to learn one programming language or multiple?

It's generally recommended to focus on one programming language at a time, especially as a beginner. Once you have a strong foundation, you can branch out and learn other languages.

4. Can I switch programming languages once I've started learning one?

Yes, it's possible to switch programming languages at any point in your learning journey. Many concepts and principles carry over between languages, so the transition may not be as difficult as starting from scratch.

5. How long does it take to learn a programming language?

The time it takes to learn a programming language varies based on individual learning speed and the complexity of the language. With consistent practice and dedication, you can become proficient in a language within a few months to a year.

Similar threads

  • Programming and Computer Science
Replies
16
Views
1K
  • Programming and Computer Science
Replies
8
Views
875
  • Programming and Computer Science
4
Replies
107
Views
5K
  • Programming and Computer Science
Replies
1
Views
726
  • Programming and Computer Science
Replies
15
Views
1K
  • Programming and Computer Science
12
Replies
397
Views
13K
Replies
6
Views
1K
  • Programming and Computer Science
Replies
9
Views
1K
  • Programming and Computer Science
2
Replies
59
Views
7K
  • Programming and Computer Science
2
Replies
54
Views
3K
Back
Top