Live data from Hacker News

Obfuscating “Hello World” in Python

benkurtovic.com

21–30 of 59 posts

Re: Obfuscating “Hello World” in Python

#21

I still have problems fathoming how Python managed to get such a big mindshare within the developer community with its icky syntax and forced use of whitespace. What makes it good? I have looked into the alternatives and they all seem to be better.

I had to +1 this although I disagree. I really am disappointed that people downvote someone for expressing their opinion.

Let me answer your question, though. Why is it good? It's not good. I hate it. But that's the case with everything you have either used too little or too much. And I try to use Python for everything, which is always a bad idea. But I will continue to use it, because using Python I can express myself more clearly than with Java, C, PHP, Bash, or AWK. The reason might be that I simply know more about than about the other languages. But I get fast results, I can change them fast, I can deploy packages in it that you can use 1 second after I uploaded it, if I get a strange exception I just look into the source code of that project (source code packages yeah!) change it just on my system to what I was expecting, then think about patching my code or submitting a patch to that other project. I really love how I can put a 200 line Java program into a single line of Python and still have readable code, actually more readable than 200 lines of any language. And it's the only language I can still read if a Java programmer or a C programmer without much Python domain knowledge has written some code. It's also the only language where I can read the interpreter source code without much trouble, because they used Macros and functions to make it look a little like Python code, although it's C. Also I hear from people who code Ruby and Python that Python is the more stable of the two brothers, which I like. I'm not that much into experimenting.

So why do I use it? It makes me more productive because it matches my style of developing. Is it better than most other languages? Probably not, it has it's pros and cons. If your target project is in the middle between stable and experiment use Python. If your balance for optimization leans towards maintainability instead of execution speed use Python. If you love a few of the projects like Django and the community use Python. Otherwise you might be more happy with someone else.

Re: Obfuscating “Hello World” in Python

#22
post #17

I still have problems fathoming how Python managed to get such a big mindshare within the developer community with its icky syntax and forced use of whitespace. What makes it good? I have looked into the alternatives and they all seem to be better.

I will never understand the whitespace complaint. Any code you read in python will follow standardized indenting, by necessity. Why on earth is that a problem?

Yeah, I also don't get that. My Python code even has the same indentation as my Java code in university had. I just don't have to spell out the ; and the {}. But in the beginning it was really tough, especially because my eyes were trained to structuring code by {}. I think it's mostly a question about if you want to put in the effort to retrain your instincts or not.

Re: Obfuscating “Hello World” in Python

#23
post #7

I still have problems fathoming how Python managed to get such a big mindshare within the developer community with its icky syntax and forced use of whitespace. What makes it good? I have looked into the alternatives and they all seem to be better.

It has a very feature rich library. You can build relatively big applications with lots of features in a very short time.

I'm not so sure if that still applies. Since the troubles in the packaging department in 2009-2013 I feel we are lacking behind other languages. Nowadays with fast internet, experienced packaging tool developers, etc, new languages like Go are fast to provide an infrastructure as good as ours or in some regards maybe even better. Some libraries are also itchy because they are written in C or Java style and not in Python style, yet they are in the stdlib. Not even the BDFL likes the stdlib that much any more. Python has a lot of cool features, that's why I will continue to use it. But the library is not the selling point any more, imho.

Re: Obfuscating “Hello World” in Python

#24
post #21

I still have problems fathoming how Python managed to get such a big mindshare within the developer community with its icky syntax and forced use of whitespace. What makes it good? I have looked into the alternatives and they all seem to be better.

I had to +1 this although I disagree. I really am disappointed that people downvote someone for expressing their opinion. Let me answer your question, though. Why is it good? It's not good. I hate it. But that's the case with everything you have either used too little or too much. And I try to use Python for everything, which is always a bad idea. But I will continue to use it, because using Python I can express myse…

GP is not just expressing an opinion, they're expressing it in a fashion so destructive that it seems likely to be a deliberate troll. "icky syntax" is an opinion that the author should have known was unpopular, expressed aggressively as though it were a widely recognized fact. "I have looked into the alternatives and they all seem to be better" provides zero information and just fans the flames; someone trying to be constructive would mention specific alternatives and specific things they thought was better about them.

Re: Obfuscating “Hello World” in Python

#25
post #17

I still have problems fathoming how Python managed to get such a big mindshare within the developer community with its icky syntax and forced use of whitespace. What makes it good? I have looked into the alternatives and they all seem to be better.

