Programming in this language makes me feel like a retard. What's with the whitespace rules? Colons...

Programming in this language makes me feel like a retard. What's with the whitespace rules? Colons? Why can't I just use curly brackets? Why is this shit popular?

Other urls found in this thread:

en.wiktionary.org/wiki/baby_duck_syndrome
twitter.com/NSFWRedditVideo

>being stumped at syntax
yeah i dont blame you

>Being this much of a brainlet

Its actually made for retards
Even scratch is more interesting.

You're both niggers

>Programming in this language makes me feel like a retard
Probably because you're using a Notepad tier editor and hitting the space bar all the time.

Removing curly brackets was supposed to make the language more newb friendly.

I spent 2 weeks explaining to a dude what a code block was because he could not get his head around indents being code blocks.

Showed him code blocks in JavaScript and he got the concept in 5 minutes.

There's a FAGGOT meme that programming in python is fun.

The truth is that programming something fun in python keeps it fun, programming something even simple in c is always going to be a pain in the ass. (even strip() needs to be implemented, the STD is ass)

Just indent instead of using brackets you nigger.

Because all you do is
>print("im a retard")

Learn to do useful stuff u retard

>Why can't I just use curly brackets?
en.wiktionary.org/wiki/baby_duck_syndrome
C syntax is quite ugly and open to interpretation desu senpai.

>learn C
>learn C++
>learn ASM
>learn Ada
>rule the world
why are you plebs even studying Python? neck yourselves already.

Cause im learning about
>information retrieval
>natural language processing
>machine learning
in python

C

>Whats with the whitepsace rules

If you indent like sane person in any other language than there is no reason why this should trip you up.

You can do all of those easily in C.
im running TensorFlow on C just fine.

Because getting results in C/C++ takes you 10x the time it takes to test something in Python. You only focus on the problem and not the memory management around it. Once you are sure it works you can translate it to C for maximum performance gains when running it on massive data.
>ASM
Every modern compiler will use better specific instruction sets more fit for the task than the average programmer. x86 is a fucking mess.

>you can do that with c

You can also dig a hole with a plastic spoon

Anyone's who has actually used python understands how freeing bracket-less life is. You were going to indent anyway...

Very silly to see the hate towards it. The code is much easier to look at, and there's just no point in having extraneous brackets floating around.

I'll add that with all the horizontal space, vertical space makes code look untidy. Nothing terrible though.

ITT language war autists.
The true masterrace is appreciating both C and Python as the best languages around atm. Especially when you realize they go extremely well together, like peanutbutter and chocolate.
Best languages:
1. C
2. Python
3. Haskell
...
POWER GAP
...
1000000000000. C++
1000000000001. Javascript

Flip this upside down to rate them by usefulness

I was having this argument with 2 guys last night who are die-hard C nerds, explaining to them that whitespace syntax is really no different than bracket syntax. I honestly don't understand the butthurt present about whitepsace syntax, it's damn fucking simple.

To me, knowing both C and Python I honestly think that it doesn't even fucking matter, it's just a different delimiter for code-blocks, why do people argue about this shit so autistically?

So yeah I mean I don't see scheme in there but I guess it's only one opinion of a bottom feeder

>Why is this shit popular?
quick prototyping, good for small scripts, newb friendly, huge library blahblahblah

Also you only need to know the 10% of the language related to smashing dictionaries together to write perfect idiomatic python like someone who's been doing it for decades.

>Anonymous
This man is the only one here who truly knows what the fuck is going on.

this

Python's straightforward, "C Lite" syntax conceal a its somewhat dubious semantics... I couldn't care less about the significant white space. I can't stand type objects or how Python handles scoping. I also loathe duck typing.

>Programming in this language makes me feel like a retard. What's with the random infix notation? Brackets? Semicolons? Commas? Why can't I just use curly parens and s-expressions? Why is this shit popular?

10/10 post

do go on

I know that feel OP, I mean it works but yes all the time one feels retard coding in that shit, if something messes with your spaces by accident fixing a long code gonna be a pain in the ass .

Honestly Javascript can do the same shit python does it works the same way on dictionaries and lists and has no stupid names like __name__

>Python handles scoping
Waits what's wrong with python's scoping?

python = pajeetoy

What exactly is wrong with type objects?
>I also loathe duck typing.
def f(x: int) -> int:
return x + x

x = 1

def f():
print x

x = 2

f()

