Re: Python vs C++

2014-08-27 Thread Amirouche Boubekki
2014-08-27 8:23 GMT+02:00 Ian Kelly : > On Tue, Aug 26, 2014 at 11:43 PM, alex23 wrote: > > On 26/08/2014 6:12 PM, Amirouche Boubekki wrote: > >> > >> 2014-08-26 6:02 GMT+02:00 Ian Kelly >> >: > >> > >> It would be just as easy or easier in Python, or one could

Re: Python vs C++

2014-08-27 Thread Amirouche Boubekki
2014-08-27 8:06 GMT+02:00 Ian Kelly : > On Tue, Aug 26, 2014 at 2:12 AM, Amirouche Boubekki > wrote: > > 2014-08-26 6:02 GMT+02:00 Ian Kelly : > > > >> On Mon, Aug 25, 2014 at 4:52 AM, Amirouche Boubekki < > amirouche.boube...@gmail.com> wrote: > >> > - I am a big fan of Final Fantasy games, it

Re: Python vs C++

2014-08-27 Thread Ian Kelly
On Tue, Aug 26, 2014 at 2:12 AM, Amirouche Boubekki wrote: > 2014-08-26 6:02 GMT+02:00 Ian Kelly : > >> On Mon, Aug 25, 2014 at 4:52 AM, Amirouche Boubekki >> wrote: >> > - I am a big fan of Final Fantasy games, it seems to be an easy game >> > experience to code >> >> Maybe not so easy, if th

Re: Python vs C++

2014-08-26 Thread Ian Kelly
On Wed, Aug 27, 2014 at 12:23 AM, Ian Kelly wrote: > On Tue, Aug 26, 2014 at 11:43 PM, alex23 wrote: >> On 26/08/2014 6:12 PM, Amirouche Boubekki wrote: >>> >>> 2014-08-26 6:02 GMT+02:00 Ian Kelly >> >: >>> >>> It would be just as easy or easier in Python, or one

Re: Python vs C++

2014-08-26 Thread Ian Kelly
On Tue, Aug 26, 2014 at 11:43 PM, alex23 wrote: > On 26/08/2014 6:12 PM, Amirouche Boubekki wrote: >> >> 2014-08-26 6:02 GMT+02:00 Ian Kelly > >: >> >> It would be just as easy or easier in Python, or one could save a >> lot more effort by just using RPG Maker

Re: Python vs C++

2014-08-26 Thread alex23
On 26/08/2014 6:12 PM, Amirouche Boubekki wrote: 2014-08-26 6:02 GMT+02:00 Ian Kelly mailto:ian.g.ke...@gmail.com>>: It would be just as easy or easier in Python, or one could save a lot more effort by just using RPG Maker like every other indie RPG developer seems to do. I don't thi

Re: Python vs C++

2014-08-26 Thread Amirouche Boubekki
2014-08-26 6:02 GMT+02:00 Ian Kelly : > On Mon, Aug 25, 2014 at 4:52 AM, Amirouche Boubekki < > amirouche.boube...@gmail.com> wrote: > > - I am a big fan of Final Fantasy games, it seems to be an easy game > experience to code > > Maybe not so easy, if the horrifying number of bugs in the early g

Re: Python vs C++

2014-08-25 Thread Ian Kelly
On Mon, Aug 25, 2014 at 4:52 AM, Amirouche Boubekki < amirouche.boube...@gmail.com> wrote: > - I am a big fan of Final Fantasy games, it seems to be an easy game experience to code Maybe not so easy, if the horrifying number of bugs in the early games of the series are any indication. I'm not su

Re: Python vs C++

2014-08-25 Thread Neil D. Cerutti
On 8/23/2014 9:00 AM, Chris Angelico wrote: On Sat, Aug 23, 2014 at 10:38 PM, Rustom Mody wrote: Here is an example (not identical but analogous to) where markup+compile is distinctly weaker than wysiwyg: You can use lilypond to type music and the use a midi player to play it But lilypond does

Re: Python vs C++

2014-08-25 Thread Amirouche Boubekki
2014-08-25 12:52 GMT+02:00 Amirouche Boubekki : > Héllo, > > > 2014-08-21 14:54 GMT+02:00 David Palao : > > Why to use C++ instead of python? >> >> It is not ranting against C++. I was/am looking for small-medium >> projects to exercise my C++ skills. But I'm interested in a "genuine" >> C++ pr

Re: Python vs C++

