18

<py-script> ... Good luck minifying that

Comments
  • 5
    What kind of sorcery is that?
  • 9
    What in the...... oh god, oh fucking hell no!!!
  • 4
    @jonas-w the bad kind. the kind that summons eldrich demons and stuff.
  • 2
    python decieded to became the new JS. It gives me the same "I am sorry for this old guy" feeling when Joe Bieden tries to say something.
  • 4
    I have seen people going crazy over this and I'm thinking why would you want to do that?!
  • 7
    os.system("reboot")
  • 2
    Never got that minification trend anyways - it is like pretending, that HTTP Deflate doesn't exist...
  • 5
    @Oktokolo Here some data for jQuery. Dev: 282kB, dev-gz: 83kB, minified: 87kB, minified-gz: 30kB.

    That should make clear that compression complements minification, but doesn't replace it.
  • 2
    @Fast-Nop: Well, you could just drop the jquery requirement alltogether. It isn't needed anymore.

    Also: Compare size of scripts that get cached by browsers with content that doesn't get cached. Then add all that overhead for tracking and ads to fully surrender all remaining hope for sanity...
  • 3
    I've never used Python, but surely it can't be worse than JavaScript. Right?
  • 1
    @Oktokolo I chose jQuery as general JS example - the same applies ofc to all JS. That was the point of the rant with the minification.
  • 1
    @ars1 Python has very great concepts and not major flaws like JavaScript, the syntax is great.
  • 6
    @happygimp0 Syntactic whitespace sucks quite a bit.
  • 1
    Welcome to the fucked up web development, where you need to send source code to your clients and minify it to reduce the size of the page.
  • 2
    @Oktokolo

    Minification is lossy, (gz) compression is lossless.

    If you only compress, you still need to be able to uncompress the names of variables:

    mySuperLongButVeryHumanlyReadableVariableName = superLongObjectName.superLongMethodName().

    If you minify, you replace that with 'a=b.c()'.

    After that, deflate (modified lzss) just takes care of repeats -- in the sense that multiple occurrences of 'a=b.c()' might be able to be replaced with something even shorter.

    Of course, developers then completely ruin it by using a bloated frameworks and a million packages just to center a div.
  • 1
    @Fast-Nop inconsistent whitespace is my junior detector.

    If mixing tabs/spaces and indentation are giving you problems, it's time to turn on white space characters in your IDE.

    There's nothing worse than getting a support call because your bash script is throwing an error "\r invalid character" because they're using github desktop on Windows and running code in wsl2...
  • 1
    @Fast-Nop It is the best way i saw that was implemented in a productive programming language. At least it stops people from not aligning their { and } which is sadly extremely common.
  • 2
    @happygimp0 That's not even an issue because you can have code formatters, just look at Chrome's dev tools where you have the beautifier for minified HTML, CSS, and JS. You can even hook such a tool in your VCS to ensure a uniform style of your choice. That's the beauty of non-syntactic whitespace.

    The last time syntactic whitespace made any sense was in the punch card era. It's nothing modern or so, it's just completely backward.
  • 3
    @Fast-Nop This does not really work for version control systems, nor code which your read on the internet. Align rules are hard to do automatically.

    On top of that, if you have indentation, which you should have, then it already contains the information where a block starts and where it ends, when you add brackets you have redundant information.
  • 1
    @happygimp0 I agree with redundancy. However, whitespace is easy to fuck up because you can not see it (by definition).
    You can enable visible whitespace in your editor. However, you still won’t see it in other places like stackoverflow. That was your argument against brackets: But it also works against whitespace.

    Also, brackets give you the flexibility to put short things into one line. This is handy and common for lambdas/closures.
  • 4
    I hate Javascript and Python is probably my most used language, but I still wouldn't try to replace js with Python for client-side web scripts. Embedding a significant-whitespace programming language in an insignificant-whitespace markup language just sounds like a recipe for disaster.
  • 2
    This is the ugliest ass shit I have ever witnessed
  • 4
    I swear there has got to be some way to exploit the shit out of this unholy abomination.
  • 1
    @blindXfish that's old news, lol.
  • 1
    @theabbie oh fuck, YES PLEASE DO THAT
Add Comment