I will never understand the whitespace complaint. Any code you read in python will follow standardized indenting, by necessity. Why on earth is that a problem?

Specially given that Python isn't the only language that does it.

Re: Obfuscating “Hello World” in Python

#26
post #22
post #17

Earlier quoted context omitted.

I will never understand the whitespace complaint. Any code you read in python will follow standardized indenting, by necessity. Why on earth is that a problem?

Yeah, I also don't get that. My Python code even has the same indentation as my Java code in university had. I just don't have to spell out the ; and the {}. But in the beginning it was really tough, especially because my eyes were trained to structuring code by {}. I think it's mostly a question about if you want to put in the effort to retrain your instincts or not.

I prefer having to add the {}'s and ;'s, even if the spacing is the same, because they provide a clear and definite bound on scoping, which (unfortunately) often gets messed up in Python.

Re: Obfuscating “Hello World” in Python

#27
post #24
post #21

Earlier quoted context omitted.

I had to +1 this although I disagree. I really am disappointed that people downvote someone for expressing their opinion. Let me answer your question, though. Why is it good? It's not good. I hate it. But that's the case with everything you have either used too little or too much. And I try to use Python for everything, which is always a bad idea. But I will continue to use it, because using Python I can express myse…

GP is not just expressing an opinion, they're expressing it in a fashion so destructive that it seems likely to be a deliberate troll. "icky syntax" is an opinion that the author should have known was unpopular, expressed aggressively as though it were a widely recognized fact. "I have looked into the alternatives and they all seem to be better" provides zero information and just fans the flames; someone trying to be…

Questions don't have to be polite, well-formed, or sensible. That is required of answers.

Re: Obfuscating “Hello World” in Python

#28

   707974686f6e202d632022657865632027654a7a56556b7475677a41553350735543436b79534e5145516b685378425771536c6d474c427877695657444c6474526b70362b7a39685a396741566b682b654764356e486e78535574744938663562734f796d686543584d704f6d3057306378346c516177524867593759574d336e45534e56497670424b614162514a6e7071574b41566f6765635266443278597462413273656e354a5056454c364d3778757531693936794d6a344476766671415271666f5976355851797654384e6244524567366d45536e44542b747a366669334f71475056676642546d424b4257624533793156706e33504e6630546b5a757237634c3665575530356b62772f494a42684951714c464d68787452543577537a656951704932436b5732455077576a686b563379693068424466534546644f714153624b3837383864626a7a4b644965456f47317375425151507367644f3069354571316e37536f6c694d59624d5467414646365a7a35676237645a524e4546526f396359484b6465576f3447745276367a434b344f587a4c7641374a664d767254373475426c495957546c71474a736f44386756354b4c32515a79493276674e325162754656774c63423977743054423259585744366158427757477035654533686245427134366f542b4b2f2b37795a2f4166437a2b6b413d272e6465636f6465282762617365363427292e6465636f646528277a6c6962272922

Re: Obfuscating “Hello World” in Python

#29
post #17

I still have problems fathoming how Python managed to get such a big mindshare within the developer community with its icky syntax and forced use of whitespace. What makes it good? I have looked into the alternatives and they all seem to be better.

I will never understand the whitespace complaint. Any code you read in python will follow standardized indenting, by necessity. Why on earth is that a problem?

Easy: because there are people who mistake being used to something for it being good. Also because people know too few different styles of syntaxes and are not required to learn more of them (let's do everything in X! from microcontrollers to OSes!), which makes them inflexible.

Syntax matters, but not in the way most people think it does. Syntax should be judged based on how well it supports semantics of a given language and not based on how "pretty" it is. EDIT: I should probably add that Python syntax matches its semantics and intended usage rather well; for an example of a conflict between syntax and semantics look at JavaScript.

Re: Obfuscating “Hello World” in Python

#30
post #27
post #24

Earlier quoted context omitted.

GP is not just expressing an opinion, they're expressing it in a fashion so destructive that it seems likely to be a deliberate troll. "icky syntax" is an opinion that the author should have known was unpopular, expressed aggressively as though it were a widely recognized fact. "I have looked into the alternatives and they all seem to be better" provides zero information and just fans the flames; someone trying to be…

Questions don't have to be polite, well-formed, or sensible. That is required of answers.

Says who? There's no rule against downvoting bad questions, nor should there be.
Post reply on HN