Welcome to HBH! If you had an account on hellboundhacker.org you will need to reset your password using the Lost Password system before you will be able to login.

Python: Is there something I'm missing?


ghost's Avatar
0 0

I decided to see what python was about. I downloaded a development environment, and then started playing. At first glance, I noticed there are no switch statements in python. This seems pretty shitty since they already had three major releases. Ok, that’s crap, but maybe there is a workaround that I’m not aware of.

Later on when I ran my newly created newbie script, I noticed something about indentions! WTF is that all about?

Given that I’ve only looked over the language for a few hours. Obviously, I could have missed out on a lot of good with the language, but I would like other people’s opinion. What is your take on the language?


Futility's Avatar
:(
80 120

kenneth_nap wrote: At first glance, I noticed there are no switch statements in python. Your quick assumption is, unfortunately, correct. Python doesn't support any kind of special switch statement, which I found annoying, too. Although it's simple enough to make up for that with a couple if/elses.

Later on when I ran my newly created newbie script, I noticed something about indentions! WTF is that all about? That's Python. Did you happen to notice and total and utter lack of { } while writing your script? Yes? So how could the interpreter possibly know when, say, an if phrase ends? Indentations, my good friend.

But why, you ask? How many times when coding in C/++ did you catch yourself forgetting a bracket? Not many, huh? Well then I guess you're amazing, because it happened to me all the time. Here you don't have to worry about it. The indentations also force you to keep your scripts crisp, clean, and uniform.

Obviously, I could have missed out on a lot of good with the language, but I would like other people’s opinion. What is your take on the language?

I like it. I like the simplicity, I like the cleanliness, I like the fact that it's very well-documented. I also like the fact tat every little script you write makes you feel super-manly because it only took 14 seconds and ran on your first try.


ghost's Avatar
0 0

Nice response. I like "{}", but I do see how indentions force neatness. I don't like indentions because you may have inconsistent spacing in the indentions which will prompt a bug.


ghost's Avatar
0 0

I personally love using python, I find it easy to move around in and I like that you can try portions of code in the IDLE while writing longer programs. If you don't indent properly you'll get an error message that an indent was expected so that should be an easy fix. I think the indents make it a little easier to read as well.


ynori7's Avatar
Future Emperor of Earth
0 0

IDLE has an option to "tabify" a region if your tab spacing is inconsistent.


ghost's Avatar
0 0

hmm I now see the indention a good way, one that I'm not use to, but good.


ghost's Avatar
0 0

Python is too neat and tidy for my taste, don't really like it. The indentations would be the main reason for that and I reckon that they are more good esthetically than they are practically. It's much easier to miss a whitespace and end up without an error or warning for it than it is if you use something that has to be there specifically for it to function, such as curly brackets. Thus I generally dislike a language that relies so heavily upon how whitespaces are used. To me, indentations are like sex; it's cool as long as it's not forced upon me.


ynori7's Avatar
Future Emperor of Earth
0 0

Since every editor I've used to write python in auto-indents for you, it's pretty hard to screw that up. As far as the curly bracket thing not being hard either, that's not the point. I hate reading unindented code. It's ugly and hard to debug.


ghost's Avatar
0 0

I prefer Java. I know… its slow, but I like the speed for portability trade/off. I also like not having to deal with pointers. Oh, it also supports switch statement!!! :)


Futility's Avatar
:(
80 120

COM wrote: Python is too neat and tidy for my taste, don't really like it. Well then you're dumb. Your opinion is wrong and if you think anything contrary to me you deserve to be brutally beaten to death with your own severed limbs. Moron.

The indentations would be the main reason for that and I reckon that they are more good esthetically than they are practically. It's much easier to miss a whitespace and end up without an error or warning for it than it is if you use something that has to be there specifically for it to function, such as curly brackets. Thus I generally dislike a language that relies so heavily upon how whitespaces are used. You guys act like adding white spaces is difficult. Like pressing tab every line or so somehow hinders your work. Hell, IDLE even autoindents for you in most circumstances. Just press tab once and you'll be good. Or you could even go ahead and not indent once until the very end and make use of the 'tabification' to do it for you.

Or you could have your own opinion and continue doing what you feel most comfortable with. Stupid.

To me, indentations are like sex; it's cool as long as it's not forced upon me. Obviously you haven't had sex forced upon you. After you stop hurting, it's actually quite simple to think back and remember how fun it was- getting pinned down and brutally beaten by your neighbor on a cool winter's eve- birds happily chirping outside with a faint breeze seeping through the door. Fond memories…


ghost's Avatar
0 0

I've never used Python until today when I saw the optimization competition, and it's really easy to use it. If you can read pseudo code, you can read Python (almost). Python seems good in my opinion so far.


ghost's Avatar
0 0

kenneth_nap wrote: I prefer Java. I know… its slow, but I like the speed for portability trade/off. I also like not having to deal with pointers. Oh, it also supports switch statement!!! :) Oh joy, then on the other hand it doesn't support a whole lot of other shit. Like the basic data types for instance, which I find a little very weak and shitty from a language in need of compilation.


ghost's Avatar
0 0

Futility wrote: Obviously you haven't had sex forced upon you. Actually I have. I've had to move to another town because of it and I can't talk to my family anymore because it was a friend of the family. You have no idea how horrible it is to not be able to look your parents in the eyes or even be in the same room as them because you know that they're aware of what things their friend did to you. Hope you're happy with yourself for bringing up the most painful event in my life and thinking it's so funny, you insensitive prick.


Futility's Avatar
:(
80 120

COM wrote: Actually I have. I've had to move to another town because of it and I can't talk to my family anymore because it was a friend of the family. You have no idea how horrible it is to not be able to look your parents in the eyes or even be in the same room as them because you know that they're aware of what things their friend did to you. Hope you're happy with yourself for bringing up the most painful event in my life and thinking it's so funny, you insensitive prick. I can't possibly find the words to express the extreme guilt that has gripped me. I'm so sorry, man. I had absolutely no idea. I… I can't believe myself.

Of course the signs were everywhere- your wit and cynicism is merely a ruse you must put up so that you can feel normal when you know that you'll always be 'that freak'. After being driven away from your family and your friends, you looked here, to us, and I've completely ruined that. Every day must be a struggle for you to overcome the intense urge to just rid the world of yourself and, by doing so, cure it of the hideous infection that you've come to embody. You- with your disgustingly skinny body and rage driven emotions. You- who must take out his anger on those of us that actively contribute to this community in the form of a newsletter by tearing apart every sentence; every word- and then arguing about it when you're clearly incorrect. You- who feels the overwhelming urge to hide your shame and disgust behind a transparent acronym monomer, despite the obvious signs that it is no longer needed.

So I'm sorry. So very very sorry for bringing up your terrible past and making you relive those moments of extreme suffering. A suffering which, I might add, could have easily been prevented by a weekly visit outside of your dingy household to wander the world; to get fresh air. These things are precious, my friend, and I'm glad to see that you're no longer taking advantage of them.

I only hope that you can accept my most sincerest of apologies. Godspeed, dear COM, and may the future bring you nothing but happiness.


ghost's Avatar
0 0

Futility wrote: I can't possibly find the words to express the extreme guilt that has gripped me. I'm so sorry, man. I had absolutely no idea. I… I can't believe myself.

Of course the signs were everywhere- your wit and cynicism is merely a ruse you must put up so that you can feel normal when you know that you'll always be 'that freak'. After being driven away from your family and your friends, you looked here, to us, and I've completely ruined that. Every day must be a struggle for you to overcome the intense urge to just rid the world of yourself and, by doing so, cure it of the hideous infection that you've come to embody. You- with your disgustingly skinny body and rage driven emotions. You- who must take out his anger on those of us that actively contribute to this community in the form of a newsletter by tearing apart every sentence; every word- and then arguing about it when you're clearly incorrect. You- who feels the overwhelming urge to hide your shame and disgust behind a transparent acronym monomer, despite the obvious signs that it is no longer needed.

So I'm sorry. So very very sorry for bringing up your terrible past and making you relive those moments of extreme suffering. A suffering which, I might add, could have easily been prevented by a weekly visit outside of your dingy household to wander the world; to get fresh air. These things are precious, my friend, and I'm glad to see that you're no longer taking advantage of them.

I only hope that you can accept my most sincerest of apologies. Godspeed, dear COM, and may the future bring you nothing but happiness. Well thank you so much for all the sarcasm, you just don't know when to quit. You were actually right at the beginning though when you said I've tried to hide it. It's taken me a very long time to cope with this but even though it happened a long time ago I haven't managed yet. You think you would? I've tried and managed to live a somewhat normal life these past years and it hasn't been easy. I can't manage any relationships and physical contact with others is hell for me. You've got no idea of how it is. You happened to push me a bit too far with that comment of yours. If you don't want to apologize then fine, I can't demand that, but you don't have to be an asshole about it. Not everything is as you perceive it, you don't know everything about me, so there's no need to be such a presumptuous dick.


ghost's Avatar
0 0

Back on topic:

Python is great for quick scripts. Plus there are loads of modules and APIs that people have created for use.

I also prefer the "{}" as it allows for easy code collapsing in my editors. However I love not having the ';' at the end of each line. That single character has caused me more headaches then I care to admit. Actually second most hated character, "*", is the first. Dealing with pointers has caused me more, but thats another issue entirely


ghost's Avatar
0 0

You can't pull a "back on topic" on a conversation like this man. That's just not classy, stdio.


ghost's Avatar
0 0

f16e7 wrote: You can't pull a "back on topic" on a conversation like this man. That's just not classy, stdio.

Hey I wanted to type my input, but walked away and in 15 min, and that conversation started. A conversation that I dont want to touch with a 10ft pole.


ghost's Avatar
0 0

f16e7 wrote: You can't pull a "back on topic" on a conversation like this man. That's just not classy, stdio.

Yeah, because everyone is so nice here at HBH. You've got to have manners here. You can't just post something that is on topic when something this dramatic is happening in a random thread.


Futility's Avatar
:(
80 120

COM wrote: Well thank you so much for all the sarcasm, you just don't know when to quit. You were actually right at the beginning though when you said I've tried to hide it. It's taken me a very long time to cope with this but even though it happened a long time ago I haven't managed yet. You think you would? I've tried and managed to live a somewhat normal life these past years and it hasn't been easy. I can't manage any relationships and physical contact with others is hell for me. You've got no idea of how it is. You happened to push me a bit too far with that comment of yours. If you don't want to apologize then fine, I can't demand that, but you don't have to be an asshole about it. Not everything is as you perceive it, you don't know everything about me, so there's no need to be such a presumptuous dick. Alright, man. I admit defeat. You win. The longer this charade goes on, the more I take on the part of a complete and total asshole while you continue to look pathetic. I have nothing to gain, and you've got nothing to lose. Sounds like a good deal for me, eh? I guess that's what I get for bringing the whole thing up.

Oh wait, I didn't bring it up, did I? If you were truly as traumatized as you're letting on, you wouldn't have made the crude sexual reference in the first place, would you?. All I know is that you're not the emotiony touchy feely kind and can't help but suspect your usual tomfoolery. But hey, what does that mean coming from me? I'm just an inconsiderate prick looking to make someone feel bad over the internet.

So yes, congratulations- wallow in your victory. Respond to this with another whiny sob story. If the masses believe you, well, you've earned it. Pretending to be scarred for life is just as good as the real thing, right, Elisabeth?


ghost's Avatar
0 0

Futility wrote: Alright, man. I admit defeat. You win. The longer this charade goes on, the more I take on the part of a complete and total asshole while you continue to look pathetic. I have nothing to gain, and you've got nothing to lose. Sounds like a good deal for me, eh? I guess that's what I get for bringing the whole thing up.

Oh wait, I didn't bring it up, did I? If you were truly as traumatized as you're letting on, you wouldn't have made the crude sexual reference in the first place, would you?. All I know is that you're not the emotiony touchy feely kind and can't help but suspect your usual tomfoolery. But hey, what does that mean coming from me? I'm just an inconsiderate prick looking to make someone feel bad over the internet.

So yes, congratulations- wallow in your victory. Respond to this with another whiny sob story. If the masses believe you, well, you've earned it. Pretending to be scarred for life is just as good as the real thing, right, Elisabeth? Why do you have to continue being such a stuck up prick about this? You did bring the whole thing up. I just made a hyperbole because it can be understood and because I've dealt with this long enough to not have to completely hide from the topic. But you were the one making assumptions and talking like it's a good thing and that I'd enjoy such acts. I'm sorry if that was a bit too much for me at that moment but I know what has happened and I don't like hearing of that it's great from people who've got no idea of what they're actually saying. I see no victory in this as you apparently seem to do. This isn't some sort of competition, I don't understand where your childish attitude comes from to act like this. If you think this is just some sort of joke to me, then I'd appreciate it if you'd keep it to yourself instead of using my feelings to make yourself feel funny or better or whatever you gain from being like this. I just hope you won't ever have to go through something like it, Nick.


fashizzlepop's Avatar
Member
0 0

I have only worked with Python here and there and so far it has extreme ups and downs. For someone new to Python (especially new to programming in general) you have to learn Python nearly inside and out before you can use the most useful modules from others. I really don't mind the tabs or switch statements since it is quick enough to build it with ifs, but the lack of data structures kills me! I wanted to make a simple program that uses matrices and I just got lost, first using a bunch of vars then looking into numPy, of which the site's tutorial was down- not sure if it still is, so that kind of discouraged my first real application of Python.

I won't give up with it but it definitely is not a priority. I am interested however in writing Google Wave apps and I would rather use Python than Java…

PS. Personally, it's always fun to make sex jokes but unfortunately things like this can happen. I really don't know what else there is to say.


Futility's Avatar
:(
80 120

COM wrote: Why do you have to continue being such a stuck up prick about this? You did bring the whole thing up. I just made a hyperbole because it can be understood and because I've dealt with this long enough to not have to completely hide from the topic. But you were the one making assumptions and talking like it's a good thing and that I'd enjoy such acts. I'm sorry if that was a bit too much for me at that moment but I know what has happened and I don't like hearing of that it's great from people who've got no idea of what they're actually saying. I see no victory in this as you apparently seem to do. This isn't some sort of competition, I don't understand where your childish attitude comes from to act like this. If you think this is just some sort of joke to me, then I'd appreciate it if you'd keep it to yourself instead of using my feelings to make yourself feel funny or better or whatever you gain from being like this. I just hope you won't ever have to go through something like it, Nick. Listen man, I'm truly sorry. No, seriously. No jokes, no sarcasm, no games. I had absolutely no idea as to your past hardships because you're usually in such control of yourself. We've talked with one another for… months, now, and you've never showed signs of… of… I want to say weakness, but that suggests that you're battling something easy to overcome and thus would be the completely wrong word to use.

I could come up with a million excuses for my vile actions, but that would defeat the purpose of my apology. There is no real excuse. I was despicable. I was the opposite of everything I've been trying to embody within this site. But that's beside the point. I singled you out of everyone and for that, I am quite possibly more guilty than I've ever been in my life.

I can only hope that you will be able forgive for my actions and my immaturity, but will place no blame on you if it's not possible.


ghost's Avatar
0 0

Futility wrote: Listen man, I'm truly sorry. No, seriously. No jokes, no sarcasm, no games. I had absolutely no idea as to your past hardships because you're usually in such control of yourself. We've talked with one another for… months, now, and you've never showed signs of… of… I want to say weakness, but that suggests that you're battling something easy to overcome and thus would be the completely wrong word to use.

I could come up with a million excuses for my vile actions, but that would defeat the purpose of my apology. There is no real excuse. I was despicable. I was the opposite of everything I've been trying to embody within this site. But that's beside the point. I singled you out of everyone and for that, I am quite possibly more guilty than I've ever been in my life.

I can only hope that you will be able forgive for my actions and my immaturity, but will place no blame on you if it's not possible. That was very mature of you and not something you see often nowadays. I hope you know how much that apology means to me and to anyone else in the same situation. Thank you for that and to the others who had to read this I'll apologize in both our names for opening up such a conversation in this thread.


ghost's Avatar
0 0

Well, now that that's out of the way….

I like python for it's interpreter. It's so nice to be able to just type in some commands to check your syntax, or to be able to just do a quick calculation without writing an entire program. Plus I just like dynamic languages in general.


ghost's Avatar
0 0

Well said MoshBat. As is typical though it all boils down to personal preferences and goals, whether you plan on building web sites, game developing, etc. Some languages are better suited than others for specific tasks. I think it's a good idea to learn a little of several languages to see what appeals to you. After dabbling with a few I had settled on Python and have never looked back. They do have good documentation on their site and you can write your own modules if needed.

{ Brackets just don't } { appeal to me in any way but then again; that's just my personal opinion on it } {


ghost's Avatar
0 0

MoshBat: Your code must be flawed; maybe a bug somewhere. When I tried to compile it, nothing happened, except for many errors.


ghost's Avatar
0 0

Thats because it's PHP :)


fuser's Avatar
Member
0 1

clearly, when I saw the "fornicate" and "fuck" I knew it was clear nonsense.

Anyway, the reason I like Python is because it's easy to learn, (like DarkBasic) and the syntax seems clean, and the lack of {} and ; makes troubleshooting easier.

Compared to when I use C++, sometimes I had trouble even finding the offending line before I could correct it.

I like Java as well, since I found it easy to learn, but that might have been due to my teacher who was so good at teaching it.


ghost's Avatar
0 0

MoshBat: Your code must be flawed; maybe a bug somewhere. When I tried to compile it, nothing happened, except for many errors.

Was seeing if anyone would believe that I tried that :-p


ghost's Avatar
0 0

Nope, I most likely did not. Looks like I got two suckers to believe me though :wow:


ghost's Avatar
0 0

Well, that's just foolish thinking..


ghost's Avatar
0 0

That makes no sense, because "think" describes what the two "suckers" are doing.


ghost's Avatar
0 0

Only if you take it out of context.


stealth-'s Avatar
Ninja Extreme
0 0

I love python for the lack of ;'s and the strict indentation requirements. However, I do like using brackets aswell, so I find it good in some ways and bad in others.

As for the actual running of the code, I don't like using non-compiled languages simply for the speed issues. Although I do see the benefits of the interactive interpreter and so on, it just doesn't seem to outweigh the speed loss. I also have issues with OOP, I really prefer functional programming so that's commonly an annoyance when writing more advanced scripts that rely on OOP modules.

One thing I've found I really love about python is it's superb error handling.


ghost's Avatar
0 0

I think with python it might one fo those, wow moments. If it doesn't happen for you then that's no biggy, it did for me.

Alot of people who are maybe more accustomed to very structured coding, or more of a there's one way to do it atitude, don't seem to catch the python bug . Which really needs a "There's more than one way to do it" attitude, though sometimes there is a right way to do it.

Anyways, I love python, and hopefully one day if you keep bothering to play with it you will too, but I don't think you've missed out on too much!

A


ynori7's Avatar
Future Emperor of Earth
0 0

buttmonkey wrote: Alot of people who are maybe more accustomed to very structured coding, or more of a there's one way to do it atitude, don't seem to catch the python bug . Which really needs a "There's more than one way to do it" attitude, though sometimes there is a right way to do it.

Indeed. Once the python competition is finished and people post their code you'll be amazed by how diverse some of the solutions are.


ghost's Avatar
0 0

I like Python a lot. The interactive interpreter is really cool and scripts are easy to write. I come from PHP and have a hard time focusing on learning C++. So Python is a nice alternative for me. I can write programs that'll take awhile to finish (since PHP only gets 30 seconds on my host), which was great for Project Euler. Though I do have problems with it's syntax sometimes. I often put in {} instead of the : for block statements. And for loops took me a little while to get used to. The forced tabs don't bug me since I do it anyways. What really bugs me (no fault of Python) is that I use Notepad++ normally to write code and it uses tabs. IDLE's editor uses 4 spaces…so I often get errors if I happen to edit the same code in both editors.