Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
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.
-
I have seen people going crazy over this and I'm thinking why would you want to do that?!
-
Never got that minification trend anyways - it is like pretending, that HTTP Deflate doesn't exist...
-
@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. -
@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... -
@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.
-
@ars1 Python has very great concepts and not major flaws like JavaScript, the syntax is great.
-
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.
-
@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. -
@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... -
@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.
-
@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. -
@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. -
@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. -
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.
-
I swear there has got to be some way to exploit the shit out of this unholy abomination.
Related Rants
<py-script> ... Good luck minifying that
rant
pyscript
python
minify