Today's adventures in code: implementing a bespoke parser for an extremely limited subset of SVG's path specification because why the heck not

· · Web · 1 · 0 · 1

Relevant gripe: the fact that in "shift" is spelled "pop(0)" and "push" is spelled "append" will never fail to trip me up

Oh right, also "switch(x)" being spelled "if" (or worse, "{case: 'result'}.get(x, default)")

I've at least finally internalized that join() is a method on the separator string, not the array. 🤷‍♂️ I'll take the wins I can get!

@cincodenada I totally agree but would also find shift equally forgettable which if anything illustrates the design problem they were facing

@relsqui Yeah, I suppose I should clarify these are gripes very much tied to my particular language background!

To get unnecessarily verbose: I of course favor the verbs native to the languages I happened to cut my teeth on (Perl and PHP, which started as a set of Perl scripts).

This is especially true for "shift" which is, agreed, a weird verb. Having "pop" but not "push" is a little weirder to me, but also "append" is more accessible to folks not familiar with increasingly-obscure stack paradigms.

All in all, I can't complain, I think given Python's goals as a language they're all solid decisions!

@cincodenada I didn't know that about php's history but it explains a lot! I guess I did know that one back in the day, but it's been a minute

@cincodenada er, second "know that" was re the syntax, I neglected to put enough of that thought into the sentence to actually make it make sense, heh

Sign in to participate in the conversation

cybrespace: the social hub of the information superhighway jack in to the mastodon fediverse today and surf the dataflow through our cybrepunk, slightly glitchy web portal support us on patreon or liberapay!