Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
The page they gave us is less than 100 lines of code. It's not bad all things considered.

I just spent two hours in the Angular IRC channel and the guy there convinced me that what I'm building isn't what I should build, it can't be built in Angular, and that data binding is better and I should use it instead.

Adbot
ADBOT LOVES YOU

PlaneGuy
Mar 28, 2001

g e r m a n
e n g i n e e r i n g

Yam Slacker

Suspicious Dish posted:

The page they gave us is less than 100 lines of code. It's not bad all things considered.

I just spent two hours in the Angular IRC channel and the guy there convinced me that what I'm building isn't what I should build, it can't be built in Angular, and that data binding is better and I should use it instead.

Wait, isn't data binding the point of using angular? (serious question)

HaB
Jan 5, 2001

What are the odds?

Suspicious Dish posted:

The page they gave us is less than 100 lines of code. It's not bad all things considered.

I just spent two hours in the Angular IRC channel and the guy there convinced me that what I'm building isn't what I should build, it can't be built in Angular, and that data binding is better and I should use it instead.

This is a thing.

I have seen Angular evangelists who seem to think Angular is the end-all be-all, and will try to shoehorn it in the everything. Angular is GREAT at what it's good at, but it's simply not good at everything. It's also kinda of opaque when you first look at it. If you decide to go Angular, you really have to embrace it for the life of your app, or it's a slog. But it sounds like it just may not be the right tool in this instance.

Kekekela
Oct 28, 2004
The choice of OS's for different types of development is pretty interesting to me right now. I'm much more experienced with the MSFT/Windows stack vs anything open-source but have been working more and more in the later arena recently.

On Windows I do:
- VS development
- some open source, basically one knockout SPA that I contribute to
--- it took some tweeking to get everything working right but I hadn't yet tried linux when I started on this project so I had to get it to work

On Ubuntu VM running on Windows box I do:
- pretty much all other javascript based development, once I discovered this environment it just seemed so much easier

On my MBA which had been primarily functioning as a Spotify boombox:
- I'm actually messing around with react-native which has me dusting off my old x-code install (I'd originally decided to try a mac so I could develop for iOS, then realized I had no love for objective-C/xCode development)
- I feel like I should be more comfortable doing other javascript based development here but I still feel like I'm clunking around for anything other than react-native. I'd really like to get better at this so that this could be my primary development environment except for work-related ASP.NET/C# stuff

aBagorn
Aug 26, 2004

Kekekela posted:

On my MBA ...
...primary development environment except for work-related ASP.NET/C# stuff

We're very close to getting rid of that "except."

Once the .NET framework is stable and able to be used cross-platform I'm probably going to move over to working on my MBP full time when I'm not at the office

mpaarating
May 6, 2011

The Baddest Boi

Thermopyle posted:

No, angular is pretty bad when measured on the comprehensibility-to-someone-who-hasn't-learned-it scale.

You're probably right. Oh god, I'm probably at the top of one of these curves right now.

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

mpaarating posted:

You're probably right. Oh god, I'm probably at the top of one of these curves right now.



Here's my version of that graph:

Only registered members can see post attachments!

luchadornado
Oct 7, 2004

A boombox is not a toy!

Lumpy posted:

Here's my version of that graph:



Was working on my own version.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
needs the part where they announce angular 2.0 and the graph goes negative

Stoph
Mar 19, 2006

Give a hug - save a life.
The best part is that many Google engineers have expressed desire to use React.js instead of Angular but they can't because of insane bullshit like the React.js PATENTS file:

https://github.com/facebook/react/pull/3554

One commentor mentioned their company's lawyers cleared that the code is licensed as BSD so they could just fork React.js and remove the file... :psyduck:

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
That's not how that works.

SuicideSnowman
Jul 26, 2003
I actually find Angular quite easy to work with but couldn't figure out how to do simple poo poo in React. Granted, I didn't spend a lot of time with it because I'm already well versed in Angular and it works perfectly fine for the application I'm creating.

aBagorn
Aug 26, 2004

SuicideSnowman posted:

I actually find Angular quite easy to work with but couldn't figure out how to do simple poo poo in React. Granted, I didn't spend a lot of time with it because I'm already well versed in Angular and it works perfectly fine for the application I'm creating.

This is me. Something just 'clicked' with angular (probably hit that first or second peak on the graph) and I'm in too deep to try to get my head around anything else right now. After we ship this project I'll probably give React a go (or revisit Ember, which I hated first go round)

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
It's finally deployed: https://endlessm.com/

Source code at https://endlessm.com/landing-page/build/js/timer.js

Workaday Wizard
Oct 23, 2009

by Pragmatica

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

Stoph posted:

The best part is that many Google engineers have expressed desire to use React.js instead of Angular but they can't because of insane bullshit like the React.js PATENTS file:

