How do you feel ?

  • Thread starter Sylvain Hellegouarch
  • Start date
S

Sylvain Hellegouarch

Hi,

A bit off topic.

I just wondered what was your feeling when you were coding with Python.
I have beebn coding with different languages and the only that has given
me the will to invent or to be creative has been Python. Python allows
me not to focus on the complexity of the language itself.

Of course, from time to time, I find something that is not clear to me
but indeed after a couple of research you find the information you were
looking for.

I love that language and above all, I love using it.

Sorry for this little spam but it is always good to acknowledge good
things and not only complaining when it doesn't work.

Thanks the Python team.
- Sylvain
 
C

Cy Edmunds

Sylvain Hellegouarch said:
Hi,

A bit off topic.

I just wondered what was your feeling when you were coding with Python.
I have beebn coding with different languages and the only that has given
me the will to invent or to be creative has been Python. Python allows
me not to focus on the complexity of the language itself.

Of course, from time to time, I find something that is not clear to me
but indeed after a couple of research you find the information you were
looking for.

I love that language and above all, I love using it.

Sorry for this little spam but it is always good to acknowledge good
things and not only complaining when it doesn't work.

Thanks the Python team.
- Sylvain

I feel vaguely guilty, as if I were cheating somehow. Isn't programming
supposed to hurt more than this?
 
D

David Fisher

Sylvain Hellegouarch said:
Hi,

A bit off topic.

I just wondered what was your feeling when you were coding with
Python. I have beebn coding with different languages and the only
that has given me the will to invent or to be creative has been
Python. Python allows me not to focus on the complexity of the
language itself.

Of course, from time to time, I find something that is not clear to
me but indeed after a couple of research you find the information
you were looking for.

I love that language and above all, I love using it.

Sorry for this little spam but it is always good to acknowledge good
things and not only complaining when it doesn't work.

Thanks the Python team. - Sylvain

I get a little giddy quite often. I start to think, "I can code anything!"

Step 1. Code l33t application
Step 3. Profit
 
D

David Fraser

Sylvain said:
Hi,

A bit off topic.

I just wondered what was your feeling when you were coding with Python.
I have beebn coding with different languages and the only that has given
me the will to invent or to be creative has been Python. Python allows
me not to focus on the complexity of the language itself.

Currently I feel hungry. I need to eat breakfast.

David
 
S

Sylvain Hellegouarch

Yeah I know what you mean, I've been programming C for a long time and
since I've been coding with Python, I feel free but also guilty to enjoy
so much coding whereas coding in C was more ... hmmm painful :)
 
H

Howard Stearns

I'm a dyed-in-the-wool Lisp programmer by history, but not for pay these
days. I'm trying Python for a nights-and-weekends project. And every time
I use it, I tell my wife (a technically savy non-programmer) that "hey,
this Python stuff really isn't bad. It's.... well..., pretty good."

Of course, the first thing I did was re-implement generic functions. But
other than that, I'm must using the libraries. They're good. I'm having
fun again!

The one thing I've found annoying is that I haven't yet discovered how to
do whatever I want in lambda expressions. I have top-level assignments
where I'd like create a function to use as the the value being assigned. I
don't know how to define a named function in a top-level assignment, and a
lambda won't allow me to use 'try' and other statements -- just
expressions. Or am I looking at things wrong?
 
H

Howard Stearns

I'm a dyed-in-the-wool Lisp programmer by history, but not for pay these
days. I'm trying Python for a nights-and-weekends project. And every time
I use it, I tell my wife (a technically savy non-programmer) that "hey,
this Python stuff really isn't bad. It's.... well..., pretty good."

Of course, the first thing I did was re-implement generic functions. But
other than that, I'm must using the libraries. They're good. I'm having
fun again!

The one thing I've found annoying is that I haven't yet discovered how to
do whatever I want in lambda expressions. I have top-level assignments
where I'd like create a function to use as the the value being assigned. I
don't know how to define a named function in a top-level assignment, and a
lambda won't allow me to use 'try' and other statements -- just
expressions. Or am I looking at things wrong?
 
P

Peter Hansen

Howard said:
The one thing I've found annoying is that I haven't yet discovered how
to do whatever I want in lambda expressions. I have top-level
assignments where I'd like create a function to use as the the value
being assigned. I don't know how to define a named function in a
top-level assignment, and a lambda won't allow me to use 'try' and other
statements -- just expressions. Or am I looking at things wrong?

What do you mean by "top-level assignment"? If it's the same
meaning most Python programmers would give it, you just do this:

def somefunc():
pass

topLevelName = somefunc

There's your top-level assignment of a named function. Probably
not what you meant, but can you clarify please?

-Peter
 
M

Michele Simionato

Howard Stearns said:
Of course, the first thing I did was re-implement generic functions. But
other than that, I'm must using the libraries. They're good. I'm having
fun again!


Oh, here you are! Just today, I have written a post which use your generic
functions module in combination with decorators!
The one thing I've found annoying is that I haven't yet discovered how to
do whatever I want in lambda expressions. I have top-level assignments
where I'd like create a function to use as the the value being assigned. I
don't know how to define a named function in a top-level assignment, and a
lambda won't allow me to use 'try' and other statements -- just
expressions. Or am I looking at things wrong?

You cannot use "lambda" as you would do in Lisp; you must use named
functions. Fortunately, decorators help a bit (see my post on generic functions).

Michele Simionato
 
A

AdSR

Sylvain said:
Hi,

A bit off topic.

Not at all, in my view.
I just wondered what was your feeling when you were coding with Python.
I have beebn coding with different languages and the only that has given
me the will to invent or to be creative has been Python. Python allows
me not to focus on the complexity of the language itself.

