Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I have never once seen anything approaching obfuscation in any "serious" Python code.


Depends on what you consider obfuscation. Consider the following python code:

  a.b = c
In isolation, there is really no way to tell what that line of code will do. Maybe it will simply assign c to a.b. But because Python has property setters, it might also update some rows in a database[1], write a file, or make an HTTP request.

One might call that abstraction, but I think it qualifies as obfuscation. A single line can invoke arbitrary behaviour.

[1] This is how SQLAlchemy's models work. As I write this, the library is nearing it's 10,000th commit. A serious piece of software!


> A single line can invoke arbitrary behaviour.

Isn't that true of any language with even the simplest mechanism for abstraction?

How about this go code?

    doStuff(1, 2)
It could "update some rows in a database, write a file, or make an HTTP request."


I think that's fundementally different, you know you're calling a function there.

An example in golang would be something like:

    type foo struct {
        a    string
        b    int
        c    *someOtherStruct
    }
    var blah = foo{"example", 42, nil}
    blah.b = someMagicVariable


Sounds like your issue is with operator overloading. The same can be done in C++ and any other language with operator overloading.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: