--
You received this message because you are subscribed to the Google Groups "F# Web Stack" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web-stack-fs...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
HII think a comprehensive tutorial giving strong guidance on how to do full stack F# web development is sorely needed. This should show how to do:
- Web pages
- API's
- SPA
- Database access for relational and NoSQL databases
- Authentication and Authorisation using something like OpenID connect
At the moment the F# web story is very confusing for any newcomer.
Great idea. What / who would target audience be? If towards the existing ASP .NET community perhaps one demo would be to try to target the typical data-driven website that many devs use.
How that would be done is an interesting question because obviously Razor etc. is a no-go (AFAIK) for presentation tier purposes. But for the backend this would be an excellent opportunity to demonstrate type providers for sourcing data, and records etc. as a means to expose data easily.
For such a demo I would be wary of putting in anything ML in as that might muddy the waters somewhat.
I like the idea of a generic tutorial structure though - would help a lot.
I think it is important that the sample include showing how to deal with authentication and authorization in a modern way i.e. using something like oauth2 or OpenID connect. Every app out there needs this, it is a minefield for unexperienced developers and no samples show how this works. BTW i am willing to put in some time on this project if a can be usefull, even though I am not an experienced developer at this level. Even if I can just help with documentation
That’s true, although I believe MS are now accepting pull requests for the MSDN docs for F# - Ryan, I believe that you had some PRs accepted on this recently?
The data access story is an interesting one in that there are several sub-stories for F# that meet different needs. For example, the EF provider is (IMHO) a decent option if you want to do a “lift-and-shift” from an EF4 C# / VB library. However, there are so many other SQL TPs out there. Ross’s one is in some ways similar to a conventional ORM albeit it adds several very nice features on top. On the other hand the SQL TP is possibly a better fit for e.g. CQRS-style models where you don’t want to have some pervasive domain model that lives in the DB and everything comes from. Certainly from a Web API point of view, where you might have multiple renderings of your data, it made more sense to me to use that one instead.
From: web-st...@googlegroups.com [mailto:web-st...@googlegroups.com] On Behalf Of james...@gmail.com
Sent: 15 September 2014 12:39
To: web-st...@googlegroups.com
Subject: Re: Music Store Tutorial
I think what is missing from the tutorial as proposed is playing to F# strengths from a C# dev point of view. One of the problem with using C# imperative is you get a bunch of spaghetti code for all of your business rules. Moving to an OO solution using design patterns leads to different sets of problems -> specifically deeply nested hierarchies and overly complex constructs that have nothing to do with solving the problem. I think showing discriminated unions and pattern matching would be awesome -> assuming that there is actually business rules in the original app. If not, we would have to build some. Also, once that is done, we could show functional composition. I think Scott W's Railway Oriented Programming would be great -> there are plenty of web devs who think off the happy path and hate the amount of code bloat you get with structured exception handling.
--
I think what is missing from the tutorial as proposed is playing to F# strengths from a C# dev point of view. One of the problem with using C# imperative is you get a bunch of spaghetti code for all of your business rules.
Moving to an OO solution using design patterns leads to different sets of problems -> specifically deeply nested hierarchies and overly complex constructs that have nothing to do with solving the problem. I think showing discriminated unions and pattern matching would be awesome -> assuming that there is actually business rules in the original app. If not, we would have to build some.
Also, once that is done, we could show functional composition. I think Scott W's Railway Oriented Programming would be great -> there are plenty of web devs who think off the happy path and hate the amount of code bloat you get with structured exception handling.
I think simply showing how to do the same thing in F# from C# is not a good enough case to get people to switch. I think they will switch if F# removed some of the larger pain points in using C#:1) Everyone hates the amount of work/code/files Entity Framework brings (Type Providers)2) Everyone hates the amount of work/code it takes to build good business rules that are 100% correct and then exten them (Pattern Matching and Discriminated Unions)3) Everyone hates the amount of work/code it takes to do structured exception handing (ROP)4) Everyone hates the bloat of XML code comments (not sure how to do in F# better)
That’s true, although I believe MS are now accepting pull requests for the MSDN docs for F# - Ryan, I believe that you had some PRs accepted on this recently?
Ah yes, it was Reed – apologies for the confusion on my behalf there! And yes, docs are important J
From: web-st...@googlegroups.com [mailto:web-st...@googlegroups.com] On Behalf Of Ryan Riley
Sent: 23 September 2014 16:28
To: web-st...@googlegroups.com
Subject: Re: Music Store Tutorial
On Monday, September 15, 2014 7:27:51 AM UTC-5, Isaac Abraham wrote:
That’s true, although I believe MS are now accepting pull requests for the MSDN docs for F# - Ryan, I believe that you had some PRs accepted on this recently?
I wish. I haven't had time. I think Reed Copsey had some PRs accepted, though. The bigger point is that MSDN is accepting contributions to docs. We should include that as part of our goals.
--
--
You received this message because you are subscribed to a topic in the Google Groups "F# Web Stack" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web-stack-fs/gcthe2nhs9M/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web-stack-fs...@googlegroups.com.
Is there any update to the topic?I'm gonna write Master Thesis on "Application of Functional Programming to Business Applications Development" next year and thought I could create such tutorial on how to write F# Web app, and then refer to it in my master's work.Do you think that's a good idea?
--
Good point. Oftentimes you might not actually have a like-for-like – some design patterns or solutions in one often don’t exist in the other world – but perhaps there could to be a simple sort of table / chart / decision tree that answers questions like “this is what I’m trying to model – I would use this sort of pattern in OO / C# world – what would you use in F# world” e.g.
Idiomatic C# solutions | Idiomatic F# solution | |
ORM-style data access | Entity Framework | SQL Type Provider |
Raw data access | Dapper, Massive, ADO .NET | SQL FSharp Data Client |
Etc. etc.?
From: web-st...@googlegroups.com [mailto:web-st...@googlegroups.com] On Behalf Of emai...@gmail.com
Sent: 14 January 2015 17:03
To: web-st...@googlegroups.com
Subject: Re: Music Store Tutorial
As a new comer to F# from the C# ASP.NET world, this hits the nail on the head. I've decided to slowly try and introduce it into the workplace as a way to remove a lot of the extra boilerplate we have to write with C#.
--
You received this message because you are subscribed to the Google Groups "F# Web Stack" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web-stack-fs...@googlegroups.com.
As a new comer to F# from the C# ASP.NET world,
this hits the nail on the head. I've decided to slowly try and introduce it into the workplace as a way to remove a lot of the extra boilerplate we have to write with C#.
What I'm finding though, is that while available tutorials give a good intro over what's possible, they stop short of showing best implementation practices.
For example, using the SQL data type provider is FANTASTIC; but there aren't clear examples showing how to use it with a repository pattern or to then map the result to a ViewModel.
--
That's exciting news! Please feel free to reach out and ask questions when you run into problems!
but perhaps there could to be a simple sort of table / chart / decision tree that answers questions
view models would just bloat the solution
I think the thing which has helped me think about web programming in F# the most is the realisation that with F# you don't really need to build everything in to the web framework and its ideas
Great to hear that you're exploring F#, I hope you're having fun! I think you're right, as a community I think we could do better at helping people transition between C# and F# (and the web world needs that as much as any other part of the community). I'm not totally sure why we're not great at it (well, I know why *I'm* not great, but that's more obvious...)I think it's sometimes because when you get to the point where you feel like you know "enough" to start helping others, you've forgotten the things that aren't obvious as they're second nature now.I think your example is an interesting one. You'll have to forgive me for quite a simplistic understanding of what you're doing, but I think I might approach it in this way...Repository pattern: Hmmm, what do I need a repository for? I want to avoid having duplicated logic for retrieving and persisting data in lots of places. In C# the only real way to do that is to put that logic in some class, and then have everything use an instance of that class. Hmmm, what's the idea more simply? Well, putting all of the "methods" (or functions in this case) in the same place. Would it be ok if I just created a module with all of the functions in, where each of them takes an instance of the SQL Type Provider type as an argument? Maybe it would, so I'd probably start like that. That way I can pass around an instance of the data source itself, and pass it to functions which use it to retrieve data. Because modules and functions are first class, I don't need to worry about passing them around in some way.Object mapping: Do I need anything clever here to map a collection of objects? In C#, again just having plain functions becomes a bit awkward - they need to live somewhere. How about I write a function which converts DTO -> ViewModel? Ok... Now I can use that in lots of different ways. I can pass a DTO to it - I can List.map it over many DTOs... Maybe later I'll create a ViewModel -> DTO function... Now if I paired them, maybe I could do something with that? Hmmm...I'm not saying those are the right ways at all (which is probably not helping) but maybe it's usefully illustrative. I think Scott Wlaschin writes some excellent things on thinking functionally (or thinking with functions) which might help rather more than me.I think the thing which has helped me think about web programming in F# the most is the realisation that with F# you don't really need to build everything in to the web framework and its ideas. The web side of things can be a small thin layer. The rest of what's happening should just look like standard F# - if you're doing something which you wouldn't consider doing if you were writing the same logic in a console app, I've found that to be a bit of a sign that you might be able to do it more simply.Sorry for the ramble, hope it doesn't hinder your journey!A.