[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
Why do you guys hate JavaScript so much? Don't JavaScript
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 88
Thread images: 7
File: 1406222559380.jpg (51 KB, 453x604) Image search: [Google]
1406222559380.jpg
51 KB, 453x604
Why do you guys hate JavaScript so much?

Don't JavaScript programmers get paid well?
>>
I get paid well driving a garbage truck all day.

It means shit
>>
Because you don't need 100 fucking scripts to load a website
>>
>>53419291
yes you do, to make it more user friendly. You dont want to reload a site if you dont need too
>>
>>53419310
No you fucking don't.
>>
>>53419310
>yes you do, to make it more user friendly.
End your life friend.
I'm perfectly aware your browsing capabilities are limited to media-intensive services like youtube and facebook but not all sites need this.

Almost all sites I go through everyday could be done better, some of them rely on unnecessary garbage because some hipster faggot webdev through you absolutely need animations to browse through a fucking blog
>>
>>53419329
of course you do.. 4chan uses heavily javascript.

how would you fill if you pres "update" and the whole page reloads.
>>
>>53419310
>yes you do, to make it more user friendly.
by adding 300 more 30mb JS scripts?
yeah, no thanks. i'd choose lightweightness over user-friendlyness anyday
>>
>>53419363
...fine?
Why the fuck are you getting so defensive about 30mb JS scripts??
>>
>>53419286
how did you get it? there are no programming jobs wehre I live.
>>
>>53419357
modern animations are done via CSS.. javascript just changes the classes to trigger the animations.

also, whats wrong with animtions. Its an essential part of UI which helps you navigate the page.
>>
>>53419363
>4chan uses heavy JavaScript
And with half those scripts blocked the site still works perfectly. Also keep in mind I'm not saying you can't use JavaScript, just that you don't need literally hundreds of fucking scripts for a single goddamned page.
>>
>>53419275
Semen demon
>>
>>53419403
>Its an essential part of UI
please grab a gun and shoot yourself in the forehead
>>
>>53419392
because I'm using javascript on my site. I could do most of the stuff serverside, but its just stupid to waste my server resources, when I can just outsource it to the client and achieve the same thing.

For example formating date strings, sorting data lists and similar..
>>
>>53419429
also, I dont feel like programming something 2 times..
- one time for javascript users
- another time for retards who disable javascript
>>
>>53419275
Web development newfag, do ajax controls eliminate the need for a plethora of scripts?
>>
>>53419461
JavaScript users don't want your bullshit either. Learn to properly use JavaScript or don't use it.
>>
The correct name is ECMAScript.

Because it's a poorly designed language with lots of small issues. The designer said once he was told to do something like Java in 10 days.
>>
>>53419485
>The correct name is ECMAScript
We know, we don't care.
>>
>>53419363
that's how it used to be, you had to press F5 to see new posts
see: futaba
>>
>>53419473
Don't worry mate, I'm using it properly
> render SEO sensitive content serverside
> render everything else via React
> rneder loading of new content via React
>>
>>53419429
If you don't code that stuff on the server you expose it to hacks.

Whilst you may think it's more convenient to offload to the client, all you've done is trust some random on the internet not to fuck you.
>>
>>53419363
not realy, thumblr, facebook not even show with umatrix
>>
>>53419545
well, they just render the data sent from server.

>>53419586
well, as said before.. I render content which I think is important via server. I'm not sure if google bots know how to index JSON data properly yet.
>>
>>53419461
>b-but we have to write two sites!
>one which works for everyone and one which works for some people
If you have one which just works for everyone, why would you need to make another?
>>
>>53419639
to make it a better user experience (most importantly via using ajax)
>>
>>53419671
You're not special and no one cares about "experiencing" your site. They want it to just work. You aren't going to get more business from JS-based animations and processing. In fact, most mobile viewers would probably appreciate the few seconds of battery saved by not having to use their phone to process more than the basic HTML.
>>
>>53419708
well I have to use JS even if I didn't want to.

>make image uploader with progress update
>>
>>53419429
>but its just stupid to waste my server resources,
Well that's basically what javascript does. You're constantly pushing data back and forth to the client. With plain HTML, the client only loads the page when user requests it, and all the old images are cached, so it's just the plain html that gets sent (plus maybe any new thumbnail images).
Also, there's the overhead of all the js files, that simply don't exist in plain HTML website. There's often a lot of these scripts, and they tend to be pretty large.
Also, plain HTML lets you browse with text-only client such as Lynx, which use almost no bandwidth since no images or even CSS files are loaded (the user can explicitely load individual images, one a time, in external image viewer, but that's nothing like loading everything all the time).
Also, less security risks for everyone.
>>
>>53419403
>also, whats wrong with animtions.

they're almost always way, way overdone. it just looks tacky and bloated.
>>
>>53419275
>Why do you guys hate JavaScript so much?
I don't, JavaScript is literally the master race
>>
>>53419485
It's basically only good for enhanced UI and novelty stuff. Using it for anything serious is like taking Perl to write embedded aerospace control system. These languages have uses and purposes, and even doing cool hacks iwth them is ok, but it falls apart pretty quick if you try to go too far outside their scope.
>>
File: index.jpg (11 KB, 225x225) Image search: [Google]
index.jpg
11 KB, 225x225
>>53420329

You are so incredibly misinformed that it's almost unbelievable
>>
>>53420448
So how does ajax work then, if you're not constantly polling...
>>
>>53420329
thats not how it works.. you send the raw data (in JSON format) and the javascript thats already loaded in the webpage renders it.

you basically create an API on the server which serves data only
>>
>>53420543

You don't poll constantly with Ajax, only when you need to. And you typically send less data when using Ajax because you're only sending the actual data (like objects represented by strings) itself, not data baked into a template. So the client can cache the template after downloading it once, and do the work of inserting the data into the template. Less server load, less client loading time, slightly more client load.

Also every browser now supports websockets, so data can be exchanged much more efficiently than an old-fashioned standard HTTP request.
>>
If you think about JScript as a 'jQuery plugins x100' than it sucks -> but if you will go techs like real full stack JS -> it works. Example? NodeJs + ExpressJS + KrakenJS + MongoDB + Multiple template engines or just React. Nonblockin FULL stack Js web app. You just not need to learn other language. 3D? three.js or even Unity have it own 'JS'-like scripting language. Full stack Frameworks like Zend or symphony? Try Meteor... Autobuild? Gulp for Sass/less/stylus/babel for ES6, livereload for auto reload. Mobile? React Native or Js in Unity.

Js is fck powerfull if you are powerfull dev...
>>
File: 1457654603199.jpg (511 KB, 1536x1925) Image search: [Google]
1457654603199.jpg
511 KB, 1536x1925
>>53419275
ps. REAL Js dev (not jQuery faggottery) are paid verryyy well.
>>
>>53420664
>you typically send less data
>typically
Hey I guess that depends. In the old model (phpBB and other such old web bulletin board things) the posts are broken up in pages, so you don't always re-send the whole entire thread. Once 20 posts (for example) are reached, the page is over and thread gets a new page. And you don't ever send any javascript initially, it's just plain HTML.
In the new model, you have these pages that scroll forever. It doesn't make sense to reload them, because at some point they get too large for it to be efficient. Heck, even search engine like duckduckgo uses this constant scroll modem, unless you use the "lite" option. Compare:
https://duckduckgo.com/lite/?q=foo
https://duckduckgo.com/?q=foo
Also, the second one just spams you with all kinds of "free" extra stuff, like images and youtube videos. That bandwidth ain't free, it's got to be accounted for too.
Plus there's the actual use case to consider. If a dude goes to a web forum once per day and checks some threads he visited the prior day, the phpBB will know exactly which wast the last post he read from each thread (saved in cookie), and just send him to the right page right away, and even the correct post (using HTML anchor tags with postID's). So he doesn't have to reaload all those previous pages, and he doesn't have to load any javascript.
>>
>>53420815
More semen demons
>>
File: 1449517945703.jpg (696 KB, 2427x1820) Image search: [Google]
1449517945703.jpg
696 KB, 2427x1820
>>53420998
So glad the world is moving away from this shitty model and more towards complex client side with simple RESTful API.
>>
>>53421085
Ok so you don't actually want to discuss, just troll.
>>
File: dYzH1nb.jpg (16 KB, 331x382) Image search: [Google]
dYzH1nb.jpg
16 KB, 331x382
>>53419368
mfw a site I built back in the day where all components were designed to be small enough to load in each modem packet burst loaded 10x faster than most popular commercial sites including Microsoft's, which at the time was considered a technological achievement
>>
>>53421178
I'm just replying to your post with a serious opinion. Feel free to wait for the other guy to respond.

There is no reason to continue using the model you described with the growth of powerful front end frameworks like Angular/Backbone/Knockout. Your model is hard to scale, and much more tightly coupled than a simple REST API and MVC front end.
>>
>>53421212
Scale only matters if you're doing enterprise size stuff. A little fan forum or similar doesn't need that kind of over-engineering. If it does grow big, you'll just rebuild it anyway. But it doesn't have to be built with the assumption of exponential growth from the beginning. The fact is, most things won't get big and popular.
So yeah there's reasons to use the old model, because it's simpler and easier to implement. All you need is HTML 3 and a plain old text mode browser (and any server-side language, of your choice).
>>
>>53421361
I can understand why you would say that, but it really is not over-engineering at all.

A REST API is very simple, especially since you are offloading large parts of logic to the front end. Just use the REST portion to do CRUD for your data, don't worry about how clients will transform this data. In addition to this, you are able to expose this API so you can reuse it for another program (say you decided to create a native mobile app for Android or iOS).

I also think it's perfectly suitable for a forum, and you can do some shitty TODO list app in 15 minutes.

So yeah, it's not adding complexity, but rather trying to remove complexity and allowing flexible changes. One tradeoff to this approach is that it requires good planning ahead if you do plan on exposing this API. Changes to the API means changing your client and you can't do that often if you have other businesses relying on it.
>>
>>53421446
> API
> API changes
Well that's what I'm talking about. The moment you deviated from plain HTML, you already made things complicated. Instead of a plain, simple HTML web browser, now you're talking about the same problems you normally only deal with in native applications. Oh, the API changed. Oh we need to uggrade this library. Oh, there's now some dependencies...
The old model didn't have that problem. The only thing that mattered is what version of HTML the browser supported. But frankly HTML 3 is enough for most things.
>>
>>53420795
This rambling clusterfuck of incoherent jibberish is pretty analogous to JavaScript itself.
>>
>>53421623
I guess it's okay if you just want to make a shitty site and have low standards, dude.

If you're only doing a largely static page with minimal dynamic content then you're free to use legacy patterns. But just know that people have moved on and when you tell them you're doing it like that they will probably just laugh at you.

You're too stuck in legacy. JS is much more powerful now and has become much faster than PHP. In addition, it's just easier to do JS now with standards and structures set in place.

jQuery was the first big thing to really make JS usable, no longer do you need to memorize and account for different browsers and their different APIs (or even the way they structure their DOM).

Angular enforces a strict structure, this is a good thing. You don't have people doing their own spaghetti patterns and structures.
>>
>>53419545
And what language WOULD you suggest for server side scripting other than JavaScript?
>inb4 PHP
>>
>>53421792
Ruby
>>
>>53421361
Mother fucker did you just say that you should use a deprecated specification of HTML?
If this is how most of /g/ thinks, no wonder they couldn't even build a bit torrent clone.
>>
>>53420664
web sockets are a god send. I only make SPA websites now.Just cache your site all packed up on a CDN and use low overhead sockets for updating the data.
>>
>>53421897
This.
Adapt or die.
>>
>>53421775
Atually my bank has one of the shittiest sites ever. It's full of bad interface everywhere, because they couldn't help themselves to try and make it "impressive" with lots of javascript all over the place. It's not even comfortable to navigate on any level. The typical keyboard shorcuts (tab key to advance fields) and arrow keys don't even work properly. You literally *have* to do everything with the mouse.
In 1999 though, I was using a plain HTML 3 + SSL web browser to login to another bank, and it was a great experience. Everything was simplly laid-out, without clutter, and all the keys worked as expected. I could buy stuff on ebay with teh same simple (no javascript) browser, and it was a pleasant experience. Now there's all kinds of mouse contex shit going on all over the place, and it's a lot more confusing in general. Well, anyway I don't go to ebay anymore, I let my account auto-expire a few years ago. I't s not worth the hassle for me.
All these overcomplicated sites are a big turn-off for me. I'm not impressed by them at all, they feel completely wrong and broken and badly designed.
>>
>everything must be an app now!
>web"pages" (like in books, that old depreciated medium) are no longer a thing, and good riddance!
>who wants to read a book when you can tap an app instead?
>>
It's the easiest language to get started with, so there are lots of substandard developers with it.

Then, when they get "better"... well, the big secret is that they don't. They just learn to install some jQuery plugins via bower to achieve some neat effects to impress the boss.
Meanwhile, backend developers make miracles happen but because it doesn't look flashy, nobody cares. Nobody knows about how challenging the work is.
>>
>>53421623
The old model never allowed multiple clients.
If your website is the only one using the API, then nothing changes. You change the API, you change your one client, All done.

When the API is exposed and others are using it, that is a different story, of course. You can only bring out V2 of your API and urge developers to upgrade to it.
But since this was never possible in the first place with plain old server-rendered HTML, I don't see your problem.
>>
>>53422025
>mfw I still read books
>mfw webpages are still a thing
>mfw I still support javascript
>>
>>53422045
>using jQuery before you understand how vanilla JavaScript works
This is why we have such shit JS devs.
>>
>>53422116
>reading books
>not experiencing books
Get with the times, grandma.
>>
>>53419429
>when I can just outsource it to the client and achieve the same thing.
Just end your life.
Your server isn't the side with the battery.
>>
>>53422155
> experiencing books
You mean consuming book content, right?
>>
>>53422144
Yeah.

I mean, I can understand it, the default DOM API is the most poorly designed piece of shit imaginable, but...
>>
>>53422216
Well anon, I mean all languages have their flaws.
JavaScript doesn't need to be pretty, it just needs to work (and sometimes it even fails at doing just that.)
But it was there when we needed it, and that's what's sealed it's place as one of the most popular languages.
Luckily Brendan Eich is working on WebASM.
>>
File: received_10204433156709469.jpg (47 KB, 506x662) Image search: [Google]
received_10204433156709469.jpg
47 KB, 506x662
Op, assembly is the one and only way for web dev
>>
>>53422279
>>53422284
>undeniably nonfree javascript
What will be your excuse then?
>>
>>53419275
who is that semen demon?
>>
>>53422297
How exactly is JavaScript proprietary?
Sure, you can write proprietary applications with it, but you can do the same with any other language.
I know this is probably just a meme, but spouting nonsense like this is actually detrimental to the FOSS community.
>>
>>53422279
The DOM API isn't really JavaScript's fault.
That was... W3Cs fault. And Microsoft's. And Mozilla's.
I think that Javascript is actually a pretty nice language with the new ES6 stuff. Using imports, classes and all the modern shit feels good. Typescript has just a tiny bit of additional changes and it's almost as nice as C#.
>>
>>53420815
this desu. Too many framework fags who can't debug because they never touched naked JS
>>
>>53422350
Yeah im digging the Typescript C# similarities.

Its less shit now.
>>
>>53422348
>you can write proprietary applications with it
That is the nonfree javascript being referred to in the meme. Proprietary programs sent with the webpage are nonfree javascript, unless they are under a free license/too small to be considered copyrighted.
>>
>>53419275
they're just mad that people using an easier language somehow get paid more.
>>
>>53419275
It's too hard to understand. I'm mad because it doesn't have Classes and OOP shit.
>but muh emulation and ES2015
That's syntactic sugar kid
>>
>>53420815
this nigga knows what's up
>>
>>53422411
I get what they're saying, that's a scary thought because JS is so pervasive now.
>>
I use AJAX very sparingly for updating content on a site (mostly fetching old blog entries from a different server). I do like json for passing structured data to PHP when it has a little more finesse to it than a single form. Other than that very few things need it in earnest. Coding it like lisp is fun though.
>>
>>53421944
This is the problem with the industry right now. Everybody is cramming in the most bullshit into every single site. Nobody uses the methodology of picking the right tool for the right job.
>>
>>53419368
> 30mb
You obviously have no fucking idea what you're talking about
>>
>Browser: hey server, I want to view this webpage, can you send it to me via this ubiquitous protocol that I'm designed to render?
>Server: Sure thing bro, but you know what? let me also send you this clusterfuck script in this language that should never have been a scripting language, It'l tell you how to render the page nd shit.
>Browser: ummm, are you sure? I'm really good at rendering this ubiquitous protocol, it's kind of what I was designed to-
>Server: wow bro, hold up. That protocol can't handle all these flashy annimations, you do like flashy annimations don't you?
>Browser: ummm, actualy, I just want nice clean text, thoughtfully layed out and described by this ubiquitous pro-
>Server: nah bro, you want these annimations. They're flashy as shit, the user experience bro, think of the user experience.
Browser:...
>Server: I did mention we can then communicate in a half arsed manner dreamed up by some overpaid idiot who didn't understand what they were trying to achieve or that whatever it was had already been done in the very protocol they were trying to cicumvent.
>Browser: Wait what? That doesn't sound very saf-
>Server: Bro, bro. Don't worry about it, there hasn't been a major security issue with this shitty language for like, 3 months now. You can handle this clusterfuck script right?
>Browser: I think so, my devs had to shoehorn an interpreter on the side for this language that was designed to be compiled into bytecode and run on a vm, it isn't pretty but I think I can handle it, are you sure you can't just send a normal page in this ubi-
>Server: Bro, what year do you think this is? Everyone does it like this, it's popular and shit. Think of the scaling and stuff, this language like halves the work and thought my devs have to put into shit. Everyone knows that everyone uses this unholy mess of a language because everyone already uses it. Fuck man, you want this page or what?
Browser:...
>>
>>53419275
I personally don't hate JS, but I do think it's over/mis-used. There is a reason it was made, and it's helpful to use it in those areas.

What are /g/ approved libraries? Surly libraries jquery.min.js won't annoy anyone.
>>
>>53424001
Hello 90s, how was last week's friends?
>>
This thread looks like a big spidey troll and nothing more... sadly.
>>
>>53424001
>Somebody typed all this thinking it's true

I guess this is the power of memes.
>>
>>53426028
Maybe all the people running Windows 10 also fell for a meme. Because it was popular and shit, and they don't know any better.
It's the same way with javascript and the way Web 2.0 came about. It's shit, but it's the way the "industry" does things. Also, they like to say fuck you and shove lotsa ads and malware down your pipe. Whoever was arguying javascript-based stuff is more bandwidth efficient kinda lost track of how it's actually used. Also these awful captchas and shit (that don't even work half the time).
>>
>>53419291
This. I hate all of these American websites so much that do this.
>muh interactive website
Thread replies: 88
Thread images: 7

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.