31 karma · joined Dec 24, 2013 (12y ago) · 20 submissions
comment 11y ago · link · parent
I found myself using F# for core libraries with clearly defined boundaries between APIs and assemblies - IMO that's where the language shines right now. You can have your core logic contained in a library with a separate, C#-compatible API.
Using F# for WPF, ASP.NET MVC or ASP.NET WebAPI development wasn't quite as stellar experience, also because of the state of the tooling. I'm even wary about type providers, when they work - it's great, when they don't - you're pretty much screwed with no real recourse. In case of relational DB access, most .NET libraries (both full-ORMs and micro-ORMs) are C#-oriented.
Therefore, after including all the annoyances you listed, it's hard to justify anything more than 'handle core libraries in F# with C#-compatible API, do the rest in C# - it's good enough' to the business...
comment 11y ago · link · parent
Honorable mention for the application that you probably have in mind can go towards (IMO) React UI Builder which was posted to HN a few days ago (https://github.com/ipselon/react-ui-builder).
comment 11y ago · link · parent
Do you actually support 'full remote' positions? I'm asking because the application system on your site has 'Permanent legal right to work in the United States.' listed as one of the requirements.
The platform I know best (.NET) seems to align with what you're looking for, but working in and/or moving to US is not really an option. Time zone wouldn't be an issue though.
comment 11y ago · link · parent
Also, a lot of the points the article makes about the senior engineer seem to be about a 'business sense' - what the actual business problems you're solving are and how your solutions influence the business itself. I really like to know all that - in fact, those are my starter questions as a candidate in any job interview - but I don't know if it's just an innate trait that some people have, if it's something you pick up, or maybe both to a degree...?
And I don't consider myself a senior engineer, not by a long shot...
comment 11y ago · link · parent
I mean, I mostly work with C# and F# on the back-end, but I created my fair share of WPF apps which I vastly prefer to web front ends. I also tinker with Scala in my free time, but I don't really know much about the JVM ecosystem.
I also readily admit I know next to nothing (neither have a feeling for) the UI/UX design, which is why I usually relied on libraries like MahApps; lately I had my eye on Material Design for WPF.
Considering my contract is up soon(ish), what you're offering looks tempting. :)
All things considered, I still feel compelled to ask: do you have a salary range or is it discussed individually? Or both, to a degree?
comment 11y ago · link · parent
On the other hand, I wonder if it wouldn't be easier to ship a T4 template? I know for sure that would integrate with VS (both the IDE and build process) without any issues, not sure about Xamarin Studio...
comment 11y ago · link · parent
Technically, I implemented some of that stuff myself because I needed REST client that would work with PCLs and be a bit 'nicer' to use than just juggling strings/routes everywhere, so using annotations and wrapping Microsoft's HttpClient was obvious and relatively easy way out.
Anyway, I'll probably just phase out my own solution and start using the library.
[EDIT]
After checking it out, RefitStubs.cs file seems a little bit clunky, but the library as a whole looks solid enough. I'll look further into it.
comment 11y ago · link · parent
Summary:
Benchmark: C# (Mono) - 1052.041381 ms, Java - 597.9874 ms
My machine: C# (Windows) - ~475 ms, Java - ~552 ms
Even considering that Mono is using maximum precision available (so instead of floats it's using doubles), when I swapped all floats to doubles it still ran in ~525 ms on my box.
So while Mono might be 'getting there', sometimes it's still lagging behind. It's just something to keep in mind :)
comment 11y ago · link · parent
I hope it's one of the pain points they will address and solve during their rewrite to EF7 at one point.
That being said, my opinion is that unless you have really strict performance and/or latency requirements, EF should be good enough. At least for simpler queries and in 'longer-running' applications :)
comment 11y ago · link · parent
On the other side, if you need to work extensively with stored procedures or you have complicated or custom SQL to run, Dapper (or Insight.Database - https://github.com/jonwagner/Insight.Database, a library which I found really nice to use) will be your best friend.
comment 12y ago · link · parent
- Accessing the DB is easier in C# (just select a nice micro-ORM), type providers do not always cut it.
- When using any kind of library that relies on anonymous types (e.g. Dapper for database access).
- Tooling is still not complete, not being able to create directories in F# project (!) from IDE level (and even if you edit .fsproj, it can be a bit buggy) is really annoying in both web and desktop apps.
- If you want to use some of object-oriented features e.g. co/contravariance in interfaces, protected access modifier.
- (admittedly, that does not happen often) no unsafe context/keyword
That being said, I agree that F# has a very sane set of defaults and I really like using F# for library work.
comment 12y ago · link · parent
There's one valid (if obscure) use case for it, other than that it is pretty much redundant: http://stackoverflow.com/q/4488727/1180426
All modern (micro)ORMs, even if they're just a thin wrapper over ADO.NET like Dapper, work just fine with regular nulls.
comment 12y ago · link · parent
ORMs get a lot of flak and while some of it is truly earned, the rest comes from the misuse/abuse of the tool. I always thought that using ORM functionality (where convenient) together with SQL (where necessary or convenient for different facet of the application) was the best from both worlds.
And then you can of course mix different ORMs in one project, so you can use EF in areas where performance does not really matter that much or if you're doing a lot of CRUD and Dapper (or something like Insight.Database if you like stored procedure-to-interface mapping) in hot paths or analytic-heavy piece.
comment 12y ago · link · parent
In EF, there's either: Database.SqlQuery<T> - http://msdn.microsoft.com/en-us/library/gg696545%28v=vs.113%...
which can return any object or: DbSet<T>.SqlQuery - http://msdn.microsoft.com/en-us/library/gg696332%28v=vs.113%...
which returns tracked entities, so you can write raw SQL (e.g. call a stored procedure) and just use the 'mapper' part of the framework.
NHibernate has CreateSQLQuery - http://www.nhforge.org/doc/nh/en/#querysql-creating
I like micro-ORMs, but when you want to skip writing tedious INSERT or UPDATE queries, you have to add extensions to them (at least to Dapper); that, and SQL strings do not really lend well to refactoring and type safety...
comment 12y ago · link · parent
The `using` static is actually really good news. I have seen people who seem to be really mad about it, but sometimes it would be nice to have, for example:
// Something like Scala's 'Predef'
public static class Id<T>
{
public static Func<T, T> Identity { get { return x => x; } }
}
and then do: using Id;
var grouped = list.GroupBy(Identity);
Considering you can already open modules in F# (which are compiled down to static classes), it seems that feature found its way to C#. So maybe there is still hope for pattern matching and tuple support :)Equivalent of F#'s record types would be also awesome, which is what you put as 'readonly class':
type Person = { FirstName : string; LastName : string }
let single = { FirstName = "Jane"; LastName = "Doe" }
let married = { single with LastName = "Smith" }comment 12y ago · link · parent
In the meantime, honest question: what are modules in OCaml? I tried to read up on it online, but my understanding of the topic is still murky. Regular modules don't really seem that interesting (they look like modules and/or types/classes in F#), parametrized modules seem to be something that is missing in F#.
Second question, do you have that proof of concept code laying somewhere around? I'm just curious how it would look in F#...