There a times I love python for its quick way of writing things. But there are more times that python makes me angry or just frustrates me with its indentation logic.πŸ€ͺ
When the indentation in my project lets the code either accidentally run a million times more or a tab/spaces inconsistency that no tool warns me about except runtime error.
What about a language that combines pythons easy way with brackets on top?πŸ˜ͺ I guess it already exists?πŸ˜…
For my project C++ would be a viable alternative, but so far the language seems very weird to write.

  • 3
    How bout Go?
    Brackets, newline for statement separation, optional semicolons, static typing, compiles to native code, GC,...
  • 2
    There was this blasphemy, luckily it's dead now: https://hackaday.com/2014/02/...

    Same here: https://pypi.org/project/brackets/
  • 1
    Any proper editor warns when mixing tabs (or at least has an extension or a setting to show it) and spaces, and any proper editor has the ability to:
    - Override the tab key to insert spaces.
    - Convert between tab and spaces (or use Unix expand/unexpand).
  • 1
    @sbiewald that would be great ... but I
    - work with Windows and Linux at the same time, which has already given me once problems with tabs/spaces conversion somehow
    - use a linux machine for my project, with editors without plug-ins and am not allowed to change anything whatsoever
    ... 😐🀷
  • 0
    @cb219 What editor is that exactly? I know that Vim has the options mentioned by @sbiewald. In addition, it also allows you to use the Unix "new line" on Windows, which is a whole other hassle.
  • 0
    @Jilano please no vim.πŸ˜‚
    I already have a hard time using the linux machine, as I'm more a GUI guy. Don't make me suffer even more...πŸ˜…
  • 0
    oh and I work with either Kate or gedit. Both not optimal for my case.
  • 1
    I think PEP8 specifies 4 spaces per indent.

    Yeah, you dont want to mix them.
  • 0
    @cb219 No worries, haha
    I just mentioned it because I know that these settings exist. I'm sure it's the case for your editor too
  • 0
    @cb219 If you have hard drive space and memory, maybe PyCharm will help you?
    It is an IDE from Jetbrains specifically for Python and includes other useful (besides the detection of spaces/tabs mix).
  • 0
    @sbiewald I just try to do as much as possible with vs code and pylint on windows and then somehow put it on the linux machine.
    The linux machine shall remain untouched.πŸ˜’
    I know about PyCharm, but haven't had great experience with it in the past.
  • 0
    Never never never ever indent with tabs
  • 0
    @muttley well I'm used to it and never had problems except with python, so what? it's strange to me to write 4 spaces instead of a simple tab🀷
  • 0
    @muttley tabs are specificity designed to indent consistently. They can be displayed as wide as you like. Thankfully go standardized on it. Only thing spaces are good for are
    # blocks like this #
    (In mono space it aligns perfectly always)
Add Comment