https://github.com/facebook/react/pull/3554

One commentor mentioned their company's lawyers cleared that the code is licensed as BSD so they could just fork React.js and remove the file... :psyduck:

Looks like that may have changed?

https://code.facebook.com/posts/1639473982937255/updating-our-open-source-patent-grant/

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

should be fixed now.

gbaby
Feb 6, 2015
My site has a team page and several player pages and a giant JSON file with nested objects (player info, individual game stats, etc.). The player pages will all have the same views but display a players unique stats, while the team page will have it's own views that display stats from each player on the team.

Now I want to do the following: cherry pick particular fields from the JSON file, do some manipulation/calculation with the data (get average for instance), and display the results on a particular page or view. I'm new at MVC/SPA's and am having trouble figuring out what front end framework/library to use or if I should just use templates and JS/jQuery because users won't be adding/deleting or changing anything. I simply want to manipulate the JSON data programmatically before it's rendered on the page/view.

I've messed around with the basics of Backbone, Angular and Knockout a little bit and I'm wondering if it's overkill to use one for this case because I don't need things like data binding or controllers yet (or do I?). While reading this thread I found React which looks interesting since apparently "lots of people use React as the V in MVC", which may be what I need?

Skandranon
Sep 6, 2008
fucking stupid, dont listen to me

gbaby posted:

My site has a team page and several player pages and a giant JSON file with nested objects (player info, individual game stats, etc.). The player pages will all have the same views but display a players unique stats, while the team page will have it's own views that display stats from each player on the team.

Now I want to do the following: cherry pick particular fields from the JSON file, do some manipulation/calculation with the data (get average for instance), and display the results on a particular page or view. I'm new at MVC/SPA's and am having trouble figuring out what front end framework/library to use or if I should just use templates and JS/jQuery because users won't be adding/deleting or changing anything. I simply want to manipulate the JSON data programmatically before it's rendered on the page/view.

I've messed around with the basics of Backbone, Angular and Knockout a little bit and I'm wondering if it's overkill to use one for this case because I don't need things like data binding or controllers yet (or do I?). While reading this thread I found React which looks interesting since apparently "lots of people use React as the V in MVC", which may be what I need?

Angular is a good candidate for this as well, it works very well with JSON data like you describe. Take a look at the Official https://docs.angularjs.org/tutorial (warning, Bower & other poo poo we've been complaining about for the last 2 pages ahead), it pretty much is your application, but for displaying phones.

Urit
Oct 22, 2010

Suspicious Dish posted:

should be fixed now.

Haha nope:

SSL connection error

Unable to make a secure connection to the server. This may be a problem with the server, or it may be requiring a client authentication certificate that you don't have.
Error code: ERR_SSL_PROTOCOL_ERROR

Actual content:

I'm an systems eng. person ("devops" :laffo:) who is building a bunch of monitoring stuff at work. I know some things about JavaScript but not a whole lot. I'm staring a bunch of webdev work in the face right now because I need to write a dashboard because Kibana and Grafana are steaming piles of poo poo when you try to use them for multitenant access. Is there any sort of framework that people here recommend for data-heavy operations? Lots of points in time series data that need to be converted into graphs, displayed in tables, and so on. I'm trying to give people more data to ignore when making decisions, but I want to do it in a way that I learn something from too.

Urit fucked around with this message at 22:36 on Apr 10, 2015

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
one of our sysadmins hosed up the dns, it's fixed but might take time to propagate.

Pollyanna
Mar 5, 2005

Milk's on them.


Suspicious Dish posted:

We got an Angular site shipped from some external contractor. I've been trying to hack on it to add simple functionality and it's the most insane thing I've ever done.

Angular is an incomprehensible mess and I can't figure out how to do anything in it.

Finally, you and I agree on something. I'm working on a beast of an Angular project and it makes me weep.

Skandranon
Sep 6, 2008
fucking stupid, dont listen to me

Pollyanna posted:

Finally, you and I agree on something. I'm working on a beast of an Angular project and it makes me weep.

This is really more on the person who made the mess than Angular.

binhex
Aug 17, 2008

Urit posted:


I'm an systems eng. person ("devops" :laffo:) who is building a bunch of monitoring stuff at work. I know some things about JavaScript but not a whole lot. I'm staring a bunch of webdev work in the face right now because I need to write a dashboard because Kibana and Grafana are steaming piles of poo poo when you try to use them for multitenant access. Is there any sort of framework that people here recommend for data-heavy operations? Lots of points in time series data that need to be converted into graphs, displayed in tables, and so on. I'm trying to give people more data to ignore when making decisions, but I want to do it in a way that I learn something from too.

