How do you feel ?

Discussion in 'Python' started by Sylvain Hellegouarch, Jun 14, 2004.

  1. 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
     
    Sylvain Hellegouarch, Jun 14, 2004
    #1
    1. Advertisements

  2. Sylvain Hellegouarch

    Cy Edmunds Guest

    I feel vaguely guilty, as if I were cheating somehow. Isn't programming
    supposed to hurt more than this?
     
    Cy Edmunds, Jun 14, 2004
    #2
    1. Advertisements

  3. Sylvain Hellegouarch

    David Fisher Guest

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

    Step 1. Code l33t application
    Step 3. Profit
     
    David Fisher, Jun 15, 2004
    #3
  4. Sylvain Hellegouarch

    David Fraser Guest

    Currently I feel hungry. I need to eat breakfast.

    David
     
    David Fraser, Jun 15, 2004
    #4
  5. I did not expect that one ^^

     
    Sylvain Hellegouarch, Jun 15, 2004
    #5
  6. 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 :)
     
    Sylvain Hellegouarch, Jun 15, 2004
    #6
  7. 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?
     
    Howard Stearns, Aug 7, 2004
    #7
  8. 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?
     
    Howard Stearns, Aug 7, 2004
    #8
  9. Sylvain Hellegouarch

    Peter Hansen Guest

    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
     
    Peter Hansen, Aug 7, 2004
    #9

  10. Oh, here you are! Just today, I have written a post which use your generic
    functions module in combination with decorators!
    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
     
    Michele Simionato, Aug 7, 2004
    #10
  11. Sylvain Hellegouarch

    AdSR Guest

    Not at all, in my view.
    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.
    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.
    Same here.
    Like I said, it's no spam at all.
    Same from me,

    AdSR
     
    AdSR, Aug 7, 2004
    #11
  12. Sylvain Hellegouarch

    Neuruss Guest

    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!
     
    Neuruss, Aug 8, 2004
    #12
  13. 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.)
     
    Howard Stearns, Aug 9, 2004
    #13
  14. Sylvain Hellegouarch

    AdSR Guest

    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
     
    AdSR, Aug 9, 2004
    #14
  15. Maybe this is what you mean:

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

    This works just fine.

    -Scott David Daniels
     
    Scott David Daniels, Aug 25, 2004
    #15
  16. 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_...?
    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
     
    Alex Martelli, Aug 26, 2004
    #16
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.