It's a lot of fun, rewarding, often giving instant gratification. I
can do some pretty complex stuff (at least from my point of view) in
short time, do it right and complete. I did some programming for fun
in C++ and Java, but only very simple tasks, worse and not really
better.

It's useful. I can do helper tools that I could live without but that
make my (professional or private) life easier.

It's interesting. I can learn new (to me) programming concepts, like
function currying. I tried to learn Perl, and after one useful script
done in five days, never got back to it. I tried Common Lisp, but
online tutorials are very basic, and online reference is hard to
navigate; I still don't know what "#" and "," mean. I tried Smalltalk
and loved it - it's approach to OO complements Python's in a very cool
way - but I'd need something better integrated with the system than
Squeak is.

I repeat, above all, it's a lot of fun.
Of course, from time to time, I find something that is not clear to me
but indeed after a couple of research you find the information you were
looking for.

Yeah, sometimes you have to dig for it, like I had for the way to do
multiple keystroke bindings in Tkinter for the DiacriticalEditor
(http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/286155;
shameless self-advertisement), but chances are you'll find it or
someone on c.l.py will tell you.
I love that language and above all, I love using it.

Same here.
Sorry for this little spam but it is always good to acknowledge good
things and not only complaining when it doesn't work.

Like I said, it's no spam at all.
Thanks the Python team.

Same from me,

AdSR
 
N

Neuruss

I'll try to explain in my poor English how I feel: WORRIED.
I don't know what's gong on with me, but since I started learning
programing with Python, I'm experiencing some strange behaviors that
are seriously affecting my social life, my work, and my view of the
world surrounding me...

It's addictive! I just can't stop thinking in terms of objects and
functions for the most silly things that come up in my head!
I used to have erotic dreams, but now, I just dream about a clean idle
window where I can start coding solutions for problems that I never
had...

It's getting worse and worse... I wonder if there is some kind of help
group, like Alcoholics Anonymous or something like that.
If there's someone with the same symptoms that wants to share its pain
with me, please write.
I'm shure we're more than one!
 
H

Howard Stearns

Sorry. When I said "define a named function in a top-level assignment", I
didn't just mean using a reference to a previously defined function (i.e.,
it's name), I meant actually defining the function in the assignment.

If you haven't done this sort of thing for years, I could see it being
hard to imagine why I would want to do this. After all, isn't the code
clearer if we define the function with a name ahead of time? And doesn't
the debugger work better with functions that have a name?

Well, I agree with this for what might be called middle-ground uses.
However, I do a lot of work with very simple cases and very complicated ones.

In very simple cases, the code is more cluttered if I have to define the
function separately. Now, when the function is simple, Python let's me
define an anonymous function in the assignment. That's cool. But I also
have cases where the assignment is simple, but maybe the function isn't.
This came up for me when I tried to populate generic functions with
methods. (See generic functions thread. Though it looks like decorators
will soon help me out here...)

In very complex cases, I lament the shear distance between the function
definition and the one place in the code where it is referenced. (Again,
maybe decorators will help. Cool.)
 
A

AdSR

<snip>
I tried Common Lisp, but
online tutorials are very basic, and online reference is hard to
navigate; I still don't know what "#" and "," mean.
<snip>

A short update after a few nice people sent me some helpful info:
Common Lisp is an impressively powerful language, but I still prefer
Python's straightforwardness and its more practical (think re, xml,
Tkinter modules) standard library. It fits my brain and my job better.

An interesting comparison, if you want to check it for yourself, is
one between the unittest module and what is described on this page:

http://www.gigamonkeys.com/book/practical-building-a-unit-test-framework.html

Both approaches are based on commonly used features and coding style
of their respective languages. I think this is good example of how
language vs. language comparisons should be done.

AdSR
 
S

Scott David Daniels

Howard said:
Sorry. When I said "define a named function in a top-level assignment",
I didn't just mean using a reference to a previously defined function
(i.e., it's name), I meant actually defining the function in the
assignment.

If you haven't done this sort of thing for years, I could see it being
hard to imagine why I would want to do this. After all, isn't the code
clearer if we define the function with a name ahead of time? And doesn't
the debugger work better with functions that have a name?

Well, I agree with this for what might be called middle-ground uses.
However, I do a lot of work with very simple cases and very complicated
ones.

In very simple cases, the code is more cluttered if I have to define the
function separately. Now, when the function is simple, Python let's me
define an anonymous function in the assignment. That's cool. But I also
have cases where the assignment is simple, but maybe the function isn't.
This came up for me when I tried to populate generic functions with
methods. (See generic functions thread. Though it looks like decorators
will soon help me out here...)

In very complex cases, I lament the shear distance between the function
definition and the one place in the code where it is referenced. (Again,
maybe decorators will help. Cool.)
Maybe this is what you mean:

def dodef(val):
global globfunc
def globfunc(other):
return val, other

This works just fine.

-Scott David Daniels
(e-mail address removed)
 
A

Alex Martelli

Scott David Daniels said:
Howard Stearns wrote: ...

If you (Howard) mean horrors such as
foo = lambda x: x + 23
the Pythonic way is
def foo(x): return x + 23
with absolutely identical results.


What distance? Put the def right before that 'one place in the code',
zero distance.

You sure do appear to ignore the equivalence between 'foo = lambda ...'
and def foo( ...'. What do you think def _does_...?
Maybe this is what you mean:

def dodef(val):
global globfunc
def globfunc(other):
return val, other

This works just fine.

It works, sort of, but each call to dodef steps right over the previous
value of global globfunc, and I think that may lead to nasty bugs. I
much prefer the style:

def dodef(val):
def anyfunc(other): return val, other
return anyfunc

and if the caller wants to assign this function to name 'foofunc', it's
the caller's job to say

foofunc = dodef(23)


I think this is much more transparent and thus less error-prone.


Alex
 

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,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top