I'm not sure if it fits your requirements exactly, but I've enjoyed using dashing-js https://github.com/fabiocaseri/dashing-js which is a javascript port of the ruby Dashing project http://dashing.io/. Pretty easy to make really nice looking "realtime" dashboards and they have some nice widgets that go along with it, including graphs.

Demo here (ruby version): http://dashingdemo.herokuapp.com/sample

Urit
Oct 22, 2010

binhex posted:

I'm not sure if it fits your requirements exactly, but I've enjoyed using dashing-js https://github.com/fabiocaseri/dashing-js which is a javascript port of the ruby Dashing project http://dashing.io/. Pretty easy to make really nice looking "realtime" dashboards and they have some nice widgets that go along with it, including graphs.

Demo here (ruby version): http://dashingdemo.herokuapp.com/sample

Oh my god this is perfect. I was going to use d3.js to generate graphs but this is basically management catnip. Whom the gods would destroy, they first give real-time analytics and all that.

Now I just need to find something that does infinite windowed scrolling (a line comes in from a websocket or longpoll endpoint, it gets prepended to a list of elements and the last element gets hacked off the bottom and discarded) and I'm set. Thanks a bunch!

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

gbaby posted:

My site has a team page and several player pages and a giant JSON file with nested objects (player info, individual game stats, etc.). The player pages will all have the same views but display a players unique stats, while the team page will have it's own views that display stats from each player on the team.

Now I want to do the following: cherry pick particular fields from the JSON file, do some manipulation/calculation with the data (get average for instance), and display the results on a particular page or view. I'm new at MVC/SPA's and am having trouble figuring out what front end framework/library to use or if I should just use templates and JS/jQuery because users won't be adding/deleting or changing anything. I simply want to manipulate the JSON data programmatically before it's rendered on the page/view.

I've messed around with the basics of Backbone, Angular and Knockout a little bit and I'm wondering if it's overkill to use one for this case because I don't need things like data binding or controllers yet (or do I?). While reading this thread I found React which looks interesting since apparently "lots of people use React as the V in MVC", which may be what I need?

If all you're looking for is manipulation/querying of the JSON, is lodash along the lines of what you're looking for?

The frameworks like Angular or React don't really have much to do with manipulation of JSON.

If you're wanting a SPA framework as well as something for working on the JSON, Angular or React are fine (use React). There's not much reason to consider React too heavyweight for any SPA.

Thermopyle fucked around with this message at 00:33 on Apr 11, 2015

uncleTomOfFinland
May 25, 2008

Thermopyle posted:

No, angular is pretty bad when measured on the comprehensibility-to-someone-who-hasn't-learned-it scale.

As far as JS frameworks go I found Angular rather easy to learn considering it's scale. Maybe it's because I have an affinity for Google stuff and my main language is Java.

enthe0s
Oct 24, 2010

In another few hours, the sun will rise!
I'm trying to attach an event handler to each of my Tile components in React. This is exactly how the docs say to do it, but I get "Uncaught TypeError: Cannot read property 'bind' of undefined" when I try this. What am I doing wrong?

code:
var TileList = React.createClass({
  handleClick: function(i) {
    console.log('You clicked: ' + this.props.tileData[i]);
  },
  render: function() {
    var tileData = shuffle(this.props.tileData);
    return (
      <ul className="tileList">
        {tileData.map(function(tile, i) {
          return (
            <Tile key={i} reactKey={tile.id} tileValue={tile.tileValue} tileColor={tile.tileColor} onClick={this.handleClick.bind(this, i)}></Tile>
          );
        }, *this*)}
      </ul>
    );
  }
});
Found it. I forgot to pass along *this* which I have now put into the original code.

Actually, I have a different problem now. The code runs, but nothing's happening when I click on a tile. I have some other click handlers that are on the Tile component which fire off just fine, but the one bound to the TileList isn't doing anything...

enthe0s fucked around with this message at 05:04 on Apr 19, 2015

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

enthe0s posted:

I'm trying to attach an event handler to each of my Tile components in React. This is exactly how the docs say to do it, but I get "Uncaught TypeError: Cannot read property 'bind' of undefined" when I try this. What am I doing wrong?

code:
...
Found it. I forgot to pass along *this* which I have now put into the original code.

Actually, I have a different problem now. The code runs, but nothing's happening when I click on a tile. I have some other click handlers that are on the Tile component which fire off just fine, but the one bound to the TileList isn't doing anything...

Post a fiddle with your current code, as it will help us help you immensely.

enthe0s
Oct 24, 2010

In another few hours, the sun will rise!
https://jsfiddle.net/69z2wepo/6685/

I left out some stuff I don't really think is relevant, but I can edit and include them if necessary.

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

enthe0s posted:

https://jsfiddle.net/69z2wepo/6685/

I left out some stuff I don't really think is relevant, but I can edit and include them if necessary.

You never set an onClick on your TileList, so no click on it is handled. I'm not sure if that's what you mean though. Also, I'm on my phone now so I might be missing something :v:

