A story about Python... sort of

M

Max M

There is a story today on Slashdot


Open Source Project Management Lessons
======================================
http://developers.slashdot.org/article.pl?sid=03/07/02/1817220&mode=flat&tid=185

"Paul Baranowski takes a moment to reflect on Open Source Project
Management in his blog. His reflections are based on the first two years
of the Peek-a-booty project." Interesting comments on media coverage,
choice of programming language, when to release a project, and more.


In that article Paul Baranowski has a list of lessons. One being

Engineering Lessons
-------------------
1. C/C++ is no longer a viable development language


He doesn't really say in the article what language should be used
instead. But there is a link to another page:

Which Language Do You Recommend?
================================
http://peek-a-booty.org/Docs/WhichLanguageDoYouRecommend.htm


And guess which language it is?


regards Max M
 
E

Egor Bolonev

Hello, Max!
You wrote on Thu, 03 Jul 2003 11:17:30 +0200:

MM> There is a story today on Slashdot

[Sorry, skipped]

MM> And guess which language it is?

InterEnglish?

With best regards, Egor Bolonev. E-mail: (e-mail address removed) [ru eo en]
 
M

Max Khesin

import flame.*
import sorry.*
Ok, with all my respect to python, the stuff about C++ is a bunch of hooey.
Compilation time is the problem? Give me a break.
1) separate compilation?
2) precompiled headers?
3) tools that allow cluster compilation?
4) ever read 'large-scale c++ development' by Lacos? a must for large c++
project. letter-envelope idiom to help compilation...etc.
Anyway, if you are coding so fast that compilation time becomes a serious
problem you are either
a) the smartest and fastest programmer on earth
b) are not thinking enough

c++ is great when execution speed and memory efficiency is a must. It is
hard to learn, but there are great benefits, and do you really want halfwits
(who can't learn it) involved on your project? It also (by design) makes
previous C programmers productive very fast. Empirically - just look at all
the C++ projects on SF!

max.


--
========================================
Max Khesin, software developer -
(e-mail address removed)
[check out our image compression software at www.cvisiontech.com, JBIG2-PDF
compression @
www.cvisiontech.com/cvistapdf.html]
 
M

Max Khesin

I am not a TDD expert, but from what I understand TDD applies to lower-level
code, not to design. Design usually spans separate modules and could have
serious impact on the compilation time, while lower-level code can be
compiled/tested very quickly, albeit not as quickly as python. And yes, many
solutions do indicate that there WAS a problem, but since the solutions
actually do work, the problem is not sufficient (IMO) to be a deal breaker
in terms of programming language choice.
max.

--
========================================
Max Khesin, software developer -
(e-mail address removed)
[check out our image compression software at www.cvisiontech.com, JBIG2-PDF
compression @
www.cvisiontech.com/cvistapdf.html]
 
M

Max Khesin

BearMan said:
Not to mention all the time spent recompiling through out the debugging and
troubleshooting process. Has Max ever programmed in Python? How about
Assembly?

Yes to both in varying degree.
The fact of the matter is there is no such thing as one ULTIMATE language. A
real programmer will have mastered several languages so as to integrate the
best features for any given situation.

IMHO

I am not sure where we disagree. This is exactly my point. The statement
"
Engineering Lessons
-------------------
1. C/C++ is no longer a viable development language
"
is pure rubbish. C++ is still great for certain kinds of projects, and there
are lots of open-source and proprietary projects to prove this. I mean, is
Linux (or Windows) 'not a viable project'?? As I said, this is a very
narrow-minded and conceited statement: rubbish.

max.
 
D

Dave Brueck

Sounds to me that if they've come up with so many and such a wide
range of optimizations to improve compilation time, then it clearly *is*
a problem...

Yep! I just read an article in the July issue of Game Developer that mentioned
this topic (item #3 above) in passing. It was a post-mortem of the project
and they cited as one of their life-savers a tool that used all computers in
the office to assist in the compilation of the game - a compilation farm
basically - so that the full rebuild of the game could be reduced to only 3
minutes. Obviously you don't need to do a "rebuild all" for every change to
the code, but compilation and link time is a very real cost, especially as
the project size grows. Even for small projects though, I'm much more likely
to try out small, incremental changes in a language like Python than when I
did C++ or Java because it's just so quick and easy to try it out.

-Dave
 
F

F. GEIGER

(who can't learn it) involved on your project? It also (by design) makes
previous C programmers productive very fast. Empirically - just look at
all

[OT] That's not a pro, that's a con on the C++ side. And actually that's the
reason why there's so much bad C++ software. A C programmer first has to
forget C to be able to program in C++ - well, to be able to program OO in
C++.

Best regards
Franz GEIGER

Max Khesin said:
import flame.*
import sorry.*
Ok, with all my respect to python, the stuff about C++ is a bunch of hooey.
Compilation time is the problem? Give me a break.
1) separate compilation?
2) precompiled headers?
3) tools that allow cluster compilation?
4) ever read 'large-scale c++ development' by Lacos? a must for large c++
project. letter-envelope idiom to help compilation...etc.
Anyway, if you are coding so fast that compilation time becomes a serious
problem you are either
a) the smartest and fastest programmer on earth
b) are not thinking enough

