lear
that you know the difference. Sorry for the confusion.
--
Tim Rowe
--
http://mail.python.org/mailman/listinfo/python-list
:
int
frodo()
{
int rval = 0;
if ((bilbo() == 0) || (gandalf() == 0)
{
/* lot's of code here */
}
else rval = -1;
return rval;
}
I'd be inclined to do it that way even if multiple exits were allowed;
it just seems so much clearer.
--
Tim Rowe
--
http://mail.python.org/mailman/listinfo/python-list
top of that. Most Ada MS Windows thick wrappers (ie, ones that feel
natural to Ada) are built on top of Win32Ada, which stays as close to
the underlying C interface as it can.
--
Tim Rowe
--
http://mail.python.org/mailman/listinfo/python-list
2009/5/6 Dennis Lee Bieber :
> (the "near" is because I feel Ada is
> stricter than any other language)
Try SPARK -- it's Ada based, but /much/ stricter. It's just right for
some really critical stuff, but is no sort of an answer to "Which one
is best Python or Jav
;t a folder -- the relevant folder would have been
C:\\Documents and Settings\\All Users\\Start
Menu\\Programs\\Programming\\Python 2.5'
but the installer never gave me the chance to choose that.
That woudn't stop me running Pythonw directly from the folder in which
it's installed,
e somewhere the fact that the pywin
installer assumes a particular structure for the start menu, and fails
to install shortcuts if it doesn't find that structure? I'm used to
programs asking me where they want to put the shortcuts, and creating
folders if they don't find them (creating *wi
t;
> msiexec /i 'ProgramMenuFolder=C:\Documents and Settings\All
> Users\StartMenu\Programs\Programming'
Thanks, that looks like just what I need.
--
Tim Rowe
--
http://mail.python.org/mailman/listinfo/python-list
at the compromises that are appropriate choices for one task are
inappropriate for another. Python is a great tool. So is C#. You /can/
do the same job with either, but the smart move is to choose the one
that is best adapted to the task in hand.
--
Tim Rowe
--
http://mail.python.org/mailman/listinfo/python-list
ith less sand and more dirt.
--
Tim Rowe
--
http://mail.python.org/mailman/listinfo/python-list
ot;999 over there","zip":"5"},
> ]
I think I'd make a class with members name, address, zip, etc. Then
make a list of instances of that class or (better for access) identify
a primary key -- what *is* unique about each entry -- and use that as
a dictionary key with class instances as values. Or use a DBMS.
Certainly the original poster should read up on database design, or
chances are he'll have a nightmare maintaining referential integrity.
--
Tim Rowe
--
http://mail.python.org/mailman/listinfo/python-list
ded to be instantiated. Instead of
>>>> using the class to creating an instance and then operate on it, I use
>>>> the class directly, with classmethods. Essentially, the class is used
>>>> as a function that keeps state from one call to the next.
Sounds to me
for
it (probably what led people off onto the sidetrack of thinking a
singleton was called for). That's the classic way of implementing a
"class [to be] used as a function".
--
Tim Rowe
--
http://mail.python.org/mailman/listinfo/python-list
includes everything
required to do OO. But maybe the original blogger meant by "fully OO"
what I mean by "Pure OO"?
The question I usually ask is "Does this language help me get the job
done?" Python often does. That's all that really matters, isn't it?
--
Tim Rowe
--
http://mail.python.org/mailman/listinfo/python-list
27;t open this
>> file"),
>
> Arrghll ! NO, DONT !
Can I put in a vote *for* the questioner's library dumping to
sys.exit() on any abnormal condition? It would reduce employment
competition for the rest of us.
Why, yes, I am wearing my BOFH hat. How could you tell?
--
Tim Rowe
--
http://mail.python.org/mailman/listinfo/python-list
print a < this does actually print a = 20
I'm surprised it runs at all -- as far as I can see "mod" in
"mod.update(a)" and "print mod.a" is not defined. Did you mean "mod1"?
If I change it to that, both print statements print "20" as
are the
problem is due to a typo or some such (happens to us all!) but without
seeing the actual code there's not a lot we can do.
--
Tim Rowe
--
http://mail.python.org/mailman/listinfo/python-list
]
Each element in the result is the state of the parameters followed by
the result of the function.
I stress that this is quick and dirty -- I'm sure somebody will be
along with something better soon!
--
Tim Rowe
--
http://mail.python.org/mailman/listinfo/python-list
n't see them as
being the fault of python-list which seems to do a pretty good job of
blocking them
--
Tim Rowe
--
http://mail.python.org/mailman/listinfo/python-list
;. Before now I've struggled for ages to write a
Python program to do a job, then when I've tried C# all the problems
have fallen away and the job was done in an hour or so. But other
times it has been the other way around; I've done stuff in Python that
I wouldn't know where to begi
urse I think I'm right!) because Python aims to be platform
independent, and whilst that means gains in portability it means that
in return it loses the ease-of-programming of a tightly integrated
platform.
--
Tim Rowe
--
http://mail.python.org/mailman/listinfo/python-list
critical systems. I don't
think formal proof of program behaviour would be at all
straightforward in Python (or C# for that matter, and although Spec#
gets closer, it really needs a language like Spark Ada).
--
Tim Rowe
--
http://mail.python.org/mailman/listinfo/python-list
n me off C# but
last time I looked it wasn't close. Maybe I should take another look
and see how it's coming on.
--
Tim Rowe
--
http://mail.python.org/mailman/listinfo/python-list
far as I am concerned
because I don't actually touch most of the GUI code. There could
actually be hundreds of parameters, for all I care. They're not my
concern. Most of the time I like that -- the tools are doing my work
for me.
--
Tim Rowe
--
http://mail.python.org/mailman/listinfo/python-list
> no clue. Very tongue in cheek.)
If you see C# as being in any way related to VB, it's no wonder you're
down on it!
> Python has a lot of things C# doesn't. Can we agree on that?
And C# has things that Python doesn't (such as static typing). Can we
agree on that, too?
--
Tim Rowe
--
http://mail.python.org/mailman/listinfo/python-list
r? Or do you pick the tool that does the
job in hand most effectively?
--
Tim Rowe
--
http://mail.python.org/mailman/listinfo/python-list
2008/9/29 Roy Smith <[EMAIL PROTECTED]>:
> That being said, the "one class per file" rule is a means to an end.
Although in some languages, the "end" is "code that runs". But Python
is not Java...
--
Tim Rowe
--
http://mail.python.org/mailman/listinfo/python-list
uot;of the string" after).
Post modification in noun phrases has been measured to be much less
frequent in spoken English than in written English, and it gets
progressively more common as the writing style gets more formal. That
suggests that "the string's length" is an easier phrase to produce and
understand, but "the length of the string" sounds more official.
--
Tim Rowe
--
http://mail.python.org/mailman/listinfo/python-list
to descend Y from X. Your present design is wrong, plain and
simple. Working around it won't fix that.
--
Tim Rowe
--
http://mail.python.org/mailman/listinfo/python-list
> ... Unless, there is some corresponding distinction in mechanics
> between speaking and writing. That is, if something about the process
> of generating writing makes it, post-modification, easier. I'm going
> to assume that it's been observed across all modes of writing too, (in
> addition to
a fucking idiot...
> motherfucking aggresive
> it's just few of priest fuckheads
> look at lojban's motherfucking idiotic logo
If you really knew anything about social function you would be able to
work out why people think you are a troll.
--
Tim Rowe
--
http://mail.python.org/mailman/listinfo/python-list
gt; And I know somebody, in other languages, thinks it's
> a Best Practice to avoid using exceptions for flow control.
>
> Thankfully, python programmers are less dogmatic, and use whatever makes
> sense to use. I hope.
Absolutely. And it doesn't make sense to use exceptions for flow control :-)
--
Tim Rowe
--
http://mail.python.org/mailman/listinfo/python-list
eption )
And with enough static analysis to guarantee that the break will be
reached? I think it would be a bit much to expect Python to solve the
halting problem!
--
Tim Rowe
--
http://mail.python.org/mailman/listinfo/python-list
cannot decrease indefinitely, if you can define
a loop variant then you gurantee that the loop will terminate.
Even if you are not being formal, just considering what the loop
variants and invariants can save no end of trouble with tricky loops.
--
Tim Rowe
--
http://mail.python.org/mailman/listinfo/python-list
2009/10/11 Philip Semanchuk :
> IMHO, break, goto, etc. have their place, but they're ripe for abuse which
> leads to spaghetti code.
Unrestricted goto can leat to spaghetti code, but surely break can't?
AFAICS, any break construct will still be H-K reducible.
--
T
ry, not merely the only clean way to exit.
--
Tim Rowe
--
http://mail.python.org/mailman/listinfo/python-list
ppened that shouldn't have". If one uses it when something has
happened that *should* have, because it happens to have the right
behaviour (even if the overhead doesn't matter), then one is
misrepresenting the program logic.
--
Tim Rowe
--
http://mail.python.org/mailman/listinfo/python-list
propriate. Same with warnings; they
*probably* shouldn't happen but only the application programmer can
know whether they should or not.
The point is that an exception causes a change in program flow, so of
course they're used for flow control. It's what they do. The question
is in wh
But my point remains that the authors of index
can't know whether the item not being in the list is an error or not,
can't know how to handle that case, and so passing it to the client as
an exception is an appropriate response.
> No, it's not being killed from outside the program -- it's being
> *interrupted* from *inside* the program by the user.
Who -- unless AI has advanced further than I thought -- is *outside*
the program.
--
Tim Rowe
--
http://mail.python.org/mailman/listinfo/python-list
ctfully suggest that in *all* cases you do whatever is
*clearest*, then switch to the other one if and only if performance is
unacceptable *and* profiling reveals this to be the bottleneck? That
avoids your deadlock (or is it livelock?) state.
--
Tim Rowe
--
http://mail.python.org/mailman/listinfo/python-list
The hostility you've
received to that idea is saddening, and indicative of why there's so
much buggy software out there.
--
Tim Rowe
--
http://mail.python.org/mailman/listinfo/python-list
fostering good habits for the rest of their careers.
Any hostility from the OP seems to be a response to the persistent
refusal to accept his assurances that he is not using the assertions
for run-time error checking, nor teaching the students to do that,
--
Tim Rowe
--
http://mail.python.org/mailman/listinfo/python-list
are that you *don't* care about correctness.
You *know* the input is often wrong, but you're not bothering to check
it?
--
Tim Rowe
--
http://mail.python.org/mailman/listinfo/python-list
a
classic from a programming guru of old. An automatic checker that just
checks that the comment exists without understanding its contents
simply is not adding value but is rather petty bureaucracy that will
annoy the programmers.
--
Tim Rowe
--
http://mail.python.org/mailman/listinfo/python-list
but if they're any use at all
in the production run-time then there's something wrong with your
development and testing processes.
--
Tim Rowe
--
http://mail.python.org/mailman/listinfo/python-list
in Ada. I shall now enter a period of self-refelection to
try to work out why I am so inconsistent :-)
--
Tim Rowe
--
http://mail.python.org/mailman/listinfo/python-list
builds *very* heavily on the concept of dictionaries it's not obscure
at all!
--
Tim Rowe
--
http://mail.python.org/mailman/listinfo/python-list
or me.
That and the fact that I couldn't stop laughing for long enough to
learn any more when I read in the Pragmatic Programmer's Guide that
"Ruby, unlike less flexible languages, lets you alter the value of a
constant." Yep, as they say "Bug" = "Undocumented feature"!
--
Tim Rowe
--
http://mail.python.org/mailman/listinfo/python-list
2009/7/30 superpollo :
> Tim Rowe wrote:
>> Any language that gets any sort of real use has to have. For instance,
>> I love Ada's numeric types (you can specify either the minimum number
>> of significant figures or the maximum delta for a real type, and it
>> wil
2009/7/31 Steven D'Aprano :
> On Thu, 30 Jul 2009 18:47:04 +0100, Tim Rowe wrote:
>
>> That and the fact that I couldn't stop laughing for long enough to learn
>> any more when I read in the Pragmatic Programmer's Guide that "Ruby,
>> unlike less flexi
er with tentacles and fangs, that my language doesn't
have a word for and that I have never seen. On your theory, how come I
am thinking about it?
--
Tim Rowe
--
http://mail.python.org/mailman/listinfo/python-list
I was only 3 when it was released.
--
Tim Rowe
--
http://mail.python.org/mailman/listinfo/python-list
u lose compiler checks. That's the right balance for
a lot of applications, but not for all. If it's really critical that
the program be correct then you'll want a bondage-and-discipline
language that does masses of check, you might even do separate static
analysis, and you'll *st
101 - 152 of 152 matches
Mail list logo