2014-08-25 Thread Amirouche Boubekki
Héllo, 2014-08-21 14:54 GMT+02:00 David Palao : > Why to use C++ instead of python? > > It is not ranting against C++. I was/am looking for small-medium > projects to exercise my C++ skills. But I'm interested in a "genuine" > C++ project: some task where C++ is really THE language (and where >

Re: Python vs C++

2014-08-24 Thread alex23
On 24/08/2014 7:14 PM, Robert Kern wrote: On 2014-08-22 01:26, Chris Angelico wrote: Every time Cython gets discussed, I get a renewed desire to learn it. Trouble is, I don't have any project that calls for it - there's nothing I'm desperately wanting to do that involves both Python and C/C++. A

Re: Python vs C++

2014-08-24 Thread Joseph Martinot-Lagarde
Le 23/08/2014 16:21, Chris Angelico a écrit : On Sun, Aug 24, 2014 at 12:02 AM, Ian Kelly wrote: I don't know how fast lilypond is, but perhaps one could write an editor that wraps lilypond and invokes it in realtime to show the output in an adjacent panel, perhaps with a brief delay when the u

Re: Python vs C++

2014-08-24 Thread Robert Kern
On 2014-08-22 01:26, Chris Angelico wrote: On Fri, Aug 22, 2014 at 4:05 AM, Joseph Martinot-Lagarde wrote: For information, Cython works with C++ now: http://docs.cython.org/src/userguide/wrapping_CPlusPlus.html. Now isn't that cool! Every time Cython gets discussed, I get a renewed desire t

Re: Python vs C++

2014-08-23 Thread Terry Reedy
On 8/23/2014 10:21 AM, Rustom Mody wrote: Wordperfect was one of the best wysiwyg editors Ive used. One could use it in normal (1-screen) mode Or one could split the screen and see the formattings in the lower window along withe the formatted in the upper. I wrote at least two books with Wordp

Re: Python vs C++

2014-08-23 Thread Terry Reedy
On 8/23/2014 8:38 AM, Rustom Mody wrote: WYSIWYG editors allow that -- can make a huge difference to beginners who find music hard to read. Here's an example I typed out in the wysiwig editor nted https://vimeo.com/16894001 ¹ "Awww, snap! This video can’t be played with your current setup" H

Re: Python vs C++

2014-08-23 Thread Marko Rauhamaa
mm0fmf : > On 22/08/2014 18:16, Marko Rauhamaa wrote: >> SCons gives you the power of Python. Don't use that >> power except in utmost need. > > Ah, you've seen our build system at work! Where I've used SCons, I've striven to make the SConscript files obvious to a casual visitor, who might not ev

Re: Python vs C++

2014-08-23 Thread mm0fmf
On 22/08/2014 18:16, Marko Rauhamaa wrote: SCons gives you the power of Python. Don't use that power except in utmost need. Ah, you've seen our build system at work! Andy -- https://mail.python.org/mailman/listinfo/python-list

Re: Python vs C++

2014-08-23 Thread Rustom Mody
On Saturday, August 23, 2014 7:32:12 PM UTC+5:30, Ian wrote: > On Sat, Aug 23, 2014 at 6:38 AM, Rustom Mody wrote: > > Here is an example (not identical but analogous to) where markup+compile is > > distinctly weaker than wysiwyg: > > You can use lilypond to type music and the use a midi player to

Re: Python vs C++

2014-08-23 Thread Chris Angelico
On Sun, Aug 24, 2014 at 12:02 AM, Ian Kelly wrote: > I don't know how fast lilypond is, but perhaps one could write an editor > that wraps lilypond and invokes it in realtime to show the output in an > adjacent panel, perhaps with a brief delay when the user stops typing. You theoretically could,

Re: Python vs C++

2014-08-23 Thread Ian Kelly
On Sat, Aug 23, 2014 at 6:38 AM, Rustom Mody wrote: > Here is an example (not identical but analogous to) where markup+compile is > distinctly weaker than wysiwyg: > > You can use lilypond to type music and the use a midi player to play it > But lilypond does not allow playing and seeing-in-realti

Re: Python vs C++

2014-08-23 Thread Chris Angelico
On Sat, Aug 23, 2014 at 10:38 PM, Rustom Mody wrote: > Here is an example (not identical but analogous to) where markup+compile is > distinctly weaker than wysiwyg: > > You can use lilypond to type music and the use a midi player to play it > But lilypond does not allow playing and seeing-in-realt

Re: Python vs C++

2014-08-23 Thread Rustom Mody
On Saturday, August 23, 2014 3:19:37 AM UTC+5:30, Chris Angelico wrote: > On Sat, Aug 23, 2014 at 7:38 AM, Michael Torrie wrote: > > On 08/22/2014 02:06 PM, Marko Rauhamaa wrote: > >> I tend to think the opposite: C++ barely has a niche left. I definitely > >> wouldn't want to use C++ very far fro

Re: Python vs C++

2014-08-23 Thread Chris Angelico
On Sat, Aug 23, 2014 at 5:36 PM, Paul Rudin wrote: > I'm unconvinced is that e.g. LaTeX is inherently more "expert" that Word > for simple document preparation. It's mostly a question of familiarity. I think LaTeX probably is, in the same way that PhotoShop or Gimp is more expert than a simple pa

Re: Python vs C++

2014-08-23 Thread Paul Rudin
Chris Angelico writes: > On Sat, Aug 23, 2014 at 3:56 PM, dieter wrote: >> Chris Angelico writes: >>> Frankly, I wouldn't write OO in anything, because I think the entire >>> concept of a WYSIWYG editor is flawed. >> >> That would limit (so called) office applications to experts only. >> But th

Re: Python vs C++

2014-08-23 Thread Marko Rauhamaa
Chris Angelico : > I'm just saying that callbacks are inherently restrictive in a > language without first-class functions. You don't have to go that far to have great callback support. C# (and Delphi) show a great model that I wish C++ had adopted from the beginning. C++ could have declared that

Re: Python vs C++

2014-08-22 Thread Chris Angelico
On Sat, Aug 23, 2014 at 3:56 PM, dieter wrote: > Chris Angelico writes: >> Frankly, I wouldn't write OO in anything, because I think the entire >> concept of a WYSIWYG editor is flawed. > > That would limit (so called) office applications to experts only. > But the success of these applications r

Re: Python vs C++

2014-08-22 Thread dieter
Chris Angelico writes: > Frankly, I wouldn't write OO in anything, because I think the entire > concept of a WYSIWYG editor is flawed. That would limit (so called) office applications to experts only. But the success of these applications relies on the fact, that even a complete novice can immedi

Re: Python vs C++

2014-08-22 Thread dieter
Christian Gollwitzer writes: > ... > * Java: I don't see that it is much higher level than C++. It has a > GC, but that's all, and you can have that in C++, too, if you want. On > the other hand, you loose the metaprogramming facilities provided by > C++ templates (needs a guru to make a library,

Re: Python vs C++

2014-08-22 Thread Chris Angelico
On Sat, Aug 23, 2014 at 7:56 AM, Michael Torrie wrote: > On 08/22/2014 03:49 PM, Chris Angelico wrote: >> My main issue with callbacks in either C or C++ is that functions >> aren't first-class objects. You can pass function pointers around (and >> you don't need (void *) to do it, you can use typ

Re: Python vs C++

2014-08-22 Thread Michael Torrie
On 08/22/2014 03:49 PM, Chris Angelico wrote: > My main issue with callbacks in either C or C++ is that functions > aren't first-class objects. You can pass function pointers around (and > you don't need (void *) to do it, you can use typed function pointers > just fine), but you can't actually con

Re: Python vs C++

2014-08-22 Thread Chris Angelico
On Sat, Aug 23, 2014 at 7:38 AM, Michael Torrie wrote: > On 08/22/2014 02:06 PM, Marko Rauhamaa wrote: >> I tend to think the opposite: C++ barely has a niche left. I definitely >> wouldn't want to use C++ very far from its (very narrow) sweet spot. > > I agree that it's niche is narrowing. But i

Re: Python vs C++

2014-08-22 Thread Michael Torrie
On 08/22/2014 02:06 PM, Marko Rauhamaa wrote: > I tend to think the opposite: C++ barely has a niche left. I definitely > wouldn't want to use C++ very far from its (very narrow) sweet spot. I agree that it's niche is narrowing. But it's still pretty wide and widely used. Many adobe products are

Re: Python vs C++

2014-08-22 Thread Marko Rauhamaa
>> assembly >> C >>C++ >>Go >> Java/C# >> Python >> Scheme >> Bash > > > My point is that this picture is incomplete: it shows the programming > languages as *poi

Re: Python vs C++

2014-08-22 Thread Stefan Behnel
If you want to add Cython to that (overly simplified) graph, you might get something like this: Christian Gollwitzer schrieb am 22.08.2014 um 21:25: > as |--| > c || > c++ |---| Cython || > python|---

Re: Python vs C++

2014-08-22 Thread Christian Gollwitzer
Am 22.08.14 11:29, schrieb Marko Rauhamaa: So my advise is, use as high-level programming language as you can. If you can't, deal with it, but often you can break your system into parts where only a small corner needs to be implemented at the low level. Agreed. This is called Ousterhout's dicho

Re: Python vs C++

2014-08-22 Thread CHIN Dihedral
On Friday, August 22, 2014 8:26:00 AM UTC+8, Chris Angelico wrote: > On Fri, Aug 22, 2014 at 4:05 AM, Joseph Martinot-Lagarde > > wrote: > > > For information, Cython works with C++ now: > > > http://docs.cython.org/src/userguide/wrapping_CPlusPlus.html. > > > > Now isn't that cool! > > >

Re: Python vs C++

2014-08-22 Thread Marko Rauhamaa
Skip Montanaro : > On Fri, Aug 22, 2014 at 7:51 AM, Neil D. Cerutti wrote: >> But I contend you do need to be a Medieval Scholar to compile and link it. > > That's only because whoever wrote your Makefile wasn't skilled in the > art of make recipes. :-) Make shouldn't be involved in any serious

Re: Python vs C++

2014-08-22 Thread Joseph Martinot-Lagarde
Le 22/08/2014 02:26, Chris Angelico a écrit : On Fri, Aug 22, 2014 at 4:05 AM, Joseph Martinot-Lagarde wrote: For information, Cython works with C++ now: http://docs.cython.org/src/userguide/wrapping_CPlusPlus.html. Now isn't that cool! Every time Cython gets discussed, I get a renewed desir

Re: Python vs C++

2014-08-22 Thread Michael Torrie
On 08/21/2014 06:54 AM, David Palao wrote: > Hello, > I consider myself a python programmer, although C++ was one of the > first languages I learned (not really deeply and long time ago). > > Now I decided to retake C++, to broaden my view of the business. > However, as I progress in learning C++,

Re: Python vs C++

2014-08-22 Thread Chris Angelico
On Fri, Aug 22, 2014 at 10:51 PM, Neil D. Cerutti wrote: > C itself is very simple (albeit not simple to use). But I contend you do > need to be a Medieval Scholar to compile and link it. My mind boggles > watching a ./configure vomit ASCII all over my screen. I have to avert my > eyes, make a wis

Re: Python vs C++

2014-08-22 Thread Skip Montanaro
On Fri, Aug 22, 2014 at 7:51 AM, Neil D. Cerutti wrote: > But I contend you do need to be a Medieval Scholar to compile and link it. That's only because whoever wrote your Makefile wasn't skilled in the art of make recipes. :-) Skip -- https://mail.python.org/mailman/listinfo/python-list

Re: Python vs C++

2014-08-22 Thread Neil D. Cerutti
On 8/22/2014 5:29 AM, Marko Rauhamaa wrote: C is readily supported by all extension APIs. Its calling conventions are stable and well-understood. Its runtime requirements are trivial. Plus, you don't have to be a Medieval Scholar to program in it. C itself is very simple (albeit not simple to u

Re: Python vs C++

2014-08-22 Thread Marko Rauhamaa
Chris Angelico : > On Fri, Aug 22, 2014 at 6:05 PM, Christian Gollwitzer wrote: >> I'm not even convinced that the development time is significantly >> lower in Python within this overlap. > > It usually will be, though not always. Even more to the point, it is far easier to program correctly in

Re: Python vs C++

2014-08-22 Thread Chris Angelico
On Fri, Aug 22, 2014 at 6:05 PM, Christian Gollwitzer wrote: > I'm not even convinced that the development time is significantly lower in > Python within this overlap. It usually will be, though not always. ChrisA -- https://mail.python.org/mailman/listinfo/python-list

Re: Python vs C++

2014-08-22 Thread Christian Gollwitzer
Am 21.08.14 14:54, schrieb David Palao: I consider myself a python programmer, although C++ was one of the first languages I learned (not really deeply and long time ago). Now I decided to retake C++, to broaden my view of the business. However, as I progress in learning C++, I cannot take out o

Re: Python vs C++

2014-08-21 Thread Stefan Behnel
dieter schrieb am 22.08.2014 um 08:12: > David Palao writes: >> Why to use C++ instead of python? > > Likely, you would not use Python to implement most parts of an > operating system (where, for efficiency reasons, some parts > are even implemented in an assembler language). > > I can imagine t

Re: Python vs C++

2014-08-21 Thread Chris Angelico
On Fri, Aug 22, 2014 at 4:12 PM, dieter wrote: > Likely, you would not use Python to implement most parts of an > operating system (where, for efficiency reasons, some parts > are even implemented in an assembler language). > > I can imagine that the GNU compiler developers, too, had good > reason

