|
| View Poll Results: Must computer languages have while or if-else to be a programming language? | |||
| Yes, absolutely |
|
9 | 32.14% |
| No, it is not necessary |
|
6 | 21.43% |
| No, but the language should have some means of simulating equivalent functionality |
|
13 | 46.43% |
| Voters: 28. You may not vote on this poll | |||
![]() |
| Thread Tools |
| Must a programming language have while or if-then-else? | None |
|
|
#1 | |||
|
New Member [01%]
MBTI: INTP
Join Date: Jun 2008
Posts: 25
|
Dear INTJ and other posters, |
|||
|
|
|
|
|
|
|
#2 |
|
Member [11%]
MBTI: INTJ
Join Date: May 2008
Posts: 477
|
I think a programming language has to have some sort of flow control. Otherwise you can only create a simple sequence of statements, possibly influenced by user input, but not to a very large degree.
It doesn't have to be if-then-else or while loops, explicitly. Like you say, there are languages like Prolog that approach things from a different angle. They still provide flow control, though. (Which HTML doesn't.) |
|
|
|
|
|
#3 |
|
Core Member [166%]
|
AutisticCuckoo wins this one
To view links or images in this forum your post count must be 2 or greater. You currently have 0 posts. HTML is a markup language, not an programming language. It describes content. |
|
|
|
|
|
#4 |
|
Core Member [406%]
|
For languages that implement what we would term "algorithms" (and this includes all finite length procedures that terminate), the answer is no. Neither of these flow control constructs is essential. They exist for the convenience of the developer.
|
|
|
|
|
|
#5 | |||
|
Core Member [219%]
|
my thoughts exactly after reading the OP. I second this. |
|||
|
|
|
|
|
#6 |
|
Core Member [162%]
MBTI: INTP
Join Date: Jan 2008
Posts: 6,492
|
You dont need these constructs. SQL for example is results based and you dont not need flow control. Rule based inference engines do not need it either.
|
|
|
|
|
|
#7 |
|
Member [13%]
|
I went with "yes", but I should mention that a language merely needs a method of branching that allows for the implementation of these concepts. HTML does not provide this; it has not, and never will be, a programming language. It is merely for document structuring and vague layout.
SQL is not a programming language, either. |
|
|
|
|
|
#8 | |||
|
Member [11%]
MBTI: INTJ
Join Date: May 2008
Posts: 477
|
SQL is not a programming language. PL/SQL is (or was?) a programming language, and it's got the flow control that is necessary for writing programs. Why would you need PL/SQL if SQL were a programming language? |
|||
|
|
|
|
|
#9 | |||
|
Member [13%]
|
I tend to group PL/SQL into the "scripting language" category. |
|||
|
|
|
|
|
#10 |
|
Member [11%]
MBTI: INTJ
Join Date: May 2008
Posts: 477
|
What is your definition of a 'scripting language' vs a 'programming language'?
For me, a scripting language is a subset of programming languages. I think of scripting languages as ones where the source code is interpreted at runtime, as opposed to compiled languages where you have object code that is immediately executable, or byte code that is run by a middle layer. Of course, some scripting languages are actually compiled on-the-fly, like PHP. For me, the distinction is that with a scripting language you 'run' the source code without having to compile anything yourself. With that definition Java is not a scripting language, but JavaScript is. |
|
|
|
|
|
#11 |
|
Member [10%]
|
Yes, for a language to be considered a programming language, it must have the while, for, if and else statements.
HTML is a markup language and SQL is a data definition language. The difference between scripting languages and real programming languages has been blurry for years now (PHP, Python, Perl.. started as the first, ended as the latter.) I think the difference between scripts and programs is that script contain just a bunch of commands and function calls with some parameters to generate some output from given input, where a program has its own classes and fuctions that the programmer coded in him/herself. |
|
|
|
|
|
#12 | |||
|
Core Member [166%]
|
Nah, walfin was correct in saying (and as others have mentioned) that a programming doesn't need to have these constructs to be considered. There are plenty of functional languages that don't have constructs like that, in comparision to a procedural language. |
|||
|
|
|
|
|
#13 | |||
|
Member [13%]
|
What about those that can go either way? |
|||
|
|
|
|
|
#14 | |||||||||
|
New Member [01%]
MBTI: INTP
Join Date: Jun 2008
Posts: 25
|
Completely unsubstantiated, I wonder why. I would've liked to have seen, at least, some brief arguments. Why can't a markup language be considered a subset of programming languages, pray tell?
both? i would suppose that the sets "programming language" and "scripting language" aren't necessarily mutually exclusive? i'd further argue that the purpose that the language was created for is more of the essence in determining which category it fits into, rather than whether it has to be compiled manually or not. but that is beyond the scope of this thread. |
|||||||||
|
|
|
|
|
#15 | |||
|
Member [10%]
|
Err, what do you mean? *confused* Programming languages have logical operators (if, else, or, and), and can do 'math'. In short, you can manipulate data with them and code/implement algorithms in them. Markup languages are just used to order data with. |
|||
|
|
|
|
|
#16 |
|
Member [03%]
|
Is it a markup language a programming language?.... I guess it really depends what the meaning of the word is is. huh?
To answer the question is is and HTML is not a programming language. HTML (Hyper Text Markup Language) is a set of agreed upon standards used to display data. A programming language is used to manipulate data. Sometimes a programming language can both manipulate data and display it, HTML is not one of these cases. |
|
|
|
|
|
#17 | ||||||
|
Member [05%]
|
While?
AutisticCuckoo gave the answer. There HAS TO BE some sort of flow control. If there's nothing to control the flow of the program, then the final product will be something very limited. Now about the "what this flow control should be" part, the answer is anything. Anything as long as this anything is able to control the flow of the program. |
||||||
|
|
|
|
|
#18 |
|
Member [10%]
|
Ah, so thats what you mean. Well, then we all agree. =)
|
|
|
|
|
|
#19 | |||
|
Member [11%]
MBTI: INTJ
Join Date: May 2008
Posts: 477
|
Why don't you show us how HTML can be used for programming? |
|||
|
|
|
|
|
#20 | |||||||||
|
Core Member [166%]
|
Eh? Scripting languages are a subset. Never said otherwise. For those that can go either way, then it's just context. There are plenty of languages that have both run time script engines and compilers available.
Cause you started this thread, based on a challenge from AutisticCuckoo. By every current definition of what HTML is, and what other programming languages are, AutisticCuckoo won the challenge.
Yes, but in some languages those constructs don't equate to the concepts of if, else, while wtc. They're constructs relevant to procedural languages, but not necessarily to functional languages. The same thing can be achieved (i.e. the algorithm part of your thoughts), but in very different ways. |
|||||||||
|
|
|
|
|
#21 | |||
|
Member [13%]
|
That makes it even worse, since many historic programming languages have been transformed into languages that more closely resemble scripting languages at this point. Few write sorting algorithms by hand anymore, for instance. |
|||
|
|
|
|
|
#22 |
|
New Member [01%]
MBTI: INTJ
Join Date: May 2008
Posts: 4
|
For those who aren't into reading long posts: here's the gist. I'd say the theoretical underpinning of this argument should probably placed in
To view links or images in this forum your post count must be 2 or greater. You currently have 0 posts. . With the presupposition that we agree on this as the "measure" to determine what is or isn't a programming language, we can say HTML isn't a programming language (in this sense). Outside of this, YMMV, i.e. people are bound to their opinions. What I do object to, however, is rather simplistic argument that "anything that doesn't have while or if-then-else shouldn't be considered programming language". That's way too simplistic, if not downright wrong. You're clearly not seeing past what's in front of you, a screen with text drizzled all over about a foot away from your face. Programs texts don't "run". In one way or the other, they get compiled or interpreted down to a sequence of instructions. When you get to that level, none of those fancy high-level language construct exist. What we have are simple store/load/add/subst/mul and jmp. And when you get down to that level, it becomes rather clear what is or isn't programming language. In this context, ask yourself, what is HTML? P.S. walfin, when wolf said "both", yes he meant that the domain of "compiled languages" and the domain of "interpreted languages" aren't necessarily mutually exclusive. In fact, that intersection is one of the hottest fields these days, starting with Java. |
|
|
|
|
|
#23 | |||||||||
|
New Member [01%]
MBTI: INTP
Join Date: Jun 2008
Posts: 25
|
Still do write sorts for fun sometimes. Like, mayb in amd64 assembly? It was kind of a new experience, so many registers to play with
This does up the ante by a bit
wolf did NOT, in fact, use the word "both" in any one of his posts in this thread. His post was: "What about those that can go either way?". Java is not a language that can "go either way". And of course it is obvious to most with some coding experience that the domains of interpreted and compiled languages are not mutually exclusive. We were talking about the domains of "programming" and "scripting" languages, and my view was that a language that can be either pre-compiled or processed-on-the-fly probably falls into the intersection of the sets "programming" and "scripting". |
|||||||||
|
|
|
![]() |
| Thread Tools | |
|
|