Page 2 of 3

Posted: Tue Nov 29, 2005 12:16 pm
by Roja
infolock wrote:But for someone to say PHP would be better to learn before C in a CS degree enviorment is wrong because you are NOT learning a language on a machine level, which is the whole purpose of learning C++.
This is a key point, so I do want to respond.

Learning a language (at any level) isn't about learning the language, no matter how noble the language is. The purpose is to use that language to some end - to accomplish a human task and goal.

The purpose of Computer Science (in my opinion) is *not* to learn a language on a machine level. The purpose of Computer Science is to understand the relationship between computers, and the tasks we want them to accomplish - and optimally, the methods to accomplish that.

With that purpose (and I think we disagree on the purpose of the study, the rest is a result of that difference) it becomes clear that you want to teach students how to get computers to do what you tell them to do. In that case, its very easy to make the argument that a "scripting" language (which is still programming) is one of the easiest possible interfaces to accomplish that task. Arguably, the "hello world" of php is very accessible!

Once the student understand the concept of "I tell it what to do, and it does it", then you can migrate to the more complex concepts. Since you are telling the computer what to do, have a structure to do so. Once you have a structure to do so, break it into managable chunks (procedural). Once you have managable chunks, look for consistent issues that programmers face (design patterns). Once you have patterns, look for ways to implement them that map to the real world task (object orientation). At some point, your creation grows beyond simple maintenance, and you need automation for break/fix testing (unit tests). Then you need to learn how to merge all of those lessons, because you will undoubtedly encounter legacy code that will require you to keep some level of "unclean" interfacing (OOP+Procedural). Finally, you may have an application that needs optimizing - which means you will need to understand not only how the machine works, but how the code works, and how to make it run faster (which will usually lend itself well to lower-level languages, which give more control).

Notice that only the very last step "needs" or even suggests the need for a low-level language.

It all comes down to the philosophy behind Computer Science. To me, its clearly about accomplishing tasks - and you don't need a low-level language to do so. In fact, its probably a hinderance to the core concept of wanting students to quickly understand that machines do what you tell them to do.

Posted: Tue Nov 29, 2005 2:36 pm
by Charles256
repeat Roja's post for me..yeah..thanks :-D

Posted: Tue Nov 29, 2005 2:46 pm
by infolock
he purpose of Computer Science (in my opinion) is *not* to learn a language on a machine level. The purpose of Computer Science is to understand the relationship between computers, and the tasks we want them to accomplish - and optimally, the methods to accomplish that.
In order to accomplish that though, don't you think you need to understand how the computer does these tasks? You cannot learn that through php because it isn't at that level, whereas you can with C since it is.

Posted: Tue Nov 29, 2005 2:59 pm
by Charles256
infolock wrote:
he purpose of Computer Science (in my opinion) is *not* to learn a language on a machine level. The purpose of Computer Science is to understand the relationship between computers, and the tasks we want them to accomplish - and optimally, the methods to accomplish that.
In order to accomplish that though, don't you think you need to understand how the computer does these tasks? You cannot learn that through php because it isn't at that level, whereas you can with C since it is.
how do you figure? he said the relationship between computers and the tasks we want to accomplish? that's a general idea..i don't see how whether or not you control memory management affects that..most programmers don't start out writing something needs memory control anyways;) (as an example of course)

Posted: Tue Nov 29, 2005 3:45 pm
by Roja
infolock wrote:In order to accomplish that though, don't you think you need to understand how the computer does these tasks? You cannot learn that through php because it isn't at that level, whereas you can with C since it is.
I think the answer to the first conflicts with the second. Yes, you do need to understand how the computer does these tasks - eventually. Its absolutely a part of a well-formed curriculum, and I think removing it would be raw idiocy. However, you could easily cover the vast majority of the rest of the goal (learning how to get a computer to accomplish a task) with a "scripting" language.

The second comment, that you cannot learn how the computer does those tasks (because PHP is too high level) I agree with.

The key is timing. The current system puts the impact on the student early, asking them to learn arcane and frankly, in many cases nearly useless information, to eventually get to the bliss of managable programming.

I advocate the opposite approach - show that it is *easy* to get a computer to do a task (which is the key goal), and once that has taken root, then ramp up from there. Near the end of the path I do agree with you - the student (who at that point is becoming very knowledgable) should be asking key questions like "But if I go with a lower-level language, can I get better {memory management, responsiveness, speed}?"

And the answer is definitely yes.

The current approach to teaching computers, to me, is like asking students to know the entire periodic chart before they can learn how H2O is formed. It just doesn't result in many interested students.

Posted: Tue Nov 29, 2005 3:46 pm
by Charles256
which i attest to by the fact half of my CS class dropped the course and changed their majors :-/ on the bright side...i guess it makes more jobs available to those of us that stick it out:-d

Posted: Tue Nov 29, 2005 4:00 pm
by infolock
Charles256 wrote:
infolock wrote:
he purpose of Computer Science (in my opinion) is *not* to learn a language on a machine level. The purpose of Computer Science is to understand the relationship between computers, and the tasks we want them to accomplish - and optimally, the methods to accomplish that.
In order to accomplish that though, don't you think you need to understand how the computer does these tasks? You cannot learn that through php because it isn't at that level, whereas you can with C since it is.
how do you figure? he said the relationship between computers and the tasks we want to accomplish? that's a general idea..i don't see how whether or not you control memory management affects that..most programmers don't start out writing something needs memory control anyways;) (as an example of course)
well take for instance Cold Fusion. Cold Fusion 4 did not have a memory management system. Every time that a request was sent, it loaded itself back into memory. So if you have an application doing this over and over, 16mb worth of data goes from being no big deal to being a system stopping event. Without proper memory management, you are building an application that will self-destruct your system sooner than later.

So it has everything to do with it. As far as not wanting to learn it, well, don't and just rely on your system crashing and you have no way of knowing how to prevent it.

But to understand a relationship between computers you have to get down to the machine level. That means understanding a langauge that makes the computer work : c++, not php. PHP does not make the computer work. It makes use of other applications to do the jobs for it. For instance : take a regular bash script. A bash script (like php) is a set of commands to be run to do something. Wether you are just changing folders, or if you are setting permissions, it's simply a set of commands. All because you are writing a bash script to perform actions DOES NOT make it a programming language, and it certainly does not mean it's a language you can learn programming with. Because all that bash script is doing is executing OTHER programs to perform the machine level operations. It is NOT performing them itself, which makes it a script language, not programming language.
think the answer to the first conflicts with the second. Yes, you do need to understand how the computer does these tasks - eventually. Its absolutely a part of a well-formed curriculum, and I think removing it would be raw idiocy. However, you could easily cover the vast majority of the rest of the goal (learning how to get a computer to accomplish a task) with a "scripting" language.
I am not saying that you could not do that, but you could accomplish the same task with HTML. The argument though is that is PHP really the way you want to understand how computers and programs really work with each other? The straight forward answer is no, because PHP is a server-side scripting language used to accomplish tasks. Now, can php used as a backend for understanding the concepts of programming? Well, yes, but again, any language can do that, even Cobal and Basic. But we want students having a language that will teach them the basics that fit the industry standard. PHP, by no stretch of the imagination, is an industry standard. C, however, is.

If PHP were to be considered a programming langauge, it would have been developed as one. It would have been developed as a language that is compiled, run on it's own without any hint of an interpreter. But it's not, and it's therefore considerd a scripting language. Because that is what we are doing: we are writing scripts.
The primary difference between a "programming language" (C, C++, VB etc.) and a "scripting language" (PHP, ASP, JSP, JavaScript, VBScript)is that code written in a programming language needs to be compiled before it is run. Once it is compiled, it can be run any number of times.

Scripting languages, on the other hand, are interpreted at run-time. This means that every time you want to run the program, a separate program needs to read the code, interpret it, and then follow the instructions in the code. Compiled code has already been interpreted into machine language, so it is will typically execute faster because the conversion into machine language has already been done.
edit: while I will admit you are learning methods of programming (following if/elses, loops, etc), you just are not learning the machine level side of it, which is what CS is suposed to be all about: understanding the computer, how it works, and how to make it work for you. Not how to make use of a browser window to perform actions, while all the applications in the background does the rest.

Posted: Tue Nov 29, 2005 4:32 pm
by Roja
infolock wrote:But to understand a relationship between computers you have to get down to the machine level.
I don't agree with that. Again, the goal is to teach people how to get computers to do tasks. How do I get a computer to print hello world?

At a fundamental level, its breaking through the mystery, the ambience, and the (incorrect) perception that getting computers to do what you want is hard. Windows brought lots of people to computing, but also gives them the impression (due to crashes, cryptic error messages, and inconsistent behavior) that it is hard to get computers to do what you tell them to do.

Hello world doesn't require knowing what bit math is. It doesn't require knowing how to do garbage collection. Neither does the fundamental goal of teaching people how to get a computer to do a task.
infolock wrote:PHP does not make the computer work.
PHP *does* make a computer do what you tell it to do. While there are layers below it that it relies upon, the same is true in C - you still rely on the OS, the BIOS, the memory handler, the CPU bytecode, and so much more.

*ALL* programming relies upon an existing structure to accomplish a task. The key (again, beating the dead horse) is that the user can cause the computer to act. And yes, PHP can do that.

Because of that layer of reliance for ANY language, your argument is broken at the core. Thats why there is no difference between a scripting language and a programming language - when it comes to the fundamental challenge of teaching people how to make computers do what they want.
infolock wrote:I am not saying that you could not do that, but you could accomplish the same task with HTML.
To a degree, I do agree with that. I'd say that from a teaching point of view, html is non-ideal (especially compared to php). But yes, it does accomplish job one: Make the computer do what I say.
infolock wrote:The argument though is that is PHP really the way you want to understand how computers and programs really work with each other?
Nope. You would like the argument to be that. Thats not the issue. The goal - one more time - is NOT to understand how programs work, or how computers work. Its how to get a computer to do a task.
infolock wrote:The straight forward answer is no, because PHP is a server-side scripting language used to accomplish tasks.
The answer is yes, because PHP is a simple language used to make computers do a task.
infolock wrote:Now, can php used as a backend for understanding the concepts of programming? Well, yes, but again, any language can do that, even Cobal and Basic. But we want students having a language that will teach them the basics that fit the industry standard. PHP, by no stretch of the imagination, is an industry standard. C, however, is.
I disagree with both points. We don't ONLY want students to learn *a* (singular!) language that is related to the industry. Once they learn how to make a computer do a task, then yes, an appropriate followup issue is "What methods are used to accomplish common tasks in industry". That is when you start progressing through other languages.

As to PHP not being an industry standard, I disagree - depending on your terms. Its a very active field, widely implemented, used to solve the most common issues in IT today (because *everything* needs to be on the web). There are plenty of jobs hiring for people that know it, plenty of industry built around it, and many of the largest businesses in the world derive large amounts of the profit off of solutions based on PHP. So, I ask, what do you define an "industry standard" as, that PHP doesnt meet?
infolock wrote:If PHP were to be considered a programming langauge, it would have been developed as one. It would have been developed as a language that is compiled, run on it's own without any hint of an interpreter. But it's not, and it's therefore considerd a scripting language. Because that is what we are doing: we are writing scripts.
No offense, but here I think you have a misguided bias. Having a compiler doesn't make a substantial difference to what a programming language is. By way of refuting that, PERL, a *scripting* language, has a compiler in the upcoming version (Parrot). Heck, even PHP will be supported on Parrot. So what are they? Scripting languages? Compiled?

What about a PHP program sent through winbinder? Thats undeniably compiled.

The history behind COBOL would blow your mind. Pascal? Started as a teaching language, developed from ALGOL, to be easier to understand for students.

There are more shades of gray than there are black-and-white language differences, and your negativity towards the lack of a compiler doesn't change the key fact about programming languages: They make a computer do a task.

Compiler or not, they accomplish goal #1. With that out of the way, the only question is which teaching philosophy is best? A gradual approach, with heavy rewards early, or a studious approach, with heavy rewards only after accomplishing sizable knowledge.

I favor the gradual approach, and PHP is a great language to do it in.

Posted: Tue Nov 29, 2005 10:17 pm
by infolock
don't agree with that. Again, the goal is to teach people how to get computers to do tasks. How do I get a computer to print hello world?

At a fundamental level, its breaking through the mystery, the ambience, and the (incorrect) perception that getting computers to do what you want is hard. Windows brought lots of people to computing, but also gives them the impression (due to crashes, cryptic error messages, and inconsistent behavior) that it is hard to get computers to do what you tell them to do.

Hello world doesn't require knowing what bit math is. It doesn't require knowing how to do garbage collection. Neither does the fundamental goal of teaching people how to get a computer to do a task.
#1, hello world can be written in anything. Basic english, HTML, C++, java, BASH, shell, anything. Hello world is not an example that shows you the powers of a language, it is simply a method of allowing you to see a language in action. Not to show the benefits of it. So personally, I don't see the point in that example. You can make that with anything, but all because you do, doesn't make it prove any point. So, instead maybe give a better example, and we can discuss from there.

As far as the thing about computers being hard, well, to some people it is. Linux just makes it more obvious. But As for the "getting a computer to do what you want it to do", i'm not talking about point clicking, and all that.
HP *does* make a computer do what you tell it to do. While there are layers below it that it relies upon, the same is true in C - you still rely on the OS, the BIOS, the memory handler, the CPU bytecode, and so much more.
I'm talking about actually writing code to tell the computer "hey, I want this bit of data from the serial port any time data is sent". Can you do this with php ? no. Why not? Because it cannot communicate with the machine at that level. You can tell it to open the port yet, but you can NOT tell it to monitor that port.
*ALL* programming relies upon an existing structure to accomplish a task. The key (again, beating the dead horse) is that the user can cause the computer to act. And yes, PHP can do that.
wrong again. PHP cannot do that, HTML does that. Javascript does that. PHP sends a REQUEST to the interpreter wanting an action to take place, and that interpreter (the php engine) completes the task.
ecause of that layer of reliance for ANY language, your argument is broken at the core. Thats why there is no difference between a scripting language and a programming language - when it comes to the fundamental challenge of teaching people how to make computers do what they want.
again, this is where we differ. Go to aacollege proffessor of CS and tell him that. He'll lecture you for about 3 hours of why what you are led to believe is completely wrong.
To a degree, I do agree with that. I'd say that from a teaching point of view, html is non-ideal (especially compared to php). But yes, it does accomplish job one: Make the computer do what I say.
agreed.
Nope. You would like the argument to be that. Thats not the issue. The goal - one more time - is NOT to understand how programs work, or how computers work. Its how to get a computer to do a task.
I do not argue that, but again, PHP cannot make a computer do a task. That is why it is a SCRIPTING language (to beat a dead horse as you would say)

I don't know man. If I can't explain this any more clear, I think both of us need to go back and retake the CS degree. Because I think I can't explain it like I should, and you can't seem to understand this simple definition of differences between a script and a program. =\ No offense intended, I just can't debate about it anymore than I already have =\

Well, let me put it in better terms. If you refuse to accept what I'm telling you about PHP being a scripting language, about PHP not being able to have a computer to perform a task, well, that's fine. To a point, a small extreme, PHP does but it's only by acting as an interpreter. That's it. It does not carry out the actions, other programs do it for it. If ya can't take my word for it, at least do some research on this subject. 20 minutes of reading will do more good than I have with these 3 pages

Posted: Tue Nov 29, 2005 10:45 pm
by Roja
infolock wrote:Hello world is not an example that shows you the powers of a language, it is simply a method of allowing you to see a language in action. Not to show the benefits of it. So personally, I don't see the point in that example. You can make that with anything, but all because you do, doesn't make it prove any point.
Its because we see the main goal of computer science differently. You see it as something involving the language, the machine, and so forth.

I see it as the science behind making computers perform tasks. With that difference in goals, comes a huge difference in opinions about what everything else means. Nothing wrong with that, we just have different opinions.
infolock wrote: I'm talking about actually writing code to tell the computer "hey, I want this bit of data from the serial port any time data is sent". Can you do this with php ? no.
Yes, you can:
PECL wrote:PHP supports the direct io functions as described in the Posix Standard (Section 6) for performing I/O functions at a lower level than the C-Language stream I/O functions (fopen(), fread(),..). The use of the DIO functions should be considered only when direct control of a device is needed.
http://pecl.php.net/package/dio

Any other criteria? PHP *is* a programming language.
infolock wrote: Why not? Because it cannot communicate with the machine at that level. You can tell it to open the port yet, but you can NOT tell it to monitor that port.
With the dio extension, yes, you can.
infolock wrote:wrong again. PHP cannot do that, HTML does that. Javascript does that. PHP sends a REQUEST to the interpreter wanting an action to take place, and that interpreter (the php engine) completes the task.
You are assuming the presence of HTML or javascript. In a winbinded php app, its a full-out native window, complete with pop up windows, dialog boxes, and common UI elements. Alternatively, you can run php on the commandline. You can make a php-shell even.

PHP doesn't need html or javascript to produce output, or gather a response.
infolock wrote:again, this is where we differ. Go to aacollege proffessor of CS and tell him that. He'll lecture you for about 3 hours of why what you are led to believe is completely wrong.
Funny you should mention that.. I've been discussing the issue with a friend who has plenty of credentials, and he's puzzled at your criteria for a "programming language".

Argue your own position, or agree to disagree.
infolock wrote:I do not argue that, but again, PHP cannot make a computer do a task.
What task? Serial port access? Input/output? Window manipulation? Database access?

Each time I've asked for specifics, the specifics have shown the opposite. PHP can be compiled. PHP can access the serial port. PHP can access databases. PHP can interact with the user.

PHP can make a computer do a task!
infolock wrote:I don't know man. If I can't explain this any more clear, I think both of us need to go back and retake the CS degree. Because I think I can't explain it like I should, and you can't seem to understand this simple definition of differences between a script and a program. =\ No offense intended, I just can't debate about it anymore than I already have =\
No offense taken. Your arguments are simply inconsistent.

You claim that the goal of CS is to teach about a language, when in fact most CS degrees want you to be exposed to at least two. You claim that the goal is to teach about machines, but many CS degrees once used Java - which is explicitly machine-independent. You then claim that you agree that the goal is to teach students how to get a computer to do a task, but then argue over which tasks meet your criteria of a "programming" language.

The first criteria you propose is that it has a compiler. PHP has multiple, and can in fact produce machine-native code as a result. So thats out.

The second criteria you propose is that it is not an "industry standard", but when I give plenty of reasons why PHP is, you give no definition in opposition. So thats out.

The third criteria you propose is that the language has to have direct hardware access. PHP can in fact do that too, eliminating that criteria.

Your underlying argument that because PHP has to rely on other layers it isnt a programming language is similarly flawed - every language you've cited: Pascal, Basic, cobol, C, C++, Java. All of them rely on other layers! Whether its a just-in-time compiler, a standard compiler, an OS, or a posix interface (provided by an OS), NONE of those languages actually operate purely independent of any other layer. So PHP is "just like them too". They all rely on other systems to make a computer perform a task.
infolock wrote: Well, let me put it in better terms. If you refuse to accept what I'm telling you about PHP being a scripting language, about PHP not being able to have a computer to perform a task, well, that's fine.
We don't agree on that, you are right. You've given no criteria that sets PHP apart from any of the languages you've specified as a "real" programming language.
infolock wrote:If ya can't take my word for it, at least do some research on this subject. 20 minutes of reading will do more good than I have with these 3 pages
I'm quite knowledgable about computer science, programming, and the methodologies.

I've asked specific questions about your criteria, and found flaws in every argument you've made, and all you've done is repeated yourself, and changed your criteria instead of defending your arguments with logic or facts. (Worse, then you make a personal attack, implying that I've done no research on the subject).

So, if you want to continue discussing it, give the criteria determining whether a language is "real" in your definition, so we can disprove your accusation that PHP isnt a real programming language.

Then state clearly what you think the purpose of CS is, and we can go forward. Stick to facts and logic (and leave the personal attacks out), or move on.


I'm always willing to expand my mind and attempt to understand another position. As long as it is based on facts, and logic, and not simply repetition. But personally, I'm with you on your earlier comment - I think we completely disagree, and there is no middle ground, so we should just move on.

Posted: Wed Nov 30, 2005 1:00 am
by n00b Saibot
order in the court... the jury has listened to the arguments from the both sides and has decided in favour of Roja. Roja wins!

Posted: Wed Nov 30, 2005 9:12 am
by Bill H
To weigh in one more time, if I may.

First, I totally, totally agree with Roja about the purpose of the course of study. It is to teach a methodolody and mental discipline, and the language (be it scripting or programming) is irrelevant.

My suggestion for C++ is based on two thoughts.

First, college is supposed to be for real. Hard or easy it's for real, and that usually means hard. We are graduating high school students who can't read job applications and can't make change for a customer (we have to have cash registers to calculate the change for them). We don't need to be graduating college IT people with the same lack of knowledge. Computer science it not easy stuff and you aren't going to teach it successfully to people who want to coast through. If you try you are going to fail in your effort to give anything of value to those who would have been willing to work, and everybody loses. Set the bar high enough that those who are willing to work can gain something of value and those who want to coast through can flunk. Then the good students and the society into which they graduate win.

Second is the issue of discipline. I constantly am amazed by the sloppy, undiciplined code that I see in the marketplace. (Not here in this forum, of course.) I like PHP a lot, and it's function set is one of the more elegant things I've ever worked with. But it is loosely typed and does, therefor, permit some sloppy habits to develop. Thus my preference for C++ as a teaching language. That is one rigid puppy, and one learns good habits with variable usage and code framing that will serve you well in any language you later migrate to.

Would you believe that I still declare and initialize my variables, with a comment explaining the purpose of the variable? In PHP I do this. It's called "readablilty" and I learned it by programming in C++.

My 2 cents.

Posted: Wed Nov 30, 2005 9:43 am
by Jenk
I share the same opinion as Bill H, but he is better with words than I :P

Posted: Wed Nov 30, 2005 10:07 am
by infolock
If you actually have a CS professor saying that, well, it must be at some low level community college. Because this is abosolutely wrong.

I've given example after example, and you still try to contend that PHP is a programming language? Can you write an Operating system using PHP? No. Can you write a device driver using php? No. Why? Because it's a scripting language and it cannot communicate or control the computer at that level.

EVERY EXAMPLE you gave is not an example of PHP as a programming language. It is of PHP as a scripting language. PHP is not making things happen man, a C application is making them happen. PHP asks the C program to do these things, PHP simply can NOT.

If you write to a filesystem, can you change an iNode ? No? Why not? Because it's not at a machine level. That's cuz it's a scripting language.

Does PHP carry out these I/O port filters? No. C does. PHP asks C to perform these actions because C is at the machine level.

Any argument otherwise is just plain wrong because PHP is NOT a programming language, it is a SCRIPTING language. jeez. And I would welcome the opportunity to talk with a professor of CS on this subject and ask him just how he got his job. Because NO CS PROFESSOR is going to agree that PHP is a programming language and NOT a script language.


last comment : if php is a programming language and NOT a scripting language, I guess the guys at php.net are just idiots as well because they explicitly say on their site that PHP is a ..ehh. SCRIPTING language.

Posted: Wed Nov 30, 2005 11:38 am
by trukfixer
Sounds to me, like based on infolock's definition. even C is a scripting language- it doesnt directly interact with the computer either- it is compiled into binary instructions that actually do the work - PHP is also compiled (at run time) into binary code that tells the computer to do the work - same difference..

Same with python and perl and java and ruby and pascal.. all are languages that are in some form or another, *compiled* into a set of binary code instructions that are then given to the machine to process.. By infolock's definition of a programming language, then only programming in actual binary code is a true programming language- cause that's what actually does the work.

I am deeply curious to see where, exactly, infolock got his education from ..

php = compiled into binary at runtime
C = compiled into binary prior to runtime
Basic = compiled into biunary at runtime
(Oh yeah Basic is most definitely called a programming language by professors- it is in no way a scripting language :-D )

Looks to me like infolock's arguments have no merit or basis in fact..

/me puts infolock on /ignore