PEP8 -> Indentation >Use 4 spaces per indentation level. /thread
Josiah Price
No switch statement
Chase Wright
did you just /thread your own post?
Bentley Fisher
>4 spaces >not 8
In to the trash it goes.
Bentley Green
why would i ever use while instead of for
Angel Wilson
4 is better than 8, Linus is wrong.
Josiah Young
Using the standard for loop in python always creates an iterator -even if not needed-. Quite inperformant
Josiah Hernandez
you can fit more code on the screen
Nolan Jones
If you are really optimizing at this level, you should be vectorizing your operations, not using for
Jace Gomez
welcome to 20 years ago and fuck off back to /r/programming with your underage internet discoveries
Benjamin Diaz
>4 or 8 spaces >not 2 do you hate writing code
Ryan Diaz
Because having 8-character indentations makes the code move too far to the right, and makes it hard to read on a 80-character terminal screen? If you need more than 3 levels of indentation, you're screwed anyway, and should fix your program.
Nicholas Thomas
Spotted the Ruby faggot. 2 space indentation is for absolute retards.
Luis Hernandez
>using 10% of your line width for each tab retard
Daniel Watson
you're contradicting yourself
Adam Russell
Yeah, so? If this is the 1st time you are seeing Python code it means you are just some random noob anyway and your opinion doesn't matter as you can't judge anything.
Ian Mitchell
And all this crap just to avoid a pair of curly brackets. Python is an unholy language and y'all keep proving it by arguing over how many spaces to use.
Mason Martin
this debate is really high level
Tyler Nguyen
How many levels of indentation do you need, fa?m Behond 3 or 4 it's about time to rethink your plan.
Christopher Hall
wow my friend. i am euphoric by this discovery. i would tip my hat to you if i wasn't naked in front of my computer screen
Leo Williams
Indentation, like the way it does comments, makes sense if you realize that its an line interpreter and thus you want to keep syntactic things as local as possible.
Tyler Fisher
>not using tab Oh man you make me laugh
Juan Jackson
If you use 8 spaces even 2 tabs is too much
Zachary Thomas
who's the artist?
Jack Bailey
>C programmer >puts code in brackets >stills tabs the inner code TOP LOL
Charles Wood
I like this as it keeps code looking nice and clean, sick of spaghetti coders who send me their unindented code.
Nicholas Peterson
>[in]performant This word needs to die
Brody Foster
2 spaces hides bad code full of nested blocks.
Cooper Hill
I hate languages that use whitespace too, makes it difficult to auto generate things.
Isaac Richardson
>Is this serious?
Yes, it's a well-known fact that Python is a retarded language.
Gavin Smith
Stop cargo culting C-style brackets OP. They were born as a shorter notation than BEGIN ... END Using indentation to mark blocks enforces good indentation practices, avoids a good bunch of code style debates and makes the missing curly brace a non-issue.
Levi Perry
this
I almost always newline and tab when using brackets so eliminating brackets is convenient.
Zachary Wood
go away, BEGIN X/END X is great
Carson Ramirez
Why use whitespace, which is invisible without an IDE? Why not just use dash, plus, or whatever? Python is literally communism.
Anthony Hill
Not so to Thompson and Ritchie, who left everyone dealing with {} for eternity. In retrospective back then it was great for a teletype, where wasted characters made everything take longer but who the fuck still uses a teletype? Same deal with every other shorthand BCPL/B/C brought.
Ayden Walker
>which is invisible without an IDE wut? def foo: bar
Looks pretty visible to me
Jack Phillips
I thought Python was dumb as fuck at first but I've been using it a lot for data processing and analysis and its been using really well
Its good for computer vision too
Brody Long
It's awful. Sometimes opening a py file in a different text edititor fucks everything up. When your writing in python you have to pretty much just pick one edititor and stick with it. i use gedit.
It really is retarded though, You can tell python is a really hacked together language held together with spit and duct tape.
Joshua Gutierrez
>Sometimes opening a py file in a different text edititor fucks everything up >Not using EditorConfig
Ryan Morgan
not really, only if the editor actually inserts tabs instead of spaces when you press tab.
tabs is a farily archaic practice with remnants only in stuff like makefiles or borderline autistic programmers
Nathaniel Wood
>Sometimes opening a py file in a different text edititor fucks everything up. When your writing in python you have to pretty much just pick one edititor and stick with it. >edititor >when your writing I think this is bait but then again Sup Forums can be really stupid sometimes so I'm not sure.
Nathan Watson
> data processing and analysis >Its good for computer vision too
No, i am gonna tell you why you are using it for it because you are not smart enough to implement your own algorithms and instead you are using recipes with kits like scikit learn and shit like that.
Python without numpy (which is practically matlab syntax) is slow as fuck and not good for data sciences.
numpy/scipy allow you to use the python runtime environment as a wrapper for LAPACK/BLAS/MKL without having to write your code in fucking C. The better alternative is running FORTRAN but it's not pretty.
Austin Hill
Forgot to say, MATLAB is a pretty good alternative but everyone knows it costs a bunch for every feature you use.
Kayden Lopez
>as a wrapper for
Thats the fucking python problem, its a bunch of wrappers cuz the official python implementation its so fucking slow to do things by itself, even pure javascript its much more suitable by itself todo that tasks emscripten compiled code has better performance than pyshit.
Jonathan Turner
Maybe because Google has invested a shitton of money on making V8? PyPy doesn't have nearly as many resources and it's a good improvement anyway. CPython was always meant as a C wrapper of sorts.
Gavin Nelson
Python merit is being a fucking glue with whitespace issues.
Luis Gutierrez
>Maybe because Google has invested a shitton of money on making V8? dude, what about spidermonkey and chakra , even fucking embeded JS engines like ducktape and jerryscript has good performance.
Lot of python projects are a bunch of dependencies to other projects because they creators have no fucking idea of how to do it by itself.
a fucking high level api to the cv api for python and that cv api for python is a fucking wrapper to the cv library for C++. disgusting af.
you can do image processing on JS in a fucking browser without anything else python is a joke.
Luis Martin
this is bad why exactly? You write the things that need to be fast in a fast language and you write everything else in a slow but readable language. doesn't that just make sense?
Dylan Bailey
>you are not smart enough to implement your own algorithms Clearly, wasting your time reimplementing stuff other people already made is the more intelligent approach.
Dylan Evans
Use Rust instead of Python.
Matthew Bailey
after you've implemented a few serious algorithms, you realise that you don't have time to implement every algorithm you need properly and efficiently... in fact you don't have time to do 5% of them if you want to get anything done
>python without numpy is slow! so what? why would anyone be using python without numpy?
Jayden Wilson
>tfw to intelagent to use a game engine
Aiden Bennett
Spidermonkey has also had heavy Google support and then the V8 competition, Chakra was made by fucking MS. The deal with Python is how slow are implementations because they obviously have less resources than JS, which is a pity given how ugly is JS, even with ES6. >Things like this : simplecv.org/ I could give you an endless list of dumb npm modules, anyone can do high-high-high-level APIs.
Jackson Perez
>tfw this kind of retarded NIH autism is what doomed Natural Selection 2 to irrelevancy
Gabriel Perry
three-space master race
Brayden Jackson
...
Cameron Ward
Lisp looks like shit with more than 2 spaces though. Some languages are better with 2 spaces, some with 4 and that's okay.
Julian Wright
>Lisp looks like shit with more than 2 spaces
no, lisp looks like shit no matter how you type it, its a ridiculous useless language.
Nolan Allen
dem good old days when I used switch() with include() in vanilla PHP for my websites
Camden Evans
>whitespace invisible without IDE what the fuck am i reading
Julian Allen
You need an ide to write python programs because of significant whitespace. It's a well known issue. Guido doesn't want to fix it because it keeps normalfags away.
Jacob Powell
that only happens with notepad since it doesn't recognize "\n" as a line break.
Adam Hughes
notepad is not a normal text editor
Jason Myers
wait nevermind i don't know why it isn't showing spaces either
Jeremiah Price
/post
Jacob Myers
>Implying people actually use that word
Aiden Harris
do yourself a favour upgrade that sheet to notepad++
Thomas Torres
Literally the point of the language retard.
It was meant to be a quick and dirty way to program.
Ethan James
>not notepad+=2
Oliver Hill
Switch statements are bad and you should feel bad for using them.
Jack Ortiz
python has always had a cv/ml following
Aiden Diaz
PEP8 says you should be using 4, so no
Lucas Myers
Also a reminder that the Python developers tried to REMOVE lambda functions, map, etc. from Python 3.
It is literally GNOME 3: the programming language.
I hope Julia overtakes Python desu
Christian Taylor
>I just found out it uses identation whats it like living in 2002
Asher Nguyen
If a mistake is made with indentation then the code ends up in a different scope than intended. Then again there is a higher chance of missing colons in C.