edbrowse-dev - development list for edbrowse
 help / color / mirror / Atom feed
* [Edbrowse-dev] js befuddle
@ 2014-04-15 10:37 Karl Dahlke
  2014-04-15 15:18 ` Chris Brannon
  0 siblings, 1 reply; 2+ messages in thread
From: Karl Dahlke @ 2014-04-15 10:37 UTC (permalink / raw)
  To: Edbrowse-dev

As I move forward with javascript, as time permits,
I just have to comment, or vent, at least once, on the state of js.
Not the language, that's fine, but the way people write it.
I'm convinced there is a program out there somewhere that is
called js_befuddle(), that strips the whitespace and comments
out of any js program, and changes the variables to meaningless
single letters.
It can't be coincidence; I've seen too much javascript code written like that.
My router for instance, has a js file that is 10K,
all on one line, no whitespace, no comments, and cryptic variables.
10K of what looks like line noise.

But it's worse than that.
Most of these programs hide operations in functions
when they don't need to, and even prototype on top of existing methods,
so that the standard string and array methods don't do
what you expect them to do.
Imagine if s.split(',') does something completely different than you expect.
It's worse than reading assembly language!

I guess they are thinking along these lines:
"My js code has to be public, I can't hide it,
I have to release the source, and I'm paranoid, so I'm going to make
it confusing and convoluted and impossible to understand."

Gee, thanks alot.

Most people would never know or care,
but if I want to know why edbrowse doesn't work on a site,
I have to trudge through all this shit to figure it out.
My goal then is to find some real world sites where edbrowse doesn't work,
and where the js is simple, short, and comprehensible;
and then hope those problems are representative of the shortfalls
of edbrowse js in general.
Jesus, Mary, Joseph, and all the saints!

Karl Dahlke

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Edbrowse-dev] js befuddle
  2014-04-15 10:37 [Edbrowse-dev] js befuddle Karl Dahlke
@ 2014-04-15 15:18 ` Chris Brannon
  0 siblings, 0 replies; 2+ messages in thread
From: Chris Brannon @ 2014-04-15 15:18 UTC (permalink / raw)
  To: Edbrowse-dev

Karl Dahlke <eklhad@comcast.net> writes:

> called js_befuddle(), that strips the whitespace and comments

It's called a JS minifier, and they're quite common.  When I worked at
Google, we used something called Closure, which compiles JS into
"compact, optimized code".  Part of my work there involved writing the
occasional JavaScript.  I'd write nice readable JavaScript, and Closure
would compile it into the inscrutable dog vomit of which you speak.
Minification is part of that compilation process.

I'm not spilling any secrets, as Closure is available to the general
public.

-- Chris

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-04-15 15:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-15 10:37 [Edbrowse-dev] js befuddle Karl Dahlke
2014-04-15 15:18 ` Chris Brannon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).