How autistic does one need to be as to enforce one's obsession with code indentation in a programming language?

How autistic does one need to be as to enforce one's obsession with code indentation in a programming language?

And how do you Py-fags deal with not being able to figure out where a set of code ends and begins? is there a tool to mark that or did the creators figure an autistic way to force you to check every single line of code?

Other urls found in this thread:

nim-lang.org/
github.com/jython/jython3/commits/master
twitter.com/SFWRedditImages

>i'm an undergrad comp sci student who thinks he knows something: the post

The indentation becomes a non-issue when you use it frequently.

>TFW the white man is oppressing pajeets with proper code indentation

>How autistic does one need to be as to enforce one's obsession with code indentation in a programming language?
Not at all. It's by far the least bad aspect of Python and it's by far not the worst way to implement indentation based syntax.

FP
BP

?HowAutisticDoesOneNeedToBeAsToUseSpacesAndPunctuationProperlyToCommunicateToOthers

How autistic does one need to be to feel oppressed by a programming language enforcing indentation?

>not being able to figure out where a set of code ends and begins
Care to elaborate? I didn't use python much, but when I did, I had no issues reading/writing code whatsoever.

Python code is some of the most readable code out there.

>copy code
>paste back in
>nothing werks
Fuck Python.

>implying pajeets don't use python
If you want to minimize poo exposure choose C or C++.

>see pic

How
Autistic
Does
One
Need
To
Be
As
To
Use
Spaces
And
Punctuation
Properly
To
Communicate
With
Others

I always see some people complaining about pasting python, and yet I never had any issues with that myself. It's a mystery.

It's bloated as fuck. 500 thousand lines of Python interpreter does the same thing twice as slow as 10 thousand lines of Lua interpreter.

Well not really, but you are right if you meant to say that CPython is a meh-tier interpreter if there ever is one; right after most scheme meme interpreters.

> Copy-pasting code
You sir, are in no position to belittle programming languages as long as you are not capable to write independent code

AFAIK CPython is the most widespread one.

Python is A E S T H E T I C. I'm glad they enforce indents. It really cuts down on time when reading someone else's code.

This.

Some ideas for even better programming lanugage:

