All Things Microsoft > Microsoft Software
Muzzy, why does Windows rule?
jtpenrod:
This would dive you the best of both worlds.
Actually Python (but not Ruby) does have an option much like that. Python source can be compiled to byte code that runs faster. Usually, the interpreter takes care of doing this with the modules the program loads. You can also override that behaviour and byte compile whatever Python source you want.
Both Python and Ruby make provisions for using add-ons made from compiled C/C++ code. After all, this is how these interpreted languages are able to make use of GUI toolkits written in C/C++.
Orethrius:
That kinda reminds me of the old "scene" productions, the ones that took up about 500KB of space initially and used nothing but DirectDraw instruction files in ultra-compressed archives (that were unpacked on-the-fly) to create beautiful landscapes. Whatever happened to those?
muzzy:
--- Quote from: Orethrius ---That kinda reminds me of the old "scene" productions, the ones that took up about 500KB of space initially and used nothing but DirectDraw instruction files in ultra-compressed archives (that were unpacked on-the-fly) to create beautiful landscapes. Whatever happened to those?
--- End quote ---
Runtime texture generation and stuff isn't same as compression. With compression, you have the result data and try to represent it through a compression algorithm. Procedural generation of stuff is different, as the data is generated on the fly. And 500kB is large by some standards, there are 64K and 4K intros out there that look quite quite amazing.
muzzy:
Anyway, jtpenrod, when I was talking about python's lists I was thinking about the ease of manipulating them and doing stuff with them. For example:
--- Code: ---s = "some squares:"
for i in [x*x for x in range(1,15)]:
s = "%s %d" % (s, i)
print s
--- End code ---
Go ahead, move to C after getting used to doing things like that. And that's an example from the simple end. Let's take another one, with a little more trickery, still basic stuff:
--- Code: ---s = "this is a silly stupid test sentence"
print ' '.join([x.capitalize() for x in s.split(' ') if len(x)>4])
--- End code ---
This example outputs "Silly Stupid Sentence", i.e. capitalized words from the string, for which length of word is greater than 4. Got it? Moving to C after having power like this, it's going to be excessively frustrating.
jtpenrod:
Look, Muzzy, I'm not interested in your little pissing contest. Sure, Python includes lots of features that aren't included in C/C++, such as reg ex support. That isn't the point. That first example is obviously contrived as there's a simpler way to get the job done:
--- Code: ---
s= "Some squares: "
for i in range(1, 15) : print "%s %d\n" % (s, i * i)
--- End code ---
As for the second, sure, it's nice to have built-in reg ex support and string manipulation methods. However, there is nothing to prevent anyone from installing equally capable string class and reg ex libs that will work with any C++ program. If you're talking about C programs, the GTK libs also include these string "objects".
You can contrive all sorts of weird examples and peculiar situations, however, how often do these situations occur in most programming situations? Or is it your contention that programming n00bs are to st00pid to make whatever adjustments are needed in going from an introduction to Python to some other language?
Now you want to consider this a concession of defeat, go ahead and knock yourself out. I don't care. However, I will reiterate that I would encourage anyone who wants to pick up programming, having never done it before, to start with Python, and not C/C++ for the reasons I have already stated. :p
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version