|
JavaScript is a really crazy language
|
# ? Aug 27, 2015 15:13 |
|
|
# ? May 24, 2024 05:27 |
|
St Evan Echoes posted:agreed, safari + obj-cscript forever slowfari is bad and obj-c is even worse
|
# ? Aug 27, 2015 15:15 |
|
I'm sure an internet of ActiveX plugins would be far superior, right?
|
# ? Aug 27, 2015 15:18 |
|
Shaggar posted:slowfari is bad and obj-c is even worse
|
# ? Aug 27, 2015 15:20 |
|
Jabor posted:I'm sure an internet of ActiveX plugins would be far superior, right? to javascript? absolutely.
|
# ? Aug 27, 2015 15:20 |
|
even vbscript would be better than javascript
|
# ? Aug 27, 2015 15:22 |
|
i have been implementing r6rs scheme for fun in my spare time, those guys and gals put so much thought into that language. everything works, there are no surprises, its all explained in clear mathematics. its beautiful. javascript otoh doesn't even get lexical scoping right.
|
# ? Aug 27, 2015 15:34 |
|
pepito sanchez posted:app is app everything in javascript is named app for some stupid loving reason
|
# ? Aug 27, 2015 16:42 |
|
pepito sanchez posted:app is app everything eventually falls as part of the main angular module. it's global, or let's say "public" instead right now, but the point is avoiding global namespace pollution. because code gets wrapped inside IIFEs nothing is public or exposed unless i expose it. it's how you declare and use private variables and members in javascript. i have no gripe with IIFEs. the point is in angular, like i mentioned before, is that once you start doing something past declaring the main module, like having dependencies, it starts becoming unreadable. ??? yeah that looks bad but i dont see why you even need app and common. just do it like in this guide https://github.com/johnpapa/angular-styleguide no need to expose global variables. 'angular' is the only global; you just call 'angular.module' to get/set modules Flat Daddy fucked around with this message at 17:03 on Aug 27, 2015 |
# ? Aug 27, 2015 17:01 |
|
you do have to use IIFEs usually, but its only 1 per file.
|
# ? Aug 27, 2015 17:08 |
|
that is actually how i wrote things in angular, when I just did JS by hand. I'll be very honest in saying apart from having IIFEs easily created for me I don't actually know what if any advantage I get from this code. it's typescript's direct ES5 transpilation of: code:
code:
will create a var app, and insert it into the IIFE as shown before. if anyone has some insight on this apart from "JS BAD" it would be cool.
|
# ? Aug 27, 2015 17:17 |
|
it's probably what you'd come up with yourself if you had to hack a module system on top of es5. it has to create a var because "module app {}" is creating a global value and theres no other way to do it. it makes an IIFE for each module so the module innards don't leak into global scope. it passes "app" to the IIFE in case the compiler needs to change it to (function(app_1) {...})() in the case where it needs to avoid a name conflict with something in the implementation. the (app || {}) part is so you can add stuff to the same module in multiple files i was just worried you were writing that by hand.. combining angular's module system with another module system is always gonna look like trash unforunately Flat Daddy fucked around with this message at 17:53 on Aug 27, 2015 |
# ? Aug 27, 2015 17:51 |
|
Flat Daddy posted:??? yeah hold up let me read this style guide -
|
# ? Aug 27, 2015 18:12 |
|
Valeyard posted:yeah hold up let me read this style guide - Flat Daddy posted:the (app || {}) part is so you can add stuff to the same module in multiple files ah, gotcha
|
# ? Aug 27, 2015 18:16 |
|
Valeyard posted:yeah hold up let me read this style guide -
|
# ? Aug 27, 2015 18:27 |
|
Valeyard posted:yeah hold up let me read this style guide -
|
# ? Aug 27, 2015 18:32 |
|
Valeyard posted:yeah hold up let me read this style guide -
|
# ? Aug 27, 2015 18:35 |
|
exhibit A on why angular freakin sucks. the learning curve is absurd
|
# ? Aug 27, 2015 18:39 |
|
Valeyard posted:yeah hold up let me read this style guide -
|
# ? Aug 27, 2015 18:40 |
|
so if angular sucks, what sucks less
|
# ? Aug 27, 2015 18:44 |
|
"X is the default way of doing things. if you actually do X then your code will be slow as poo poo and unmaintainable forever. btw did mention i created this framework so that designers wouldn't need to learn to code. LOL"
|
# ? Aug 27, 2015 18:45 |
|
Valeyard posted:yeah hold up let me read this style guide -
|
# ? Aug 27, 2015 18:45 |
|
Valeyard posted:yeah hold up let me read this style guide - lmao
|
# ? Aug 27, 2015 18:46 |
|
Valeyard posted:yeah hold up let me read this style guide -
|
# ? Aug 27, 2015 18:46 |
|
uncurable mlady posted:so if angular sucks, what sucks less knockout
|
# ? Aug 27, 2015 18:46 |
|
uncurable mlady posted:so if angular sucks, what sucks less basically anything. except maybe ember. that's probably worse.
|
# ? Aug 27, 2015 18:54 |
|
Shaggar posted:knockout
|
# ? Aug 27, 2015 18:55 |
|
react is simple and good. you define your page as some function that takes 'state' (mutable object) and 'props' (immutable object) and produces a full HTML DOM. then register event handlers that mutate state and your page fully re-renders accordingly. it sort of achieves the goal of writing as little in JS as possible by letting you think in the same manner you'd create a server-side HTML page. except it's happening on the client & reactjs sorts out the performance cost of the full re-render by turning it into the minimum amount of DOM manipulations necessary this is so much better because it removes a mental burden, the huge state space of GUI's & the terribleness of DOM. compare this with angular which is just like "put your dom manipulations in these kind of files, put your model manipulations in these kinds of files", etc. Flat Daddy fucked around with this message at 19:18 on Aug 27, 2015 |
# ? Aug 27, 2015 19:15 |
|
I'm messing around with Websharper at work whenever I can and it's retardedly nice, I'm going to be real sad when I find out its warts. "hmm wait actually I want to do this part client-side after all" *cut and paste code from [<Rpc>]Server.GetWidgets() to [<JavaScript>]Client.LoadWidgets(), everything still works*
|
# ? Aug 27, 2015 19:27 |
|
Flat Daddy posted:react is simple and good. i've looked into react, and with the development of relay it just made me more curious. the idea of representing the UI as small maintainable and extensible pieces is cool. the biggest downside i read about was how heavy it is for larger sites. something about how it uses a virtual DOM before transitioning over to the DOM. i assume that facebook's main page actually implements react, and it's not exactly the quickest load in the world. thoughts?
|
# ? Aug 27, 2015 19:27 |
|
Flat Daddy posted:react is simple and good. this is also why elm is good
|
# ? Aug 27, 2015 19:44 |
|
NihilCredo posted:I'm messing around with Websharper at work whenever I can and it's retardedly nice, I'm going to be real sad when I find out its warts. yeah websharper is badass
|
# ? Aug 27, 2015 22:06 |
|
Arcsech posted:yeah websharper is badass i think u mean piss
|
# ? Aug 27, 2015 22:18 |
|
pepito sanchez posted:i've looked into react, and with the development of relay it just made me more curious. the idea of representing the UI as small maintainable and extensible pieces is cool. the biggest downside i read about was how heavy it is for larger sites. something about how it uses a virtual DOM before transitioning over to the DOM. i assume that facebook's main page actually implements react, and it's not exactly the quickest load in the world. thoughts? knockout's component model lets you split everything out into maintainable pieces and you can use require.js for loading them. by listing dependencies inside your component's module definition, the component can be entirely self contained. that way you just plop it where you want it and it wires itself up instead of doing a bunch of javascript in the parent object and then passing it to the component. and since ur using requires.js anything that was previously loaded for the root, or other components is already there and available to components. so you aren't doing anything like loading dependencies over and over nor are you loading dependencies that aren't in use. note that this is for single page applications. if you aren't doing an spa for the love of christ just use razor.
|
# ? Aug 28, 2015 00:54 |
|
pepito sanchez posted:i've looked into react, and with the development of relay it just made me more curious. the idea of representing the UI as small maintainable and extensible pieces is cool. the biggest downside i read about was how heavy it is for larger sites. something about how it uses a virtual DOM before transitioning over to the DOM. i assume that facebook's main page actually implements react, and it's not exactly the quickest load in the world. thoughts? It is faster than Angular, hands down. You can get around the initiation time of Reacts initial render by prerendering it on the server, but once you're in a view with mutations, it'll do it faster than Angular in most cases. The only reason ANgular would feel faster in an initial render is because the templates are DOM, so it can render that DOM straightaway, but the bootstrapping process of actually taking data and turning it into stuff is still slow in Angular, especially with a lot of data binds. The virtual DOM is a far faster way to perform mutations, which is why everyone is copying that approach now (Ember, Can.js, mercury, riot, etc etc)
|
# ? Aug 28, 2015 01:37 |
|
Maluco Marinero posted:It is faster than Angular, hands down. You can get around the initiation time of Reacts initial render by prerendering it on the server, but once you're in a view with mutations, it'll do it faster than Angular in most cases. The only reason ANgular would feel faster in an initial render is because the templates are DOM, so it can render that DOM straightaway, but the bootstrapping process of actually taking data and turning it into stuff is still slow in Angular, especially with a lot of data binds. The virtual DOM is a far faster way to perform mutations, which is why everyone is copying that approach now (Ember, Can.js, mercury, riot, etc etc) assume you have absolutely no control over the backend. is this kind of stuff still possible from the front-end or do i have to depend on the server rendering my views? sadly my *actual* work involves a genexus backend, something i can't touch and they are terrified to touch because it's literally purely generated magic code that can't be touched. angular has been the option because nearly everything worth mentioning is done from my station apart from design, and the only thing i send to the backend are ajax calls. i'm really looking forward to next week's job fair at college. this will sound horrifying, but please let me work with a ruby dev instead. fast edit: i already know knockout is faster than angular, specially with require.js. i don't think that's the same for react, but that's only from what articles i've seen. it's not so much about speed for me, but a specific need of convenience, maintainability, and limiting headaches.
|
# ? Aug 28, 2015 02:20 |
|
pepito sanchez posted:but please let me work with a ruby dev instead. ruby devs can end up being good because they know how bad code can be without any discipline
|
# ? Aug 28, 2015 02:24 |
|
i'm in the interview pipeline for a ruby job but it's devops and basically chef with some other ruby tooling if i get an offer i think i'll only take it for a cool six and a half figgies
|
# ? Aug 28, 2015 02:30 |
|
pepito sanchez posted:assume you have absolutely no control over the backend. is this kind of stuff still possible from the front-end or do i have to depend on the server rendering my views? sadly my *actual* work involves a genexus backend, something i can't touch and they are terrified to touch because it's literally purely generated magic code that can't be touched. angular has been the option because nearly everything worth mentioning is done from my station apart from design, and the only thing i send to the backend are ajax calls. i'm really looking forward to next week's job fair at college. this will sound horrifying, but please let me work with a ruby dev instead. No. React IS faster than Angular, but it depends on what you're using it for. If the backend is basically all JSON, go for it with React, but if Angular is working for you don't uproot all your code. That said, you can just bind React components from say an Angular Controller, but then you've just bloated your code with two big libraries/frameworks. In an app I'm working on we had to do that because Angular was abysmally slow on a critical part of the app, and we're gradually phasing that out so it's all React. You don't need server side rendering to do React, but it's a great way to take the bite out of initial page load, which is something EVERY non-trivial single page app will suffer regardless of framework.
|
# ? Aug 28, 2015 02:53 |
|
|
# ? May 24, 2024 05:27 |
|
MALE SHOEGAZE posted:
that's me!
|
# ? Aug 28, 2015 03:02 |