Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Symbolic Butt
Mar 22, 2009

(_!_)
Buglord
why is semantic whitespace so bad, can't you indent your code for god's sake

if you're incapable of sticking with this simple convention your code is most likely garbage

Adbot
ADBOT LOVES YOU

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
the best thing you can do to a plang is restrict it until it's no longer a plang

kitten emergency
Jan 13, 2008

get meow this wack-ass crystal prison
people itt whose ide automatically indents their loving code anyway crying about a lang where indentation matters

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
things that move my code only serve to trigger my autism

shrughes
Oct 11, 2008

(call/cc call/cc)
p much any language with semantic whitespace or optional semicolons or some kind of insane vendetta against expressions is essentially a p lang.

Notorious b.s.d.
Jan 25, 2003

by Reene
the best feature of golang is gofmt

python's semantic whitespace would still be terrible if they mandated tabs/spaces but having it heuristically determine it at runtime makes a bad thing even worse

Mr. Glass
May 1, 2009

Notorious b.s.d. posted:

the best feature of golang is gofmt

yes

tef
May 30, 2004

-> some l-system crap ->

Notorious b.s.d. posted:

no python is ever beautiful

yeah but enumerate, and the key argument in sorted is pretty ok

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

Mr. Glass posted:

when i programmed in python a lot i completely drank the koolaid and thought it was Good as well

looking back it's literally the worst. who in their right mind thinks it is a good idea. semantic whitespace belongs only in joke languages

nah, it's good. when would you not want to indent the code anyway? the only problem is it should have enforced spaces-only

Corla Plankun
May 8, 2007

improve the lives of everyone
why isn't the notion of non visible control characters universally mocked by everyone?

the only worse control character i can think of would be meting out capital is and lower case Ls

Notorious b.s.d.
Jan 25, 2003

by Reene

Corla Plankun posted:

why isn't the notion of non visible control characters universally mocked by everyone?

python exposure early in life causes much more brain damage than it does in adults

ShadowHawk
Jun 25, 2000

CERTIFIED PRE OWNED TESLA OWNER

Corla Plankun posted:

why isn't the notion of non visible control characters universally mocked by everyone?

the only worse control character i can think of would be meting out capital is and lower case Ls
lol if you don't think whitespace is visible

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

ShadowHawk posted:

lol if you don't think whitespace is visible

that explains a lot of the hate

Marsol0
Jun 6, 2004
No avatar. I just saved you some load time. You're welcome.

Corla Plankun posted:

why isn't the notion of non visible control characters universally mocked by everyone?

:set list

Sweeper
Nov 29, 2007
The Joe Buck of Posting
Dinosaur Gum
stop using bad languages tia

cowboy beepboop
Feb 24, 2001

Sweeper posted:

stop using bad languages tia

please list your good langauges

Bloody
Mar 3, 2013

my stepdads beer posted:

please list your good langauges

c

Bloody
Mar 3, 2013

MeramJert posted:

nah, it's good. when would you not want to indent the code anyway? the only problem is it should have enforced spaces-only

this is so fuckin dumb because if you just use the control character \t like god intended then set up your idiot editor for morons for \t to be however many spaces you htink it should be then i can just use \t and have it set to whatever the gently caress the default is (because im not cripplingly autistic) and tada now things just work

but no, when i press tab, i want it to be functionally equivalent to mashing the space bar a bunch because

Tiny Bug Child
Sep 11, 2004

Avoid Symmetry, Allow Complexity, Introduce Terror

my stepdads beer posted:

please list your good langauges

PHP

Workaday Wizard
Oct 23, 2009

by Pragmatica
indenting with space is bad any language that asks you to do that has bad style today and foreverially


i like python for small stuff though (especially anything dealing with networking)

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

Bloody posted:

this is so fuckin dumb because if you just use the control character \t like god intended then set up your idiot editor for morons for \t to be however many spaces you htink it should be then i can just use \t and have it set to whatever the gently caress the default is (because im not cripplingly autistic) and tada now things just work

but no, when i press tab, i want it to be functionally equivalent to mashing the space bar a bunch because

wrong, spaces own.

Damiya
Jul 3, 2012

shrughes posted:

p much any language with semantic whitespace or optional semicolons or some kind of insane vendetta against expressions is essentially a p lang.

does this make Scala a plang

ShadowHawk
Jun 25, 2000

CERTIFIED PRE OWNED TESLA OWNER

Bloody posted:

this is so fuckin dumb because if you just use the control character \t like god intended then set up your idiot editor for morons for \t to be however many spaces you htink it should be then i can just use \t and have it set to whatever the gently caress the default is (because im not cripplingly autistic) and tada now things just work

but no, when i press tab, i want it to be functionally equivalent to mashing the space bar a bunch because
the reason to avoid tabs in python code is that if two different people are using different tab spacing in their editor the code will look different to them and they might make different style choices like when to wrap something in multiple lines

Symbolic Butt
Mar 22, 2009

(_!_)
Buglord

shrughes posted:

p much any language with semantic whitespace or optional semicolons or some kind of insane vendetta against expressions is essentially a p lang.

python hates expression statements. this is a huge difference compared to javascript and jesus christ don't get me started about expression statements in javascript

Workaday Wizard
Oct 23, 2009

by Pragmatica

ShadowHawk posted:

the reason to avoid tabs in python code is that if two different people are using different tab spacing in their editor the code will look different to them and they might make different style choices like when to wrap something in multiple lines

wrong

tab for indent then space for alignment.

because the continuation of a line is one the same level as the beginning of the line it gets the same number of tabs, add spaces for aligning your text afterwards

Workaday Wizard
Oct 23, 2009

by Pragmatica
btw if ^[^\t]+\t matches anything in your codebase kill your colleagues+self

Dessert Rose
May 17, 2004

awoken in control of a lucid deep dream...

Shinku ABOOKEN posted:

wrong

tab for indent then space for alignment.

because the continuation of a line is one the same level as the beginning of the line it gets the same number of tabs, add spaces for aligning your text afterwards

what he's saying is that if i prefer to keep my code under 80 columns but i have my editor set to display tabs at 4 spaces vs your 2 our ideas of what constitutes a line that is too long will differ

Symbolic Butt
Mar 22, 2009

(_!_)
Buglord

Shinku ABOOKEN posted:

btw if ^[^\t]+\t matches anything in your codebase kill your colleagues+self

I think you mean [^\t]+\t (your regex is a piece of poo poo)

Workaday Wizard
Oct 23, 2009

by Pragmatica

Dessert Rose posted:

what he's saying is that if i prefer to keep my code under 80 columns but i have my editor set to display tabs at 4 spaces vs your 2 our ideas of what constitutes a line that is too long will differ

if it's a problem for you then you can 1) tell your teammate to stop writing very long lines 2) resize your console 3) resize your tab

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

now i want to write a github bot that finds projects that use tabs for indentation and submits a pull request to convert it all to spaces

Workaday Wizard
Oct 23, 2009

by Pragmatica

MeramJert posted:

now i want to write a github bot that finds projects that use tabs for indentation and submits a pull request to convert it all to spaces

i remember there a bot that posted issues regarding undefined behavior in random repos that didn't ask for it
can't find the link tho

MononcQc
May 29, 2007

if the hate of semantic whitespace in python and haskell is due to being a butthurt tab user, you may want to consider using an editor that lets you have per-language or per-project settings so your tools stop making you have such strong feelings about irrelevant poo poo, and stop having you faint at it the way a victorian era lady would

Malcolm XML
Aug 8, 2009

I always knew it would end like this.

MononcQc posted:

if the hate of semantic whitespace in python and haskell is due to being a butthurt tab user, you may want to consider using an editor that lets you have per-language or per-project settings so your tools stop making you have such strong feelings about irrelevant poo poo, and stop having you faint at it the way a victorian era lady would

haskell's indentation is optional; u can use brackets and semiconolsn if u rly want

MononcQc
May 29, 2007


"Notorious damme of the B.S.D. has fallen ill after looking past the hedges of her IDEs, my lord"
"Send a rmaven to town and ask the doctor for leeches from the island of Java, it's the only cure!"

