Programming languages [closed]
I am almost new to programming and I read about all the differences between the programming paradigms(which I understand/translate as/to 'best practise', since I am not a native english speaker so correct me if I am wrong).
A programming language is artificial, it exists so that people can write programs that a in an abstract way, this ranges from assembly to highlevel languages. This part I understand, of c开发者_如何学Pythonourse.
But all of these paradigms, object oriented etc. is the "only" difference between them how you "structure" your data such as in objects, methods etc? I mean, is the difference how you lay out your code in the editor and how you manipulate the data?
You are technically correct, but the paradigm you choose has deep implications for how you write programs. Writing a program with the object-oriented paradigm can be vastly different that writing a program with a procedural language. You have design your program functionality with the concepts of the chosen paradigm in mind. For example, in OO programming you should have an OO design, i.e. you break your logic up into classes, with inheritance and whatnot, to get the benefits of OO.
Technically, yes. At some point all code turns to/executes machine code.
But your question is a bit wrong, because there are many more differences in programming languages than code structure.
The language you use shapes the way you think - that's what people mean by "high level" and "low level".
So, the real difference between programming languages is how they allow you to think and what parts of the thinking they do for you.
Yes, Everything gets translated into 0's and 1's (Binary) eventually.
Assembly Language (a low level language) is just a closer construct to Binary than a high level language.
Java, C++, C#, Basic etc (high level languages) have been developed to make it easier to design and implement commonly used routines that is not apparent in a low level language.
Each high level language is different simply down to how it manages and constructs the routines.
No, paradigm is a set of beliefs or concepts used to explain something.
For instance, when people thought the earth was plain, that was the accepted paradigm.
So, this is not if something is better than other, but just different ways to explain/apply/build the same thing.
For instance, functional programming ( such as Lisp, Haskell ) have a main artifact functions ( or closures ) while Object Oriented Programming ( such as Smalltalk and Ruby ) have Objects and Classes, and structural programming ( such as C or Pascal ) have structures or records.
At the end, the three of them could be applied to solve the same problem ( a software system ) it is just, the paradigm defines the terms to be used.
Again, when you're talking about an OO language, is common to talk about classes, methods, attributes. When your are in a functional languages, you talk about closures, monads, etc.
Since they are finally software artifacts, some concepts from one paradigm are found in other. For instance Scala is a mixed programming language and handle both Object and Functional at the same time.
精彩评论