Re: Python vs C++

2014-08-21 Thread dieter
David Palao writes: > Why to use C++ instead of python? Likely, you would not use Python to implement most parts of an operating system (where, for efficiency reasons, some parts are even implemented in an assembler language). I can imagine that the GNU compiler developers, too, had good reason

Re: Python vs C++

2014-08-21 Thread Chris Angelico
On Fri, Aug 22, 2014 at 4:05 AM, Joseph Martinot-Lagarde wrote: > For information, Cython works with C++ now: > http://docs.cython.org/src/userguide/wrapping_CPlusPlus.html. Now isn't that cool! Every time Cython gets discussed, I get a renewed desire to learn it. Trouble is, I don't have any pr

Re: Python vs C++

2014-08-21 Thread Joseph Martinot-Lagarde
Le 21/08/2014 15:40, Chris Angelico a écrit : On Thu, Aug 21, 2014 at 10:54 PM, David Palao wrote: Why to use C++ instead of python? This is, perhaps, a bit off-topic, but I really want to know the thoughts of experienced python programmers on it. No, it's a fair question. Why are we all her

Re: Python vs C++

2014-08-21 Thread Michael Torrie
On 08/21/2014 07:39 AM, Burak Arslan wrote: > For my day job, I chose Qt on C++ for a classic desktop app that needs > to be deployed on Windows (among other platforms) with an installation > package that is as small as possible. > > All I need to do deployment-wise is to create an NSIS script put

Re: Python vs C++

2014-08-21 Thread David Palao
Thank you for the interesting answers. Just a clarification. Actually for the scope of this question, I consider C and C++ quite different. At least when they are "properly" used (eg, you could use C++ as a better C, but this is not C++ in its full glory). In my opinion, if all that you want is pe

Re: Python vs C++

2014-08-21 Thread Grant Edwards
On 2014-08-21, David Palao wrote: > Why to use C++ instead of python? 1) C++ is the only language available for your platform, and for some reason you are unable to build Python from source. 2) You need money, and the only person willing to pay you says use C++ and won't listen to re

Re: Python vs C++

2014-08-21 Thread Rustom Mody
On Thursday, August 21, 2014 6:24:18 PM UTC+5:30, David Palao wrote: > Hello, > I consider myself a python programmer, although C++ was one of the > first languages I learned (not really deeply and long time ago). > Now I decided to retake C++, to broaden my view of the business. > However, as I p

Re: Python vs C++

2014-08-21 Thread Neil D. Cerutti
On 8/21/2014 8:54 AM, David Palao wrote: Hello, I consider myself a python programmer, although C++ was one of the first languages I learned (not really deeply and long time ago). Hey, that sounds just like me. Now I decided to retake C++, to broaden my view of the business. However, as I pro

Re: Python vs C++

2014-08-21 Thread Chris Angelico
On Thu, Aug 21, 2014 at 10:54 PM, David Palao wrote: > Why to use C++ instead of python? > > This is, perhaps, a bit off-topic, but I really want to know the > thoughts of experienced python programmers on it. No, it's a fair question. Why are we all here? The fact is, there's not a huge amount

Re: Python vs C++

2014-08-21 Thread Burak Arslan
On 08/21/14 15:54, David Palao wrote: > But I'm interested in a "genuine" > C++ project: some task where C++ is really THE language (and where > python is actually a bad ab initio choice) For my day job, I chose Qt on C++ for a classic desktop app that needs to be deployed on Windows (among other

Re: Python vs. C++11

2012-02-15 Thread Henrik Faber
On 15.02.2012 08:18, Tim Roberts wrote: > sturlamolden wrote: >> >> There are bigsimilarities between Python and the new C++ standard. Now >> we can actually use our experience as Python programmers to write >> fantastic C++ :-) > > This is more true than you might think. For quite a few years n

Re: Python vs. C++11

2012-02-14 Thread Tim Roberts
sturlamolden wrote: > >There are bigsimilarities between Python and the new C++ standard. Now >we can actually use our experience as Python programmers to write >fantastic C++ :-) This is more true than you might think. For quite a few years now, I've been able to do an almost line-for-line tran

Re: Python vs. C++11

2012-02-12 Thread sturlamolden
On Feb 13, 4:21 am, sturlamolden wrote: > There are bigsimilarities between Python and the new C++ standard. Now > we can actually use our experience as Python programmers to write > fantastic C++ :-) And of course the keyword 'auto', which means automatic type interence. -- http://mail.python.o

Re: Python vs C for a mail server

2006-02-05 Thread Magnus Lycka
John J. Lee wrote: > I guess the same is true of Python in some respects: it's still > incrementally changing (more than C++, I guess), and isn't all that > much younger than C++ (around 15 and 23 years old respectively). But C++ is almost entirely backwards compatible with C, which adds another d

Re: Python vs C for a mail server

2006-02-04 Thread John J. Lee
"Randall Parker" <[EMAIL PROTECTED]> writes: [...] > The code I'm writing in Python is a test executive to test embedded C > code. Then tests get written in Python that the test executive > processes. No, I'm not going to write yet another layer of tests in > order to compensate for shortcomings in

Re: Python vs C for a mail server

2006-02-04 Thread John J. Lee
"Randall Parker" <[EMAIL PROTECTED]> writes: [...] > Also, a lot of C++'s flaws flow from the fact that it is old and grew > in lots of increments. That was a deliberate decision on the part of C++'s designers!-) I guess the same is true of Python in some respects: it's still incrementally changi

Re: Python vs C for a mail server

2006-02-02 Thread Randall Parker
Magnus Lycka wrote: > Or...don't you have automated tests? Ouch. If you (like me) feel a > little lazy to write a lot of test scripts, you can use a test tool > such as TextTest, that compares output between test runs, rather than > forcing you to write lots of scripts with plenty of assertions.

Re: Python vs C for a mail server

2006-02-02 Thread Magnus Lycka
Randall Parker wrote: > Magnus Lycka wrote: > >>Randall Parker wrote: >> >>>Also, compile time errors get caught sooner. They get caught before >>>tests even get written. >> >>Not if you do Test Driven Tevelopment. Then you write >>the tests before you compile your target code! It's >>also my expe

Re: Python vs C for a mail server

2006-02-01 Thread Paul Rubin
Magnus Lycka <[EMAIL PROTECTED]> writes: > Sure, but on the other hand, you are really on your own when you > avoid the compile time type safety in C++. But it's almost impossible to avoid. Does *p point to a valid object, or to unallocated memory? C++ has no way to tell this at compile time. --

Re: Python vs C for a mail server

2006-02-01 Thread Donn Cave
In article <[EMAIL PROTECTED]>, "Randall Parker" <[EMAIL PROTECTED]> wrote: ... > More generally: One must keep in mind that advantages and disadvantages > of specific implementations of language concepts are not always > indications of flaws in those concepts. Sure. And of course, the nominal t

Re: Python vs C for a mail server

2006-02-01 Thread Randall Parker
Donn, More generally: One must keep in mind that advantages and disadvantages of specific implementations of language concepts are not always indications of flaws in those concepts. Real languages have real flaws from bad design choices which cause them to fall short of what those languages could

Re: Python vs C for a mail server

2006-02-01 Thread Paul Boddie
Magnus Lycka wrote: > In C++ it's the opposite. By demanding a particular type, we restrain > ourself to using a set of values which is much smaller than the logic > calls for, or we can throw away all type checks by e.g. casting to void > pointers. The main reason for evading the type system in s

Re: Python vs C for a mail server

