The difference being that Trolls have been proven wrong.
Wrong about what?
your expression above is biassed, even ghostdog, I'm sure, can agree with that.
Python is a great language (I'm sure, I would take some getting used to the use of whitespace as part of the syntax, being used to C/C++/C# where it's ignored, and VB where... well actually I suppose the use of CRLF to separate statements can be considered the use of whitespace too, come to think of it.) Readability is subjective, with any language.
Speed- Python, being an interpreted language, will be slower then equivalent compiled code. On the other hand- the choice of algorithm is going to be the deciding factor in any application of either compiled or interpreted language. As an example, you simply cannot optimize a bubble-sort in any compiled language to be faster then a quicksort- or really, any other sort algorithm, implemented in an interpreted language.
Now, that being said; there are some critical differences between what Python is aimed at and the other languages you named are for.
Each of the languages you named can create Windows Applications, C, BASIC (via freeBASIC or darkBASIC) and VB6 (which takes hacking to create a command-line program).
Basically- Python is a scripting language- a Scripting language is intended for a completely different set of problems then a compiled language, mostly for the creation of helpful little utilities that are used at the command-line. Because of this (and correct me if I'm wrong) but Python- and most scripting languages - cannot be used to create a windows application, unlike the other languages you named.
Also, regarding OOP once again... no one answered my question... is each separate file in Python usable as a class? Do they posess member variables? (I see that the built-in stuff uses Objects with static methods, like "string.<method>" but is it possible to create your own objects?
EDIT: Actually, I just remembered IronPython, which is a .NET implementation of Python... I imagine THAT can create windows applications
Also, in answer to the query of where I got the code, I just did a google for python samples.
ahh, here it is:
http://www.strout.net/python/ai/therapist.pySomething that might explain the inconsistencies with today's python:"last revised: 3/17/97", perhaps split did something different. I haven't a god *censored* clue. It's not my code, so I assumed it was there for a reason.
To clarify what that particular procedure did. you pass in a delimited string of keys and a dictionary, and you get a delimited string of the values in those keys. It seemed nice and short and easily translated to VB- or any language, for that matter.
Wow, I missed an entire post here, too...
BC_Programmer, you have obviously never used Python. For indentation, when using the IDLE or built in IDE it automatically indents when necessary. So you don't need to worry about indentation.
That wasn't my point. my point was you cannot "organize" it the way you like- for example, with C you could put an entire IF statement on one line, if it was a line or two.
I'm sorry, it's dynamically typed I was thinking of something else.
Well, as ghostdog pointed out, it's like the use of Variant's in Visual Basic before version 4 (that is, "2"+2 fires off a type mismatch in VB2- you would need to either val() the "2" or CStr/Str the 2. (IIRC, I do know that VB4 added "evil type coercion")... It was definitely better before they decided to add the automatic crap.
Not all Python programs have to be OO, which is better then everything being OO.
not all VB6 programs have to be Object Oriented either. In fact even .NET programs don't strictly require Object Orientation(of them, C# does though... VB.NET does not) . Java strictly requires it.
Second of all, you put plenty of spaces in the VB6 code, but none in the Python code, making the Python code not look as nice.
I only copy-pasted the Python code. The reason the VB6 code is indented as it is is because I wrote it. I didn't want to mess up the python code, which now turns out to be over 9 years old anyway (again, might explain the split?).
Third of all, BC_Programmer, stop acting like a smart-aleck:
"smart alec"
Not only that, but the Python and VB6 code don't even work the same.
With the split statement you add a lower function to Python and make it look
more complicated. Like before, you don't add any spaces, it's all clumped together.
Yes, if the split function actually does split the string into it's respective characters, then it does work differently. I went with the assumption that the split() function defaulted to a space, or something along those lines. Otherwise- well, it just doesn't do a whole lot (did the Split() function perhaps work differently in 97?) Already covered the spaced issue, I don't have python installed and therefore would be unable to test and knowing that whitespace is part of the syntax I left it as-is.
Please BC, stop acting like an idiot.
your the one comparing apples to oranges. Not me. Well, I was, but it was purely satirical.
Anyway, have you played with Python's dictionary objects? For example, how easy is it to sort dictionary items by keys or values in VB ?(or vbscript?) ... with Python's dictionary objects and sorting methods, its very easy. The last time i play with vb6, (or even vbscript), sorting dictionary objects (or even sorting ordinary variables) are a pain.
I barely ever use Dictionary's in any language. I use the VB6 Collection Extensively, but I don't use the Dictionary object since it requires the scripting Run-time (which is guaranteed from VBScript, but not guaranteed to be installed with VB6) I rarely have to sort the items I have in the collection- since they are objects, and in general the order I have them in doesn't matter much. I believe the main thing that turned me off of the dictionary was the requirement of passing in a Key, rather then being able to use an index as is possible with a collection. Not a huge deal but enough of a down-side to not add the reference to the scripting runtime.
For those times when I do need to sort, I just use a Class and interface I wrote- all I need to do is implement the comparing function that compares two items in the array. Haven't needed it much, come to think of it.
I'm going to install a few scripting languages(perl,python, (any others anybody can think of? (that is, ones that work with the Scripting Host)) so that I can create some sample Python and Perl Scripts to go alongside the VBScript and Javascript ones I have already. I thought I already installed the two but I guess it was my old machine.
[/quote]