views:

185

answers:

2

I don't know much F# and i never used a functional programming language in the past (i was interested in oCaml). I am about to rewrite my entire website and i think i want to do it in F#. I would like to know if there is anything i should know about before starting or development.

NOTE: The site is fairly large and MUST be maintained for many years.

+11  A: 

The things you should know about X before starting any large project with it are the things you learnt about X in your first few small projects.

The preceding statement is true for all values of X. It's true within and without the computer industry. You may, if you so wish, consider it a good life rule as well.

Bottom line: if you're starting a big project where you're not intending to throw away the first few versions totally, don't do it in a language you have no experience in. You will almost certainly fail.

paxdiablo
`throw away the first few versions`, why can't I just refactor it?
Baddie
What Baddie said. I don't mind throwing the first few version but what might hurt me in the long run?
acidzombie24
Complex code written in a language that you have no experience in will probably be easier to rewrite than refactor, once you've garnered some knowledge. It doesn't matter how much you re-organise a stool sample, it's still a steaming pile of ... :-)
paxdiablo
And what will hurt you in the long run is writing C code in F#, ie, not accepting the new paradigm when developing. That's why you learn something new (and functional programming _is_ genuinely different, not like the transition from Pascal or BASIC to C) by doing small or throwaway projects.
paxdiablo
ha, i just remembered some C perl code. That was horrible. +1. I just hope more people will answer this question. I did check out benchmarks and was surprise to hear F# matched C#. Although i do want to investigate more.
acidzombie24
It takes time to get use to functional programming let alone a new language such as F#. After about 200 hours of using F# I did a medium size personal project (5k lines of code). It was fun and I learned a lot but I refactored it several times. Looking at SVN I'd say only 10% of the code didn't change. A more recent project I did (for work no less) in F# came out much different. It was a smaller project (2k lines) but more complex (multi-threaded). It ended up requiring very little refactoring. This was after about 8 months (500 hours) of dev time in F#. You millage may vary.
gradbot
+1  A: 

The right tool for the right job. Does Functional programming help with websites, probably much of a muchness. Classes do help a lot as does the ability to use generics, the only place where I see F# being a force would be when your doing some complex pipe lining of events, functions or other functional style of operation. When it comes to web stuff everything should be seen as a stream of data, so in that respect yes f# is a good choice. A good data modelling language, I'm not so sure.

WeNeedAnswers
I hear/see people say "The right tool for the right job." all the time but what I've found in the work place is that a sharp hammer works better than a dull screw driver.
gradbot
The work place, hmmm is this the same place where the decisions are made by guys in suits who rub their hands at signing contracts for money? I agree , the state of play in the work place is bad, but be an objector, if they disagree nothing is lost, if they are agree then your a hero. On a downside, you might be seen as a trouble maker! :)
WeNeedAnswers