2006-02-01 Thread Donn Cave
In article <[EMAIL PROTECTED]>, ... > Granted, it is a pain to change type declarations. I see it is time for the bi-monthly reminder that C++ is not the ideal example of strong static typing, unless you just want to make it look bad. Cf. Hindley-Milner type inference. Donn Cave, [EMAIL PROTE

Re: Python vs C for a mail server

2006-02-01 Thread Randall Parker
Magnus Lycka wrote: > Randall Parker wrote: > > Also, compile time errors get caught sooner. They get caught before > > tests even get written. > > Not if you do Test Driven Tevelopment. Then you write > the tests before you compile your target code! It's > also my experience that the write test -

Re: Python vs C for a mail server

2006-02-01 Thread Magnus Lycka
Jens Theisen wrote: > Jay wrote: >> How much time in your C/C++ code is spent casting and trying to >>trick the compiler into doing something that it thinks you shouldn't be >>doing? > > Not much frankly. Though I have no doubt that there is a lot of code that > does, but more so in older C++ co

Re: Python vs C for a mail server

2006-02-01 Thread Magnus Lycka
Jay Parlar wrote: > Well guess what: The *only* code you'll have to change is inside the > function returning the object, none of the callers would have to change. > That's completely different from C++, where you'll have to change not > only the return type and the function, but you'll also hav

Re: Python vs C for a mail server

2006-02-01 Thread Magnus Lycka
Randall Parker wrote: > Also, compile time errors get caught sooner. They get caught before > tests even get written. Not if you do Test Driven Tevelopment. Then you write the tests before you compile your target code! It's also my experience that the write test - write code - run test cycle in TD

Re: Python vs C for a mail server

2006-02-01 Thread Magnus Lycka
Randall Parker wrote: > I return objects in Python and in C++. In C++ I can see what their > types are right on the m method signature. In Python I've got to write > a comment on the line above it. Ouch! Don't do that! As you've noticed, it's not very maintainable. First of all, if you want to u

Re: Python vs C for a mail server

2006-02-01 Thread Magnus Lycka
Randall Parker wrote: > C++ provides ways to be type unsafe. Does that mean that C++ is type > unsafe period? Most code in C++ is going to be type safe. Some > programmers will never do dangerous casting. Others will do bad things > with casts. Sure, but on the other hand, you are really on your o

Re: Python vs C for a mail server

2006-01-31 Thread Randall Parker
But languages that share some weakness typically do not share it equally. Three languages can have some way to do X (which some might find undesirable while others find it great) but two of the languages might make it easy to solve problems without ever doing X while the third language might make i

Re: Python vs C for a mail server

2006-01-31 Thread Jens Theisen
Paul wrote: > Or should I be looking for some other context here? Three people were looking at the wrong one, thanks for putting this right. I really should not have given my point that briefly. Jens -- http://mail.python.org/mailman/listinfo/python-list

Re: Python vs C for a mail server

2006-01-31 Thread Jens Theisen
Jay wrote: > You can do both, but why? *Especially* in a language like C++, where > thanks to pointers and casting, there really isn't any type safety > anyway. How much time in your C/C++ code is spent casting and trying to > trick the compiler into doing something that it thinks you shouldn't be

Re: Python vs C for a mail server

2006-01-31 Thread Jay Parlar
Randall Parker wrote: > Alex Martelli wrote: > >> The "but without declaration it can't be self-documenting" issue is a >> red herring. Reading, e.g.: >> >> int zappolop(int frep) { ... >> >> gives me no _useful_ "self-documenting" information about the role and >> meaning of frep, or zappolop's

Re: Python vs C for a mail server

2006-01-31 Thread Peter Hansen
Randall Parker wrote: > The point of doing compile time and test time checking is the same > reason militaries use layered defenses: More problems get caught. I've > written tons of software tests and architected a testing system for an > entire aircraft. I've also watched lots of errors get by tes

Re: Python vs C for a mail server

2006-01-31 Thread Randall Parker
Jay, The point of doing compile time and test time checking is the same reason militaries use layered defenses: More problems get caught. I've written tons of software tests and architected a testing system for an entire aircraft. I've also watched lots of errors get by tests. Also, compile time

Re: Python vs C for a mail server

2006-01-31 Thread Randall Parker
Alex Martelli wrote: > The "but without declaration it can't be self-documenting" issue is a > red herring. Reading, e.g.: > > int zappolop(int frep) { ... > > gives me no _useful_ "self-documenting" information about the role and > meaning of frep, or zappolop's result. The code's author must o

Re: Python vs C for a mail server

2006-01-31 Thread Antoon Pardon
Op 2006-01-30, Magnus Lycka schreef <[EMAIL PROTECTED]>: > Donn Cave wrote: >> If we give him credit for having some idea of what he's talking about, >> then we could perhaps read his "encourages" as "makes trivially easy." >> These two languages are in such different levels with introspection >> t

Re: Python vs C for a mail server

2006-01-30 Thread Magnus Lycka
Donn Cave wrote: > If we give him credit for having some idea of what he's talking about, > then we could perhaps read his "encourages" as "makes trivially easy." > These two languages are in such different levels with introspection > that it seems kind of disingenuous to me to make this argument,

Re: Python vs C for a mail server

2006-01-30 Thread Steven D'Aprano
Volker Grabsch wrote: > Any programming language allows you to do strange/stupid stuff. But none > of them encourages it. One word: Intercal. :-) -- Steven. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python vs C for a mail server

2006-01-29 Thread Alex Martelli
Donn Cave <[EMAIL PROTECTED]> wrote: > Quoth [EMAIL PROTECTED] (Alex Martelli): > | ... Therefore, > | if the inability to verify that a function named 'foobar' is in fact > | never called anywhere is a weakness, it's a weakness shared by all of > | these languages. The originator of this thread

Re: Python vs C for a mail server

2006-01-29 Thread Donn Cave
Quoth [EMAIL PROTECTED] (Alex Martelli): | ... Therefore, | if the inability to verify that a function named 'foobar' is in fact | never called anywhere is a weakness, it's a weakness shared by all of | these languages. The originator of this thread appeared to assume that | it was a weakness of

Re: Python vs C for a mail server

2006-01-29 Thread Donn Cave
Quoth [EMAIL PROTECTED] (Alex Martelli): | Jens Theisen <[EMAIL PROTECTED]> wrote: ... |> What do you do when you want to no if a certain method or function is |> actually used from somewhere, say "foobar", it a language which allows |> (and even encourages) that it could be called by: |> |> getat

Re: Python vs C for a mail server

2006-01-29 Thread Paul Boddie
Jay Parlar wrote: [...] > >> getattr(obj "foo" + "bar")(). [...vs...] > > meth = getattr(self.visitor, 'visit' + className, 0) [...] > I don't think you understood my assertion, then. The example that the > original poster gave was using getattr() with a simple string ("foo" + > "bar") for th

Re: Python vs C for a mail server

2006-01-29 Thread Alex Martelli
Paul Boddie <[EMAIL PROTECTED]> wrote: ... > The context was whether you can know before running the program whether > the function you're attempting to call exists, along with where it is > defined. Obviously, it's a struggle to think of cases where one would > do this for the sake of it (espec

Re: Python vs C for a mail server

2006-01-29 Thread Paul Boddie
Fredrik Lundh wrote: > Paul Boddie wrote: > [Quoting Jay Parlar...] > > > I don't think I've ever seen anyone advocating calling a function like > > > getattr(obj "foo" + "bar")(). > > > > >From Lib/compiler/visitor.py: > > > > meth = getattr(self.visitor, 'visit' + className, 0) > > > > Later on

Re: Python vs C for a mail server

2006-01-29 Thread Alex Martelli
Jay Parlar <[EMAIL PROTECTED]> wrote: ... > >> From Lib/compiler/visitor.py: > > > > meth = getattr(self.visitor, 'visit' + className, 0) ... > I even said you can do some "very powerful things" with getattr, by > which I meant something exactly like you did. What did you think I > meant by

Re: Python vs C for a mail server

2006-01-29 Thread Jay Parlar
> Paul Boddie wrote: > >> I don't think I've ever seen anyone advocating calling a function like >> getattr(obj "foo" + "bar")(). > >> From Lib/compiler/visitor.py: > > meth = getattr(self.visitor, 'visit' + className, 0) > > Later on: > > meth(node, *args) > > Of course, you can drop the "visit" p

Re: Python vs C for a mail server

2006-01-29 Thread Volker Grabsch
Jens Theisen wrote: > What do you do when you want to no if a certain method or function is > actually used from somewhere, say "foobar", it a language which allows > (and even encourages) that it could be called by: > > getattr(obj, "foo" + "bar")() No. The recommended way to do it is:

Re: Python vs C for a mail server

2006-01-29 Thread Fredrik Lundh
Paul Boddie wrote: > > I don't think I've ever seen anyone advocating calling a function like > > getattr(obj "foo" + "bar")(). > > >From Lib/compiler/visitor.py: > > meth = getattr(self.visitor, 'visit' + className, 0) > > Later on: > > meth(node, *args) > > Of course, you can drop the "visit" pr

Re: Python vs C for a mail server

2006-01-29 Thread Paul Boddie
Jay Parlar wrote: > I don't think I've ever seen anyone advocating calling a function like > getattr(obj "foo" + "bar")(). >From Lib/compiler/visitor.py: meth = getattr(self.visitor, 'visit' + className, 0) Later on: meth(node, *args) Of course, you can drop the "visit" prefix and make the mec

Re: Python vs C for a mail server

2006-01-29 Thread Jim Segrave
In article <[EMAIL PROTECTED]>, Dan Lowe <[EMAIL PROTECTED]> wrote: > >On Jan 28, 2006, at 8:39 PM, Dennis Lee Bieber wrote: > >> On Sat, 28 Jan 2006 18:03:56 +1100, Steven D'Aprano said: >>> >>> Google is your friend. The first four mail servers listed are, in >>> order: >>> >>> sendmail >>> po

Re: Python vs C for a mail server

2006-01-29 Thread Jim Segrave
In article <[EMAIL PROTECTED]>, abhinav <[EMAIL PROTECTED]> wrote: >ya its supposed to be some stupid 6 month project which my friend has >to do.I am just helping him out.he may not be implementing a full >fledged rfc compliance mail server but may support some of the major >functionalities.so basi

  1   2   >