> remove colons, they're unnecessary
> enforce naming convention (all types must be PascalCase, all variables and functions must be camelCase, all constants must be ALL_CAPS
> enforce proper formatting (if it doesn't conform to PEP-8 don't interpret it)
> enforce documentation (if every function, every argument of function and so on isn't documented, don't interpret it)

also
> prohibit semicolons, every statement has it's own line
> prohibit statement on the same line as : enforce consistent indentation style

Pretty sure V8 is more widespread. Along with a lot of other stuff.

As for Python interpreters: Of course it is, there actually is no choice.
There is:
- CPython, while technically better to be buried, the only complete implementation
- PyPy, rocket science by a lot of good people and still fails to deliver, thanks to CPython (friendly reminder: a programming language is NEVER independent of it's implementation)
- micropython, a fucking mess, following CPythons footsteps, but for microcontrollers, apparently developed by similar clueless devs
- lot of derprecated legacy garbage like Jython or IronPython
- Cython and Nuitka, to get decent performance you have to deviate from Python semantics, even more so than with PyPy

That's nice and all but how about static typing first. That's the most crucial thing I miss from Python.

also
> static, most of the time inferred typing
> static types, getting rid of metaclasses
> no self garbage
> state of the art tracing gc instead of rc + gc at end of execution
> fast binary compiler based interpreter

Sup Forums Writes a programming language

>Copy and paste code
>Nothing works
Is it hard being retarded?

That almost exist under the name Nim.
Too bad it suffers from its own share of obvious flaws.

You're being hysterical/retarded.

There's optional typing available.

There's plugins available that will fix that shit if you really have trouble with pasting Python code.

>There's optional typing available.
The useless kind, to be precise.

>Nim
Nim is an existing language though?
nim-lang.org/

By "almost" I meant it is not quite an improved Python but its own language.

I was trying to make fun of the language using the slippery slope, but some people took me seriously

Oh I thought you meant Sup Forums almost made their own language.

Well, there were some attempts. Their logos were finished, so I'd call them successful by Sup Forums standards.

Fuck Python and pyfag shills and their pleb scripting language.

C++ is bae code for patrician coders.

new to Sup Forums
how was this done?

with code bb-code tags

can you give an example?

Your code here.
Let's hope that works.

Nope, it ate nested bbcode.
Basically you write and an ending tag with a /.

Actually, it seems you don't need to close those.
Well, I'm in no mood for finding out the fitting escape sequence, so basically you put brackets around "code".

>> enforce documentation (if every function, every argument of function and so on isn't documented, don't interpret it)
/* adds the value specified by parameter "amount"
* returns the
*/
int8_t add(
// the value to add
int8_t * amount
) {
// TODO check for overflow
// increase the stored value by the specified amount
dataDelegate->amount += &amount;
return 0; // indicates success
}

you know, screenshots are a thing


(testing)

(╯°□°)╯︵ ┻━┻

Yeah, but that requires efforts I'm not willing to take.
Come to think of it, also typi

...

[reeeeeeeeeeeeeeeeeeee]

fine, whatever

I'm thankful and yet I still hate you so..

thanks, I guess.

>I'm thankful and yet I still hate you so..
That's the Sup Forums magic.

When you have a function or some block of code spaning two heights of your screen for example, how does that work in python? Is it impossible to track everything down when there are no brackets to signal you where is what?

thanks based jerk senpai

Chill out, it's just a toy language for first year students, like visual basic with training wheels. You can forget about it after that.

penis

It managed to dethrone Perl though.

I don't know what I hate more about python.
The underscores, the unicode crap, the module system, the forced indention or the way classes work.

How people choose this as their favorite language is beyond me. I'd gladly take a job programming in an old PHP version over python.

>it managed to dethrone a toy language for admins that only looks the way it looks because larry is edgy as fuck with his bibles in his pants
That's not untrue, but I'm insecure if this is a good measure.

Python is shit, but not for the reasons you think.

Well played.

someFunction(self)

Actually that is one true point, you need to re-indent your code when you paste something in. It only takes a few seconds for a few lines and it really isn't a big deal. I quite like the neat indentation but it could be a bit of a pain to some.

You should indentate anyways so might as well enforce it.

However copy pasting can result in some errors if you don't pay attention

>hey looks guys we made a language in which OOP is very important
>len(mystring)
What did they mean by this?

This is almost literally Ruby. Especially the Rails framework which enforces class file names like java

All the OO features of python feel like a tacked-on afterthought.

>PascalCase
>camelCase
holy shit fuck off

colons are trash though, continuation characters like \ or & should be the standard, an otherwise newline terminated line should always be considered terminated

This.

This. Ruby is just as fast (or slow) as Python but at least it doesn't half ass OO and the syntax is just much nicer. Also because it doesn't force indentation it can do some aesthetic shit like "x = y if condition". And I like the inverse control flow things like "unless" and "until" in addition to just if and while. Also blocks are great and Ruby had symbols.

It's just too bad everyone makes Python libraries except in web dev

>continuation characters like \ or & should be the standard, an otherwise newline terminated line should always be considered terminated
This

I like it because it's something fresh - something different from C family languages.

>There should be one-- and preferably only one --obvious way to do it.

class Foo(object):
...
def bar(self):
...

f = Foo()

f.bar()
Foo.bar(f)
getattr(Foo, "bar")(f)
Foo.__getattribute__("bar", f)()
Foo.__dict__["bar"](f)
Foo.__dict__["bar"].__call__(f)

NEWSFLASH !!!

This is just in:
Some people like syntactically significant whitespace, others don't.

I REAPEAT:
Some people like it, others don't!

We can not be sure what this all means yet, stay tuned. We'll inform you when we understandthe further implications of this SHOCKING new turn of events..

>not being able to figure out where a set of code ends and begins?
Whether you like the forced indentation or not, it's difficult to argue that it doesn't make it obvious where blocks start and end.

Also, even though I'm really not a fan of the forced indentation, I do like the part of it that enables me to not waste lines on end-braces.

>copypasting code
Let's just imagine that you're not just pastashitting all over your code as is rather talking about moving code around. Then it is true that you may need to reindent the code at the target location.

However, do you not do this for other languages? Do you just leave it at a non-matching indentation? If so, literally kill yourself even more acutely than if you were pastashitting.

>as
and*

>lot of derprecated legacy garbage like Jython
I'm actually using Jython, and it is by no means deprecated. It doesn't have the resources of CPython, but it is in active development, and if you can use it, it's actually surprisingly nice. In particular, you get rid of the GIL.

>friendly reminder: a programming language is NEVER independent of it's implementation
C has a couple of fairly different implementations, for sure.

I only used it during a course I was forced to take on user interfaces to troll the people responsible for assignmnents who demanded we use JavaFX

I'm generally with this guy here:
I also think Ruby is more logical and easier to use.


But recently I've tried to grasp the reasoning behind Python and it's not as bad if you understood the differences.

Ruby is centered about the thought that you always ask objects to do things:

a = Blah.new
a.do_this.do_that.length.to_s


..and so on.


But Python is centered about functions. It's more inspired by languages like pascal. Everything that can be put in a separate function shall be put in one!

You can even see this in the iterator models:
-Ruby does something like "3.times {}" and then you use each iterating number as the object you want to give orders to.
-Python uses list comprehensions, where you are not interested in the single object that much, but more in the Set.

My feeling is Ruby syntax works more "from inside to outside", cascading the result of an operation to the next outer level.

Python syntax works more "from outside to inside", trying to do wrap things in functions and trying to be as abstract as possible.

Decorators are a good example here: you manipulate things by wrapping stuff around.
In Ruby you would maybe rather accomplish the same thing by defining the decorator INSIDE the object and tell the object to "decorate itself".

Of course you can use the "Ruby way" in Python and vice versa. But that messed up my head and my Python code often felt "wrong".

So today I try to use a different mindset. You know starcraft?
Ruby is the Protoss:
-powerful objects
-simplicity by code encapsulation and clear responsibility

Python is the Zerg:
-a lof of small functions
-simplicity by doing a lot of simple steps

The first to are obvious to someone who knows python (and are 2 different things). The others are hacks intended to do other things.
There should be one obvious way to do one thing, not one way to do many things.

I do not know ruby enough to know whether that analogy makes sense, but I guess I can see python making small functions/codeblocks easy with lambdas, list comprehensions, dicts, and small functions

>talking shit about based larry
hope your mother dies in her sleep tonight

Well, it's just my personal thoughts. Ruby also has a lot of lambdas, but they are kinda "hidden", so you don't realize that you are actually use them. And that's exactly my feeling: In Ruby "functions are merely properties of objects", in Python objects are "merely the storage for functions".

Ahh, it's difficult to describe and might not be 100% accurate. But I realized that Python looks much better for me once and makes more sense when I try to "let Ruby go".

This is hard, because the syntax is so fucking similar sometimes. But if you're looking at it from an aerial view, the way you model things is different. I even started to like Python, even though the "baby duck syndrome" is a thing and I'm always be a Ruby guy..

>I'm actually using Jython, and it is by no means deprecated.
It is, though. They barely made it compatible to 2.7.

And those follow the same range of semantics that C unfortunately allows.

good thinking user

the functional stuff was tacked on as well, though

>not making fun of a sigil loving shell implementer
hope your sister dies in her sleep tonight

testicles

>It is, though. They barely made it compatible to 2.7.
They did indeed make it compatible with 2.7, though. While it's taking some time, they're still actively working on Python3 support.

If you don't already indent your code consistently, you're writing shit code.
kys OP.

Even though Python's forced indentation matches what one would naturally do the majority of the time, there are times when other indentations fit better, and then Python suddenly starts sucking since it cannot support them.

For example?

zl = zh = cz[0];
if(cz[1] < zl) zl = cz[1]; if(cz[1] > zh) zh = cz[1];
if(cz[2] < zl) zl = cz[2]; if(cz[2] > zh) zh = cz[2];
if(cz[3] < zl) zl = cz[3]; if(cz[3] > zh) zh = cz[3];
return(zh - zl);

I know this isn't the best example since Python has n-ary min and max functions, but it's what I had at hand. It's not too difficult to imagine similar constructions that aren't specifically min and max.

>latest release: 2 years ago
>still working on 2.7 bugs
>one branch
>jython3 repository looks deserted, with the most recent update being a single fix after a year long pause

>All the OO features of python feel like a tacked-on afterthought.

>one of the few languages that properly support multiple inheritance with C3 linearization
>afterthought

>jython3 repository looks deserted, with the most recent update being a single fix after a year long pause
github.com/jython/jython3/commits/master
Sure it's been half a year since the last update, but they were common up to that point, and half a year isn't that bad. Not sure where you're looking.

It's not aesthetic when it's part of the syntax. Nothing uglier than making invisible characters carry syntactic weight.

>even a clock is right twice a day on matters that shouldn't exist in the first place
>marvel of engineering

They fixed that with a breaking change, btw.

>and half a year isn't that bad
half a year == dead, deadest, dead-o-licious, deadarific, dust-bustin, pushin the daisies, kicking the bucket
[rest_in_piss.apng]

{ int i = 0 }

{bb-code} int i =0 {bb-code}

{code} int i = 0 {code}

How so, really? The only way to think of them as an "afterthought" is that they're not strictly part of the core language, but added on a layer above, but separating concerns like that is a good thing, not a bad thing.

int i = 0

[bb-code] int i = 0 [bb-code]