Well of course, you didn't define an x in the function. So it looks in locals() and then globals() for the var.

funcs = []
for x in range(10):
def f():
print x
funcs.append(f)

for f in funcs:
f()


without running this, what does it print?

I expected an exception with x being undefined.

But again it's just working through the scopes.
y = lambda: x*i
...
def f():
for i in range(10):
print(y())

Whoops forgot to define an x - but you get my point.

you expect this to print 10 nines? Python's scoping fucks with its closures, that's the issue.

Give me an equivalent of this that works. I.e. a list of functions that print different numbers. There is a workaround, but it is ugly.

Make a proper wrapper because it references the same variable.
def cl(x):
def f():
print(x)
return f

funcs = [cl(x) for x in range(10)]

for f in funcs:
f()


You don't even need to make it because there is functools.

You know your Python, I see. But you realize the wrapper is only necesary because the for loop does not scope? That extra def is superfluous. Don't get me wrong, all in all I like python, and many languages have issues with scoping, even this particular one, but pretending the issue doesn't exist is just a symptom of Stockholm syndrome.

This also works, btw (spot the difference!):

funcs = []
for x in range(10):
def f(x=x):
print x
funcs.append(f)

for f in funcs:
f()

>But you realize the wrapper is only necesary because the for loop does not scope?

Said another way:

for z in range(42): pass

print z


why the hell is z outside the loop?

The default argument will be evaluated in the loop. Python does have a lot of hidden gotchas regardless of its reputation as easy, even without getting into metaclass alchemy.

Still in the local scope. I usually dislike it but it's nice being able to do
if a:
x = 1
else:
x = 10
without an x = None on top. Evil to anyone used to block level scoping, I find it sorta evil myself.

same with with. I thought that new indented = new scope, but turns out Python is not as elegant as I thought.

I am going to guess 9 printed ten times because of x only being bound a value when the function runs or something

You're stealing this from my post complaining about python the other day. The way you are paraphrasing my complaints betrays my intent.
What I usually do is
funcs = []
for x in range(10):
def f(x=x):
print x
funcs.append(f)

for f in funcs:
f()

Oops sorry, I misread. You've pretty much got why I dislike it and if I read a few posts down instead of just the reply-chain I'd see you posting exactly what I did. So sorry.

>I find it sorta evil myself.
Well, answering your original question (I assume it was you) that's what's wrong with Python's scoping. It's evil (in some cases).

Not stealing it from any Sup Forums thread. This issue has bitten me in the ass, and it's an interview question I usually pose to Python candidates.

>c
>STD

Sorry again. No sarcasm, I really love that we both have the same complaint and practically the same example. It's a pretty natural example.

Some other complaints I have is that the separation between expressions and statements is awkward, pasting something into a REPL tends to not work when there's a blank line in the middle of a function, open() doesn't default to utf-8.

whitespace complaints (aside from maybe complaining about the language allowing tabs or spaces and not just picking one for everyone's sake) and complaints about GIL are almost always dumb.

probably because he already knew code blocks in Python

>1000000000001. Javascript
1000000000001. Javascript
1000000000001. Javascript
Don't do that to me.

C++

I'd love to see you faggots use an os written in cpp or js

Oh wait, you fucking can't, you need C. It's literally the single most useful language since you can't produce code in ANY other language without a platform that's abstracted away C code

Windows is in great part written in C++.

Windows is made in C++. C is a second class citizen in the whole Windows ecosystem, used mainly in extern "C" blocks.

Yeah, it's interesting how people converge to the same implementations (or minimal examples in our case).

Regarding Python, I think most of the design flaws arise from just a few underlying principles namely:

(1) trying to prevent runtime failures. This is what makes Python so liberal with the scope. It's the same bad decision that lead to PHP or JS-like type coercion rules, for instance, which luckily Pyhon does not share.

(2) trying to be a programming language that vaguely resembles natural language. This makes the syntax overly complex and inconsistent, and ties in with your point about expression and statement separation

Personally I also strongly dislike the mutability that permeates it all, but I can imagine some people making a case for it.

>t. unemployed 1st year C kiddie

>Programming in Python makes me feel like a retard.
I think you might be genuinely retarded.

this

Python is a meme. Typescript is just so much better as a scripting language in every single way.

I agree. FUck white space rules and FUck dynamic typing.

Typescript is fine
Node isn't that great

The whitespace rules are shit because they don’t allow for proper lambdas.