Sign in to follow this  

Is there a language like Python but without the tab requirement?

This topic is 819 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Potentially many, or potentially very few. When you say "a language like Python," what do you mean? What qualities does Python have that you want in another language? The interpreted nature? The dynamic type system? The existence of list comprehensions?

Share this post


Link to post
Share on other sites

I get that significant white-space is weird for those used to curly-braces langauges, but why the resistance to such cosmetic differences when clearly you see the value in Python for its other merits? Isn't that a bit like refusing to learn to drive in a foreign country where they happen to install their steering wheels on the side opposite of what you're used to?

 

Sure if feels non-ergonomic for awhile, but it starts to feel natural before you know it.

Share this post


Link to post
Share on other sites

Potentially many, or potentially very few. When you say "a language like Python," what do you mean? What qualities does Python have that you want in another language? The interpreted nature? The dynamic type system? The existence of list comprehensions?

 

Interpreted? Sure.

 

Dynamic types? Yes.

 

List comprehenisions? Yes.

 

Functional and Object-Oriented capabilities? Yes.

 

What would you prefer instead of tab indentation, to determine scopes? C-style curly brackets?

 

Anything but tabs.

Share this post


Link to post
Share on other sites

 

Anything but tabs.

You are, I take it, aware that tabs are very frowned upon in the python community?

Most people use spaces instead.

 

 

Obviously, I have been misinformed. I thought that tabs were the way one indents in Python therefore scoping variables, methods, classes, and other constructs.

Share this post


Link to post
Share on other sites

Obviously, I have been misinformed. I thought that tabs were the way one indents in Python therefore scoping variables, methods, classes, and other constructs.

 

That might be the source of your consternation.

 

I'm not a python guy, but my understanding of their indentation rules are basically this -- When a line ends in a colon ( : ), the indentation level of the subsequent line defines it for all lines that share its scope by using the same indentation. This indentation level must be greater than the indentation level of the last line ending in a colon ( : ). Any subsequent line with lesser indentation than this escapes the scope (perhaps many? until it rejoins a scope with identical indentation?).

 

I believe you can freely add additional indentation without creating a new scope wherever the previous line does not end in a colon ( : ).

 

 

[edit] fixed interloping smileys.

Edited by Ravyne

Share this post


Link to post
Share on other sites

I thought that tabs were the way one indents in Python therefore scoping variables, methods, classes, and other constructs.

 

Tab stops, I guess might be a more reasonable way of describing it.

 

The tab character itself is entirely optional - indents can be any arbitrary combination of spaces, so long as they are used consistently within a given file.

Share this post


Link to post
Share on other sites
Ruby
Node.js + TypeScript

Personally I don't have any issue with JavaScript's prototypes over traditional classes, but for those who really like the more traditional class (which you probably do because you seem to like python) TypeScript does a good job of emulating them.

The biggest value add IMO of python is its batteries included strategy. Node.js with npm will get you something close.

Share this post


Link to post
Share on other sites

 

Potentially many, or potentially very few. When you say "a language like Python," what do you mean? What qualities does Python have that you want in another language? The interpreted nature? The dynamic type system? The existence of list comprehensions?

 

Interpreted? Sure.

 

Dynamic types? Yes.

 

List comprehenisions? Yes.

 

Functional and Object-Oriented capabilities? Yes.

 

What would you prefer instead of tab indentation, to determine scopes? C-style curly brackets?

 

Anything but tabs.

 

C# does all of this out of the box except for the interpreted part (but there are tools for that if that matters both for repl or running scripts or compiling apps on the fly too since compile times are very short).

Edited by ronan.thibaudau

Share this post


Link to post
Share on other sites

Personally I think using spaces for indentation is the dumbest idea ever, but space proponents tend to be louder / more whiney. Just don't mix tabs and spaces (for indentation) and you'll be fine.

 

Spaces for alignment (after indentation) are definitely better than tabs, but aligning code is pretty silly as well IMO.

Edited by l0calh05t

Share this post


Link to post
Share on other sites

It runs faster too, because the CPU doesn't have to keep scrolling down.

 

Wouldn't it have to scroll right way more though? This is why I limit my line lengths to 80 characters, 120 is acceptable but I can definitely feel the slowdown on longer lines. They just run slower.

Share this post


Link to post
Share on other sites

If you want Python, just use Python.  Every language has its foibles, and with Python it's an over-reliance on context-dependent invisible scoping delimiters and an arcane set of additional rules to overcome the shortfalls of such a bad early-on design decision. (("""Really, triple double quotes inside nested parentheses?"""),

    yes, and the comma is a continuation character if it appears before an invisible newline followed by context-dependent invisible spaces).

 

If your most important goal is sensible syntax, you need an Algol-family language.  Weird that none of them ever caught on.

Share this post


Link to post
Share on other sites

This topic is 819 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this