c++ is great when execution speed and memory efficiency is a must. It is
hard to learn, but there are great benefits, and do you really want halfwits
(who can't learn it) involved on your project? It also (by design) makes
previous C programmers productive very fast. Empirically - just look at all
the C++ projects on SF!

max.


--
========================================
Max Khesin, software developer -
(e-mail address removed)
[check out our image compression software at www.cvisiontech.com, JBIG2-PDF
compression @
www.cvisiontech.com/cvistapdf.html]


Max M said:
There is a story today on Slashdot


Open Source Project Management Lessons
======================================
http://developers.slashdot.org/article.pl?sid=03/07/02/1817220&mode=flat&tid
=185

"Paul Baranowski takes a moment to reflect on Open Source Project
Management in his blog. His reflections are based on the first two years
of the Peek-a-booty project." Interesting comments on media coverage,
choice of programming language, when to release a project, and more.


In that article Paul Baranowski has a list of lessons. One being

Engineering Lessons
-------------------
1. C/C++ is no longer a viable development language


He doesn't really say in the article what language should be used
instead. But there is a link to another page:

Which Language Do You Recommend?
================================
http://peek-a-booty.org/Docs/WhichLanguageDoYouRecommend.htm


And guess which language it is?


regards Max M
 
M

Max Khesin

[OT] That's not a pro, that's a con on the C++ side. And actually that's the
reason why there's so much bad C++ software. A C programmer first has to
forget C to be able to program in C++ - well, to be able to program OO in
C++.

Well, it is documented as one of the original design goals of the language,
if I remember correctly. It is certainly implicitly a goal considering the
sacrifices made to preserve C as a subset.
I think it was important in getting a lot of people on board with c++, but
it certainly there are many problems with it, including the one you
mentioned. Of course the problems would not exist if C++ was never accepted.
It is similar to saying 'how dare my parents embarass me by having sex'.
Take it up with Bjarne :)

max.
Best regards
Franz GEIGER







--
========================================
Max Khesin, software developer -
(e-mail address removed)
[check out our image compression software at www.cvisiontech.com, JBIG2-PDF
compression @
www.cvisiontech.com/cvistapdf.html]
 
C

Cliff Wells

import flame.*
import sorry.*
Ok, with all my respect to python, the stuff about C++ is a bunch of hooey.
Compilation time is the problem? Give me a break.

It is *a* problem. I'll agree that it's one of the least.
1) separate compilation?
2) precompiled headers?
3) tools that allow cluster compilation?
4) ever read 'large-scale c++ development' by Lacos? a must for large c++
project. letter-envelope idiom to help compilation...etc.
Anyway, if you are coding so fast that compilation time becomes a serious
problem you are either
a) the smartest and fastest programmer on earth
b) are not thinking enough

Or making simple typos.
c++ is great when execution speed and memory efficiency is a must. It is
hard to learn, but there are great benefits, and do you really want halfwits
(who can't learn it) involved on your project? It also (by design) makes
previous C programmers productive very fast.

I won't disagree that there is a place for languages like C++.
Developing entire applications isn't it.
Empirically - just look at all the C++ projects on SF!

And what percentage of those are incomplete, abandoned, or simply
unusable?
 
R

Roy Smith

Dave Brueck said:
If Python were to become too slow or too weird I'd migrate to
another high-level language

I can certainly see situations were Python might be too slow, but too
weird? When would it be too weird?
 
R

Russell Reagan

Dave Brueck said:
Well, again, neither of those are "applications level" projects.

There is a rather large industry which I'll call "computer games" that is
rather CPU intensive, and AFAIK the vast majority of those games are written
in C/C++. It really depends on the definition of "application level". If
we're only including things like word processors and web browsers in the
"application level", then there isn't a great need for C++ in the
"application level", but there are certainly areas where speed and memory
efficiency is important.

I will admit that I'm getting tired of writing a lot of the support code,
debugging, etc., most of which Python provides for "free".
 
A

Aahz

There is a rather large industry which I'll call "computer games" that
is rather CPU intensive, and AFAIK the vast majority of those games are
written in C/C++. It really depends on the definition of "application
level". If we're only including things like word processors and web
browsers in the "application level", then there isn't a great need for
C++ in the "application level", but there are certainly areas where
speed and memory efficiency is important.

At the same time, more and more of those games are switching to using
C/C++ only for the rendering engine and using a scripting language (Lua
or Python) for the gameplay itself.
 
B

Behrang Dadsetan

Russell said:
[OT] That's not a pro, that's a con on the C++ side. And actually that's
the

reason why there's so much bad C++ software. A C programmer first has to
forget C to be able to program in C++ - well, to be able to program OO in
C++.


C++ is not an OO language. It is a multi-paradigm language that happens to
support OO features. No one is required to program OO in C++. It's even very
debatable if it's better to program OO in C++.

We are getting very philosophical here and I guess we are getting a
little off-topic, but what is an OO language? Isn't one that supports OO
features? Ok, You can write C code and compile it with a C++ compiler,
but does it disqualify C++ as being a OO language?

The advantages you talk about writing C and using a C++ compiler are
pretty weak. C++ is certainly not just about the "typedef" feature... It
is a very powerfull language that can be used to express exactly what
you want the computer to do, and in the same time kind of abstract
details to a level where you can still see what your program was written
for. Agreed, it is a terrificly complex language all together, but it
has its use. If you actually respect the thousand rules from M. Meyer
plus a few from M. Lakos, you can build very reliable and stable
applications. If you are a genius or have some technique and experience,
you can even have a somewhat bigger code where you still have an overview.

The big disadvantage to its C compatibility is that lots of people
beleive they have C++ experience and present themselves at C++ jobs. You
just need an IT management which has no clue about OO technology/C++
(managers that understand anything at this level are in minority) and
you soon have a C programmer who used a C++ compiler converted into a
Java programmer. Little after you will see something really funny, C
compiled by a Java programmer. Is Java therefore not a OO language? I
mean Java will allow C programmers to build classes with only static
methods, with classes of 6000 lines without constructor and all
variables declared as public class members? I have seen this, and I am
not exagerating at all in the description... it actually took me two
days to understand why I did not understand how the programmer cut the
program. Yes, I was naive enough to think one can only write OO in Java,
like in the advert.

Anyway, let us talk about something else, I hate being reminded how
often our IT industry has been guarenteeing our jobs life-time by making
every thing more complicated and more expensive instead of making things
simpler and cheaper as we were entrusted to do. Note that I do not think
we do that on purpose :)

That said, python does make life easier in many occasions, so there is
maybe some hope that a little tiny community of our IT industry is not
reaping off our dear sponsors (IT users including IT people).

Thanks pyguys for your beautiful contribution, please continue just as
you are now. You have been doing a wonderful job. If you could only
replace VB for all the usages it has now, and convince the planet of
that as well, I would be thankful for ever. :)

Ben.
 
P

Paul Boddie

Max Khesin said:
I am not sure where we disagree. This is exactly my point. The statement
"
Engineering Lessons
-------------------
1. C/C++ is no longer a viable development language
"
is pure rubbish. C++ is still great for certain kinds of projects, and there
are lots of open-source and proprietary projects to prove this.

I wouldn't agree with you unreservedly here. In many respects, the
choice of C++ for projects is often an educational problem with the
developers - people choose it because it's what they know, potentially
not very well in many cases. So one could say that it's really
something they just know something about - it seems like the
right/safe choice, presumably because their peers/acquaintances who
are just as badly informed tell them so.

Those of us who are used to more high-level languages would think
twice about writing a large application using a language/library
combination without decent (ie. modern) support for memory management,
for example. I can imagine that many developers find it challenging
and even rewarding to think up interesting schemes for allocating and
freeing memory - perhaps they even think that this (and lots of other
unnecessary wheel reinvention) is what programming is all about.
Personally, I'd rather get on with implementing the actual system
concerned.

So, I'd rephrase the original statement: C/C++ are frequently
suboptimal choices for application development. Why? Poor support for
near-essential features found in contemporary languages combined with
the absence of timely, effective standardisation of useful library
functionality.

Paul
 
J

John J. Lee

At the same time, more and more of those games are switching to using
C/C++ only for the rendering engine and using a scripting language (Lua
or Python) for the gameplay itself.

Is this true of big-$ commercial games? What sort of market share do
high-level / interpreted languages have there?

Never having been a (graphical) games player, I don't know the first
thing about how games developers do things.


John
 
D

Dave Brueck

There is a rather large industry which I'll call "computer games" that is
rather CPU intensive, and AFAIK the vast majority of those games are
written in C/C++. It really depends on the definition of "application
level". If we're only including things like word processors and web
browsers in the "application level", then there isn't a great need for C++
in the
"application level",

Actually, games are a particularly good example to illustrate the point:

1) In the movement away from a lower-level language, games are probably one of
the last hold-outs since performance often means so much. Still, even games
do make the transition - the transition away from assembly being the main
example.

2) Even the most performance-intensive games of today are already
transitioning towards higher-level languages - is there any major
first-person shooter or real-time strategy game coming out these days that
doesn't boast a powerful scripting language? With each new generation of
games the developers try to push more and more of the functionality into
their scripting engine leaving as little as possible behind in C/C++ - the
render loop, *some* of the AI, etc. Not only is the game customizable by the
customers, the developers themselves prefer it because of fewer bugs and it
makes it much easier to try new and cool stuff out.

3) More and more of the performance-intensive work is handled by hardware
nowadays anyway - both video and audio. Furthermore, the game itself usually
relies on a pretty rich and powerful supporting library like OpenGL or even
DirectX, which depending on the route you take can supply a ton of the
functionality that the game developer would normally write in C or C++.

4) All of the above mean that in many cases you already *can* do some pretty
elaborate games in higher-level languages (the games listed on Pygame are a
great example), and there's every indication that the trend will continue.

There came a time when it was no longer economically viable to develop an
entire game in assembly, and IMO we've *already* passed the point where it's
no longer economically viable to develop most games entirely in C++ - the
time to market is too long, it's too expensive to add new features,
recovering from early incorrect decisions is too costly, etc. Games are
moving to higher-level languages as much as they can because it's a
competitive advantage to do so.
but there are certainly areas where speed and memory
efficiency is important.

Oh, nobody disagrees with that. But due to increases in efficiency and
decreases in prices, the number of cases is shrinking wherein speed and
memory constraints require you to drop to a lower-level language.

-Dave
 
B

Ben Finney

Anyway, I know of one chess program written in python, and it is
dreadfully slow compared to *any* program written in C/C++ (that I've
seen anyway).

Have you looked at the code for it? Have you profiled it to see where
its bottlenecks are? It's often the case that a program is low because
of poor design, or simply choosing a slow algorithm.

Until profiling, of course, you can't know which algorithms are too slow
for the program.
The things that make a chess program fast aren't really python's
strengths, but hopefully I'm being pessimistic due to my lack of
python/c knowledge.

My suggestion for those who want to write programs that do something
quickly:

- Write a program that does the job at all, paying attention to
simplicity and readability and *no* attention to optimisation.

- Debug the program so it does everything it's supposed to do, albeit
slowly.

- Once the program is correct, and not before, profile it to see where
it's slow.

- Pick the biggest bottleneck and make it faster, by one or more of:

- Choose a faster algorithm, perhaps sacrificing readability or
simplicity
- Re-implement in C

- Iterate the previous step until the program is fast enough or you
run out of (time|money).

You'll have a program that is quite readable, except in the places where
it needs to be fast. In my experience, those places are surprisingly
few, and are surprisingly different to where you expected them to be.
import chess
chess.run_program_in_c
print "Thanks for playing! Bye!"

It may well be that all the "real" chess-thinking stuff may be too slow
in Python; you might end up with the move-evaluation routine in C, for
example.

But discover that by profiling a Python implementation first! If it
turns out to be too slow, at least you've debugged a working algorithm,
and can treat it as pseudocode for the port to C. If it turns out that
the bottlenecks are somewhere else entirely, you've saved yourself a
huge misguided optimisation effort.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top