tef
May 30, 2004

-> some l-system crap ->

prefect posted:

more on-topic, what's the general opinion here of python? (i already know what you think, shaggar)


it's ok

- it has reasonable cross platform support
- it has a lot of third party libraries, including plugging into big things like Qt, so you can prototype stuff up.
- it has a lot of third party mathematics and statistics stuff, so it's pretty good for cheap-rear end number crunching.
- docs.python.org is pretty comprehensive.
- the import statement is pretty ace, and in general importing something doesn't monkeypatch the poo poo out of things
- from __future__ import is pretty ace, and python has a good history of backwards and forwards compatibility

it's a pretty good glue language to mash powerful libraries together, and for smallish projects <20kloc it handles
well.

it's a bit bad

- the standard library predates a lot of python features and idioms developed later
- handling unicode and bytes is possible but it doesn't save you from knowing how to do it
- python 3 migration has been slow, clumsy, and awkward, but it's pretty reasonable to start new projects in py3 now http://py3readiness.org/, but migrating from 2 to 3 is probably still a lot of effort, it involves a substantial rewrite of most of the code, and py2/3 cross compatible code is clunky as hell.

python 2 is ok, python 3 looks better but has far less community support and momentum.

it's a bit terrible

- some parts of the stdlib need to be taken out the back and shot
- in larger projects, a lack of defined interfaces between parts can backfire


Brain Candy posted:

ffs, you can even see when somebody was feeling clever, the most dangerous thing

this is basically why i like python: python is not a language to feel clever for writing in. although there are things like metaclasses, there is a strong community push towards "write the most obvious thing", and pushing away from clever bits of metaprogramming.

Corla Plankun posted:

why isn't the notion of non visible control characters universally mocked by everyone?

(thing is, indentation *is* visible. semantic trailing whitespace, like in markdown, is the devils work)

Maluco Marinero
Jan 18, 2001

Damn that's a
fine elephant.
Yeah. I learned web dev in Python, and while I tend to be much more across JavaScript front end these days, and I'm using Scala for my back end work, Python is still my goto for smaller stuff.

It encourages readable code, clear dependency declaration, and as you say, doesn't let you get too clever when simple will do.

My experience with the ecosystem has also been far better than most others as far as versioning and well written documentation goes.

It helps that it never got into some toxic library patterns like monkey patching everything. Luckily modern JavaScript libraries have generally got that memo too.

tef
May 30, 2004

-> some l-system crap ->
the problem i have with python 3 is that it's not sufficiently more useful than python 2 to be worth the pain of migration.

as someone who does as much byte janitoring as unicode janitoring, the big unicode switch doesn't improve things a lot,
and despite a whole slew of small nice features, changes, and libraries appearing in 3, nothing yet has been enough to
drag work code across.

ShadowHawk
Jun 25, 2000

CERTIFIED PRE OWNED TESLA OWNER

tef posted:

the problem i have with python 3 is that it's not sufficiently more useful than python 2 to be worth the pain of migration.

as someone who does as much byte janitoring as unicode janitoring, the big unicode switch doesn't improve things a lot,
and despite a whole slew of small nice features, changes, and libraries appearing in 3, nothing yet has been enough to
drag work code across.
yield from your posts

Max Facetime
Apr 18, 2009

Maluco Marinero posted:

It encourages readable code, clear dependency declaration, and as you say, doesn't let you get too clever when simple will do.

maybe it's just that most "clever" patterns have already been incorporated into the language as its idioms

so each successive generation's failure to find "clever" ways of doing things in python is actually a failure to find actually clever ways of doing things in python

Adbot
ADBOT LOVES YOU

coffeetable
Feb 5, 2006

TELL ME AGAIN HOW GREAT BRITAIN WOULD BE IF IT WAS RULED BY THE MERCILESS JACKBOOT OF PRINCE CHARLES

YES I DO TALK TO PLANTS ACTUALLY

tef posted:

as someone who does as much byte janitoring as unicode janitoring,
condolences

coffeetable fucked around with this message at 13:26 on Aug 8, 2014

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply