Python uses identation instead of brackets. TOP LOL!

Just for the sake of curiosity I started a Python tutorial.

And I just found out it uses identation and a way to identify what is inside a for loop or if condition.

Is this serious?

I wonder how the discussion TAB vs SPACE for identation would go for Python users.

Other urls found in this thread:

opencv.org/
mlpack.org/
cs.waikato.ac.nz/ml/weka/
simplecv.org/
twitter.com/NSFWRedditVideo

PEP8 -> Indentation
>Use 4 spaces per indentation level.
/thread

No switch statement

did you just /thread your own post?

>4 spaces
>not 8

In to the trash it goes.

why would i ever use while instead of for

4 is better than 8, Linus is wrong.

Using the standard for loop in python always creates an iterator -even if not needed-. Quite inperformant

you can fit more code on the screen

If you are really optimizing at this level, you should be vectorizing your operations, not using for

welcome to 20 years ago and fuck off back to /r/programming with your underage internet discoveries

>4 or 8 spaces
>not 2
do you hate writing code

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.

Spotted the Ruby faggot. 2 space indentation is for absolute retards.

>using 10% of your line width for each tab
retard

you're contradicting yourself

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.

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.

this debate is really high level

How many levels of indentation do you need, fa?m Behond 3 or 4 it's about time to rethink your plan.

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

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.

>not using tab
Oh man you make me laugh

If you use 8 spaces even 2 tabs is too much

who's the artist?

>C programmer
>puts code in brackets
>stills tabs the inner code
TOP LOL

I like this as it keeps code looking nice and clean, sick of spaghetti coders who send me their unindented code.

>[in]performant
This word needs to die

2 spaces hides bad code full of nested blocks.

I hate languages that use whitespace too, makes it difficult to auto generate things.

>Is this serious?

Yes, it's a well-known fact that Python is a retarded language.

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.

this

I almost always newline and tab when using brackets so eliminating brackets is convenient.

go away, BEGIN X/END X is great

Why use whitespace, which is invisible without an IDE? Why not just use dash, plus, or whatever? Python is literally communism.

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.

>which is invisible without an IDE
wut?
def foo:
bar

Looks pretty visible to me

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

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.

>Sometimes opening a py file in a different text edititor fucks everything up
>Not using EditorConfig

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

>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.

> 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.

opencv.org/
mlpack.org/
cs.waikato.ac.nz/ml/weka/

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.

Forgot to say, MATLAB is a pretty good alternative but everyone knows it costs a bunch for every feature you use.

>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.

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.

Python merit is being a fucking glue with whitespace issues.

>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.

Things like this : simplecv.org/

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.

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?

>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.

Use Rust instead of Python.

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?

>tfw to intelagent to use a game engine

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.

>tfw this kind of retarded NIH autism is what doomed Natural Selection 2 to irrelevancy

three-space master race

...

Lisp looks like shit with more than 2 spaces though. Some languages are better with 2 spaces, some with 4 and that's okay.

>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.

dem good old days when I used switch() with include() in vanilla PHP for my websites

>whitespace invisible without IDE
what the fuck am i reading

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.

that only happens with notepad since it doesn't recognize "\n" as a line break.

notepad is not a normal text editor

wait nevermind i don't know why it isn't showing spaces either

/post

>Implying people actually use that word

do yourself a favour upgrade that sheet to notepad++

Literally the point of the language retard.

It was meant to be a quick and dirty way to program.

>not notepad+=2

Switch statements are bad and you should feel bad for using them.

python has always had a cv/ml following

PEP8 says you should be using 4, so no

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

>I just found out it uses identation
whats it like living in 2002

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.