News for hackers. Stuff that matters.
Re:TypeScript at Slack by djtriptych on Tuesday April 11, 2017 @06:03PM (#14092927)
And AJAX :)

I'm also really hoping that the current crop of JS programmers learn event-driven / reactive style programming, and for that, RX is probably the best JS library out.

Re:TypeScript at Slack by nathan_f77 on Wednesday April 12, 2017 @02:39AM (#14095335)
Man, there's so many tools and styles to learn and evaluate.

I'm still relatively new to React and React Native, and have enjoyed writing some apps with Redux. It took me a while to understand the need for redux-thunk, and now I'm about to get started with redux-saga [1].

I'm totally unfamiliar with RxJS, but some of the concepts sound familiar. Do I need to learn and use RxJS if I'm already using redux and redux-saga?

I found this SO answer [2], and this post [3], which compares redux-observable and redux-saga.

This guide [4] looks pretty good, too.

[1] https://github.com/redux-saga/redux-saga

[2] http://stackoverflow.com/a/40027778/304706

[3] https://hackmd.io/s/H1xLHUQ8e

[4] https://gist.github.com/staltz/868e7e9bc2a7b8c1f754

EDIT: OK wow, as soon as you get to the "double click" stream diagram (in link [4]), it all starts to make sense. This is pretty amazing.

EDIT 2: The example on http://reactivex.io/ is also good. I didn't realize it was available for so many languages: Java, .Net, JS, Swift. This sounds like something I need to learn.

EDIT 3: This is the best programming guide I have ever read ([4]). It starts with a real problem, then goes on to show how you would solve it in RxJS in a rudimentary and familiar way. Then it expands on and successively simplifies that solution, to show how you would solve it in the idiomatic way. It's really the perfect way to learn these concepts.

> A metastream for responses looks confusing, and doesn't seem to help us at all. We just want a simple stream of responses, where each emitted value is a JSON object, not a 'Promise' of a JSON object. Say hi to Mr. Flatmap: a version of map() that "flattens" a metastream, by emitting on the "trunk" stream everything that will be emitted on "branch" streams. Flatmap is not a "fix" and metastreams are not a bug, these are really the tools for dealing with asynchronous responses in Rx.

Re:TypeScript at Slack by acemarke on Wednesday April 12, 2017 @01:12PM (#14099644)
Hi. I keep a big list of links to high-quality tutorials and articles on React, Redux, and related topics, at https://github.com/markerikson/react-redux-links . Specifically intended to be a great starting point for anyone trying to learn the ecosystem, as well as a solid source of good info on more advanced topics.

In particular, I have a category of articles for "Redux Side Effects" [0], which includes discussion of thunks and sagas, as well as comparisons between various side effect approaches. One particularly good article is "What is the right way to do async operations in Redux?" [1]. I also wrote a blog post responding to various concerns about use of thunks and sagas [2].

[0] https://github.com/markerikson/react-redux-links/blob/master...

[1] https://decembersoft.com/posts/what-is-the-right-way-to-do-a...

[2] http://blog.isquaredsoftware.com/2017/01/idiomatic-redux-tho...

Re:TypeScript at Slack by bpizzi on Wednesday April 12, 2017 @04:07AM (#14095715)
You might also like this: https://github.com/Day8/re-frame

It's not js/es6 (re-frame is a react-based redux-like framework for clojurescript) but the author does a good job at explaining how reactive programming go well with functionnal programming and immutability.

Re:TypeScript at Slack by Stoids on Wednesday April 12, 2017 @11:56AM (#14098915)
That's one of my favorite repos to point colleagues to who feel overwhelmed by modern front-end development. Doesn't get bogged down in tooling or implementation details and explains at a high level the problems all these libraries are trying to solve.

It's a good foundation to crudely explain the pieces. React-Redux connected components are responsible for domino 1, Redux reducers domino 2, effects libraries like sagas/thunks/observables domino 3, selectors/getters for domino 4, React and the VDOM abstracting most of the concerns domino 5 and 6 away from you.

Obviously not perfect, but feels like it helps with choice angst a bit.

Re:TypeScript at Slack by zghst on Tuesday April 11, 2017 @07:01PM (#14093281)
I spent a lot of the earlier parts of my life hating MS, however later after working at a .NET shop and with the late developments at the company, my love for MS is becoming near-infinite. Reactive is definitely the way to go
Re:TypeScript at Slack by mmgutz on Tuesday April 11, 2017 @07:55PM (#14093572)
It's strange but I went the other way. I started hating MS because of working in .NET. Basically, if something wasn't blessed by MS, it wasn't used.

There were open source MVC projects but since MS only blessed ASP.NET forms back then, you couldn't convince managers to use MVC. Same with IoC. Same with ORMs

I do like the new Microsoft. VS.Code is hands down the best all-around editor right now. TypeScript is awesome sauce.

Re:TypeScript at Slack by scalatohaskell on Wednesday April 12, 2017 @02:24AM (#14095271)
> There were open source MVC projects but since MS only blessed ASP.NET forms back then, you couldn't convince managers to use MVC. Same with IoC. Same with ORMs

but that's not really Microsoft's fault

Re:TypeScript at Slack by shouldbworking on Tuesday April 11, 2017 @10:19PM (#14094215)
VSCode and Typescript are stellar. In the case of Typescript, possibly industry-changing long term.

However, the .NET stack still suffers greatly from what you mentioned. The Microsoft world is like the Oracle world, you either use their stuff for everything or never touch it.

I'm confident that .NET core will change this when it's mature enough, but that's still ~2 years away.

Re:TypeScript at Slack by KurtMueller on Wednesday April 12, 2017 @01:19AM (#14094979)
> In the case of Typescript, possibly industry-changing long term.

I feel that way about a related Microsoft product, F#. It's too bad that it doesn't get the same amount of love as Typescript. I think it's more powerful yet just as easy to use in almost every way - I never knew how powerful or expressive algebraic data types could be until I used F#.

Re:TypeScript at Slack by NicoJuicy on Wednesday April 12, 2017 @06:49AM (#14096438)
Too bad nobody gives an example. Check out http://fsharp.github.io/FSharp.Data/ for an example why f# is 'powerful'
Re:TypeScript at Slack by mattferderer on Wednesday April 12, 2017 @12:47PM (#14099414)
Repeating myself a bit in this thread. If you love F#, try checking out Fable &/or Reason. Fable compiles F# to JavaScript and Reason is Facebook's attempt at OCaml to JavaScript. F# !== Ocaml but F# == Ocaml
Re:TypeScript at Slack by daxfohl on Tuesday April 11, 2017 @11:57PM (#14094634)
I've gone, and continue to go, both ways simultaneously. They put a lot of effort into creating awesome experiences to bring developers on board. They also run a business that caters to clients who need "enterprisey" stuff backwards compatible with COBOL.NET or whatever and try to push that along with the good stuff. So it goes. I can't complain too much.
Re:TypeScript at Slack by bobwaycott on Tuesday April 11, 2017 @10:10PM (#14094189)
I started here, too. First production app was an early C# ASP.NET OSHA safety management and training platform for Mohawk carpets, built from the ground up back in 2007-08. Experienced all these headaches. Next major project was Python-based. Never went back to .NET.
Re:TypeScript at Slack by NicoJuicy on Wednesday April 12, 2017 @06:51AM (#14096445)
Asp.net forms was a monster. Asp.net Mvc was not
Re:TypeScript at Slack by bobwaycott on Wednesday April 12, 2017 @01:56PM (#14100047)
The MVC variety was barely getting started when I was working at the time.