PDA

View Full Version : General Relationships between languages...?



djr33
03-27-2006, 01:18 AM
Not sure if this is the right forum for it, but seems as good as any.

My question is pretty straightforward... not sure if the answer will be.

Basically... I'm curious how 'all this stuff works'.

I've used html, (some css and javascript) and I'm not getting into PHP and a bit of MySQL.


So... there are more things out there, like CGI, ASP, JAVA, PERL, etc etc.

How does all of this stuff fit together?

Obviously css and html aren't too related to programming, so they're kinda in their own catergory.

But... for the rest... what language are they based off? Which are similar? Which are significantly different?

What's JS most like? How about PHP?

Which would you need to learn to know another?

etc.

Don't worry about specific questions, really. I just think this is a discussion worth having.

mwinter
03-27-2006, 12:17 PM
So... there are more things out there, like CGI, ASP, JAVA, PERL, etc etc.

How does all of this stuff fit together?That really is an open-ended question, though one quick correction: Java is a proper noun, not an acronym, and though Perl is (Practical Extraction and Report Language), neither are written in uppercase. :)

Your list above consists of, at least from a Web development perspective, server-side technologies (Java and Perl have other applications, as well). However, they aren't one particular thing (like a programming language).

CGI (Common Gateway Interface) is stream-based interface between programs and a Web server. The server executes the program, sending data about the request through the input stream and environment variables. The program writes the response to the output stream, which the server then sends back to the user. Any language that can perform these actions can use CGI to communicate with a server, though Perl is probably the most common.

ASP is another interface that provides information about a HTTP request and allows a program to send back a response. VBScript (usually) and JScript are supported by default, though other languages can be used with third-party plugins. With ASP.NET, the .NET family of languages like VB.NET and C# can also be used, too.

Perl and Java are both programming languages, though I have no experience of Perl.


Obviously css and html aren't too related to programming, so they're kinda in their own catergory.They aren't programming at all. HTML is a form of notation, solely for marking up documents. I'm not entirely sure how to describe CSS, other than to say that it's a style sheet language. :rolleyes:


But... for the rest... what language are they based off?Syntactically, many languages (C++, Java, ECMAScript, PHP) are based on C, which in turn is based on BCPL. They have the same operators (+, =, &, *, etc.), statements (if, for, while, etc.), define blocks with braces, and call functions in the same way. However, after that, they start to diverge.


Which are similar?ECMAScript (JavaScript, JScript, and other derivatives) and PHP are similar in that they are loosely-typed, though PHP is class-based with syntax borrowed from Java (in PHP 5), whereas ECMAScript is prototype-based. C++ and Java are similar in that they are strongly-typed, though there are many other differences.


Which are significantly different?Out of all of the above languages, VB is the most unique with its syntax derived from BASIC. Of the C-like languages, C itself is different as it doesn't feature objects. Of the object-oriented languages, ECMAScript is the most unique as it's prototype-based, whereas the others are class-based.


Which would you need to learn to know another?A good command over any third-generation programming language is an advantage, though C-like languages are probably the most worthwhile. However, all programming languages are different, and each one needs to be learnt. Just because something looks the same doesn't necessarily mean that it is, and making assumptions can get you into trouble. The benefits of learning languages similar to ones you already know is just that you'll need to learn less than if you started from scratch.

Probably not very helpful, but a starting point, nevertheless.

Mike

Twey
03-27-2006, 03:03 PM
On Perl:
Perl is a very versatile scripting language, commonly used for writing everything from CGI scripts to full-bodied graphical applications, although only as a CGI script is it much use for web development. It is loosely-typed, and more similar to PHP than any of the other languages you've got there. If you have access to a UNIX system, the perldoc utility usually has access to files containing extensive documentation.

.alias.
03-27-2006, 03:44 PM
C++ is basicaly the same as C with some new added extras if you like. C was the main programming lanuage used to create Apllications Such as Notpad Word and anything else you can think of. But C++ has taken its places and alot of the C commands like

#include <iostream.c>
are depriciated and in C++ you would use

#include <iostream>

C++ its self is only console based which prevents you from creating these applications such as notpad, however when combined with Win32 API you can create a GUI for you console aplication allowing you to create something like notepad.

When you look at the syntax in C++ you will notice it is VERY similar to Javascript, no doubt althought i havnt look at Java it is proberly also very similar.

Python which can be another server-side programming language can be used in its own way. However unlike C++ it is not capiable of linking up with Win32 API to create GUI programs like notepad. Like C++ it has a range of GUI building applications avaliable on the web. The main one which they both share with slight variations is WxWidgets.

HTML is a self explaatory language it even states in its name what language it is. Hyper Text Markup Language.

Visual Basic is just a cariation on BASIC. There are more then just one Visual Basic as they change from version to version. It started of as BASIC and from that we got many languages suck as JustBasic which has many versions. Then theres Visual Basic which is one of the most useful and most used of all of the BASIC languages.

before i repeat mwinter too much ill stop

Twey
03-27-2006, 04:15 PM
Ouch.

C++ is basicaly the same as C with some new added extras if you like.Object support being the main one. :)

#include <iostream.c><iostream.c>?! They seem to have made a major change before my lifetime, then, that they don't give header files the same extension as source files!
When you look at the syntax in C++ you will notice it is VERY similar to JavascriptOnly on a very superficial level. C++ and ECMAScript are very different languages, and resemble one another in almost no way at all except the very basic C-like syntax common to many modern languages.
no doubt althought i havnt look at Java it is proberly also very similar.Java is a lot more similar to Javascript; hence the name. However, while the syntax and some of the native methods are similar, it also has some very clear differences as well. In fact, Java and C++ are more alike than Javascript and either :)
C++ its self is only console based which prevents you from creating these applications such as notpad, however when combined with Win32 API you can create a GUI for you console aplication allowing you to create something like notepad.A language itself is not console-based. When you #include <iostream>, you're utilizing a library containing part of the Windows API. This allows you to interact with the shell via three stream objects (cin, cout, and cerr) allocated to the program at runtime: stdin, stdout, and, under other operating systems with better shells and stream support, stderr.
Python which can be another server-side programming language can be used in its own way. However unlike C++ it is not capiable of linking up with Win32 API to create GUI programs like notepad. Like C++ it has a range of GUI building applications avaliable on the web. The main one which they both share with slight variations is WxWidgets.It is, actually. Win32 bindings for Python do exist, but there are usually better alternatives available. WxWidgets is not a GUI-building "application" (do you mean IDE?) but a platform-independant library with bindings for most popular languages.
Visual Basic is just a cariation on BASIC. There are more then just one Visual Basic as they change from version to version. It started of as BASIC and from that we got many languages suck as JustBasic which has many versions. Then theres Visual Basic which is one of the most useful and most used of all of the BASIC languages.Over-used, some might say. Due to its total platform-dependence and painful runtime requirements, VB is only really useful in two situations: simple applications on a network where the designer can predict the environment with perfect accuracy, and prototyping real applications.

.alias.
03-27-2006, 04:19 PM
It is, actually. Win32 bindings for Python do exist, but there are usually better alternatives available. WxWidgets is not a GUI-building "application" (do you mean IDE?) but a platform-independant library with bindings for most popular languages.

oops yea i did mean IDE


It is, actually. Win32 bindings for Python do exist, but there are usually better alternatives available

thats cool i never actual new that, when i asked about Python and Win32 i was told it doesnt have it. Thanks for letting me know it does Twey

djr33
03-27-2006, 08:36 PM
Reading... gotta run at the moment.

thanks guys... this IS very helpful. I'm just trying to get some general thoughts on the matter.

Now... as a bonus question... throw AJAX and its parts in there, and how all this stuff works together.

Thanks!

Twey
03-27-2006, 08:52 PM
AJAX is just a method of coding that allows Javascript to connect to external resources, usually through the use of the XMLHttpRequest object or an iframe.

djr33
03-28-2006, 05:57 AM
Is it compatible with all versions of JS or a recent addition?

So.. from what I've seen, it basically just uses stuff live, so you can have a php page doing whatever the heck you want, and the JS just makes it function live... by getting the info from it every second. *(the only example I've looked at closely was a clock that changed every second).


Interesting stuff :)

Twey
03-28-2006, 08:21 AM
That's close enough, yes :)
It's a fairly recent development, but it's supported by all major current browsers except Opera.

djr33
03-29-2006, 12:24 AM
Opera because it doesn't do JS or doesn't do AJAX specifically... and... what versions of the browsers? all JS supporting versions? Or newer than that.

Hmm.... cool. Seems fairly easy to get a basic grasp on it. Neat.

mwinter
03-29-2006, 01:27 PM
[AJAX is] a fairly recent development, but it's supported by all major current browsers except Opera.Neither is true.

The only thing new about AJAX is the name itself and its popularity. What it basically embodies has been around for a long time, and even the XMLHttpRequest object has existed for at least four years in IE and Mozilla.

As for Opera support, the XMLHttpRequest object was implemented in version 8, though the traditional methods (hidden images and iframes) have been supported by many browsers for far longer.

Mike

Twey
03-29-2006, 01:51 PM
even the XMLHttpRequest object has existed for at least four years in IE and Mozilla.Sorry... I'd class that as fairly recent, although looking back on it, you're probably right.
As for Opera support, the XMLHttpRequest object was implemented in version 8Whoops. (rethinks facts)
though the traditional methods (hidden images and iframes) have been supported by many browsers for far longer.Maybe it's just me, but I don't count that as AJAX, due to the X, the inaccuracy of which I always believed was due to the name of the XMLHttpRequest object.

mwinter
03-29-2006, 01:55 PM
though the traditional methods (hidden images and iframes) have been supported by many browsers for far longer.Maybe it's just me, but I don't count that as AJAX, due to the X, the inaccuracy of which I always believed was due to the name of the XMLHttpRequest object.Many people talk about using AJAX, but they neither use it asynchronously, nor do they use it to transmit XML. :)

Mike

Twey
03-29-2006, 02:09 PM
In which case, I'd say it wasn't AJAX. :) Although I'm guilty of having done so myself on occasion.