Your code seems very "un-React-like". There is a ton of logic in the tile, when it probably just wants to be a dumb view that calls whatever was passed to it as an onClick and that's it. The state of the game should live in a single place, so Tiles know nothing about it at all.

Lumpy fucked around with this message at 22:51 on Apr 19, 2015

The Merkinman
Apr 22, 2007

I sell only quality merkins. What is a merkin you ask? Why, it's a wig for your genitals!
What is a good resource for learning AngularJS? Having to pay $ for it is fine. I've done the free Shaping Up with Angular codeschool course, but at this point I'm not sure what direction to go, especially given the whole 1.3 -> 2.0 thing.

sim
Sep 24, 2003

https://thinkster.io/a-better-way-to-learn-angularjs/ - I think mostly free links, including a lot pointing to egghead.io (their paid courses are great too)

luchadornado
Oct 7, 2004

A boombox is not a toy!

The Merkinman posted:

What is a good resource for learning AngularJS? Having to pay $ for it is fine. I've done the free Shaping Up with Angular codeschool course, but at this point I'm not sure what direction to go, especially given the whole 1.3 -> 2.0 thing.

It gets said so much in this thread, but a lot of people jumped to React because of your exact confusion over the 1.3 -> 2.0 thing. I know every question about Angular shouldn't have "use React" as the answer, but on the other hand I think you're currently at where a lot of us were a year ago, wondering what the hell to do with Angular. So I'd at least check it out if it's not a hard requirement. That said, I never really found a good tutorial for it, and most of my learning was by trying new things and reading the Google Groups stuff. I'd like to hear what resources other people know about.

luchadornado fucked around with this message at 15:47 on Apr 20, 2015

Skandranon
Sep 6, 2008
fucking stupid, dont listen to me

The Merkinman posted:

What is a good resource for learning AngularJS? Having to pay $ for it is fine. I've done the free Shaping Up with Angular codeschool course, but at this point I'm not sure what direction to go, especially given the whole 1.3 -> 2.0 thing.

I had a lot of luck with NG-Book (Amazon or filez), it did a good job of explaining things and had good examples. The 1.x -> 2.0 route isn't as uncertain as it used to be, the Angular team recently announced there should be a smooth upgrade path, and they have definite plans up to 1.5, and probably more after that. Once you get how Angular wants you to structure your code, it makes a lot more sense and you feel like you aren't fumbling around so much. Directives are tough, but you get them eventually if you keep at it.

It helps a lot to be working on something larger than a ToDo list application, you get to flesh things out much more that way, but finding something like that can be tricky. Things with animation and lots of timers give you a good idea how the $digest loop works(and sometimes, doesn't).

Skandranon fucked around with this message at 16:23 on Apr 20, 2015

Heskie
Aug 10, 2002
I know this must get asked loads, but is there a definitive book/guide/series to learning pure JavaScript in 2015? Not Angular/React/Flux/whatever, although I am interested in these too.

I've been a Web Developer for 6+ years now and think its about time I actually learnt how to write better JavaScript since its not going away any time soon and I've avoided it for long enough.

React does look very nice though, I'll be trying it out on my next project.

jkyuusai
Jun 26, 2008

homegrown man milk

Heskie posted:

I know this must get asked loads, but is there a definitive book/guide/series to learning pure JavaScript in 2015? Not Angular/React/Flux/whatever, although I am interested in these too.

I've been a Web Developer for 6+ years now and think its about time I actually learnt how to write better JavaScript since its not going away any time soon and I've avoided it for long enough.

React does look very nice though, I'll be trying it out on my next project.

http://eloquentjavascript.net/ is a good start, IMO.

Heskie
Aug 10, 2002

This looks great, thanks a lot.

Skandranon
Sep 6, 2008
fucking stupid, dont listen to me
I found java script: The Good Parts to be very helpful, in part because I still don't like a lot about what is in Javascript and the book helps you avoid the terrible parts.

Adbot
ADBOT LOVES YOU

Skiant
Mar 10, 2013

Skandranon posted:

I had a lot of luck with NG-Book (Amazon or filez), it did a good job of explaining things and had good examples. The 1.x -> 2.0 route isn't as uncertain as it used to be, the Angular team recently announced there should be a smooth upgrade path, and they have definite plans up to 1.5, and probably more after that. Once you get how Angular wants you to structure your code, it makes a lot more sense and you feel like you aren't fumbling around so much. Directives are tough, but you get them eventually if you keep at it.

It helps a lot to be working on something larger than a ToDo list application, you get to flesh things out much more that way, but finding something like that can be tricky. Things with animation and lots of timers give you a good idea how the $digest loop works(and sometimes, doesn't).


Seconding ng-book, also check out this styleguide.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply