Ask HN: What web programming language do you use?
Our team uses web forms in .net to perform our day to day functions.
Flame wars aside, what languages do you use and what have been your experiences with them? Also, what db do you use and how well has it scaled for your larger projects? What have you had to give up to use them?
Like I say, we use web forms and sql 2008. Although it is very easy to develop, I recently picked up MVC 3 and found that the extra control you have on the render is fantastic so I am left wondering what else I am missing out on.
I plan to give myself and another developer a new language to learn and possibly a new db if it fits to see where we plan to be in the next 5 years so any input is greatly appreciated. I am trying to avoid "buzz" languages and want to learn something that is going to stay around for a while.
31 comments
[ 5.8 ms ] story [ 72.2 ms ] threadhttp://pragprog.com/book/btlang/seven-languages-in-seven-wee...
I just tried various environments (Node.js, naked PHP, PHP-ZF, some ASP.NET, naked OCaml, OCaml-Ocsigen-Eliom...) before it became clear that one of them was best suited to the way my mind works. If you're interested, I could go into more detail about that.
The languages that interest me at current are node.js, closure and i'm even looking at python.
My mind does work in a few ways to be honest, i've developed in a few languages growing up so I have had mixed experience.
We manage our own servers so there is no reason we cannot virtualise them and put Linux on them as well as IIS. We are taking the mindset now that we use the best technology for the job rather than fitting the technology to the job
So, I need a tool that helps me rewrite modules as easily as possible.
One limitation is my words-per-minute figure. A language that is short, in the sense that very little code is required to get things going, is a good thing. Javascript and OCaml qualify, but Java, C# and PHP do not because of the boilerplate involved in many operations. I guess the latest versions of C#, with lambdas and type inference, are becoming acceptable.
Another limitation is the risk of getting something wrong, and the only solution so far is having a good automated testing suite. In every programming environment, there is a sweet spot to be found between too little automated testing (you waste a lot of time hunting for bugs) and too much automated testing (you waste a lot of time writing or re-writing tests), and what matters to me is how efficient that sweet spot is. For instance, Java/C#/OCaml provide me with "undefined variable" detection for free (just compile the thing) but Javascript and PHP do not.
When written in a pure functional exception-less style, OCaml detects almost all major classes of errors simply because of its type system. Many of these would require unit tests with complete code coverage in languages like PHP or Javascript (such as calling a member function that does not exist) or Java or C# (such as preventing Null Reference errors) and some of them cannot even be verified with unit testing at all (such as forgetting to check that you are allowed to do X before doing X). In fact, I suspect the automated testing sweet spot in OCaml is precisely to have no unit tests, except for dealing with external APIs or very complex logic (regular expressions...)
Not everyone can write pure functional exception-less OCaml (or do so happily for ten hours every day), but I can. As a result, I decide on the first design that seems to be compatible with the requirements, and perform at least one or two major design changes every week. These changes involve changes to at least 5-10% of the code base (with the odd 60%) but seldom take more than an hour to perform, and so far the automated testing has caught all the errors that cropped up.
This was the purpose of this question though and so far it's inspired some good results
There will come a time when we take a massive leap of faith and change completely how we work but I don't want to jump in.
I will take a look at OCaml and see if it suits our needs as a company
Thanks again
How does speed measure up?
All fan-boyism aside I've found Ruby/Rails/Sinatra to be much more pleasurable than writing PHP/CakePHP. I can write code clearer and faster than I do at work. Now a good part of this is the fact that I'm not very passionate about what I do at my day job also.
It's hard to get a real perspective on what is the best language to use, there have been rumours rails is over the hill now but it's just what I read around the web. I suppose this is my main reason for asking this question!
I'm a bit biased, since I went from .NET to Ruby on Rails, but I realize that RoR may not have the 5 year shelf life you are looking for.
Honestly there are so many changes going in the web world, you are better off experimenting with a few and then deciding. Its impossible to say who will be on top in 2017. Its highly likely that the hot framework of 2017 doesn't exist today.
I would look at RoR, Play 2.0 with Scala, Django, and ExpressJS with Node. For front end stuff look at Backbone.
On the database side, stick with relational by default but experiment with NoSql solutions for non-critical data storage (logs, write once activity streams, etc). Get understanding of the persistence mechanisms and gotchas before fully committing.
Good luck!
I don't believe .net is the best for us, we use it because we have so much written in it and our libraries are very large.
I am currently looking at NoSQL, Mongo seems to be the one we are favouring at the minute.
The one thing that really makes me want to experiment is knowing that sites like Facebook use multiple technologies to run the site and that's how I want to be.
I currently feel stagnant and trying to make our projects fit into .net.
I appreciate your comment
The one big downside is that most of the alternatives are designed to work better with Unix based systems. That's usually a much bigger pill to swallow for an all Windows .NET shop so YMMV with pushing that.
I know a shop trying to do Node.JS on IIS so that may be an option worth looking into to see if it works. YMMV here too, because it's really bleeding edge right now.
It may be worth like you say putting it into a service that we could consume from many languages and taking it from there. Our main issue really is our admin as it relies quite heavy ContentPlaceholders as we populate them on runtime but I am more interested right now in trying new technologies
I would suggest using any non-proprietary framework and language you feel comfortable with. As a consultant, I choose whatever my customer wants, and for my own projects I choose languages and frameworks that I most enjoy using.
VS2010 was a disaster of a product in my eyes and instead of fixing it they just released another 1. Which of course we have to pay out for again.
I don't mind paying for a product, if they fix the bugs in the one you currently have!
Do you see no compromise in speed not talking directly to the db?
For small applications I can see the advantage but I have customers with 1 million products?
As for performance, our customer-facing sites are quite a bit faster then a typical DB-coupled site because page objects are fetched from a local memory cache that is invalidated by MQ processing.
Our application is not small, but not large, either. For a large application, Amazon.com is well-known for also using a SOA architecture to deliver customer-facing sites, none of which directly call the DB.
I think the first port of call for us, like other have mentioned also, is to look at the RESTful interface.
I have been looking and we can quite easily translate a lot of our current code into WCF rest endpoints which leverage caching and you can put sql dependencies on them which means we don't have to re-work a lot.
I am going to look at putting 64gb ram into our db server so we can confidently store a lot more of the db in ram cache.
We currently cache at web server level which we were moving to network caching anyway so this move is not putting us out, if you will.
This appears to give us the chance to move our front end to a different language. This also gives us the chance to play with different language using our real time data
Our success in the coming years will be defined by the decisions I make in the next two weeks so I appreciate the comments you have made
We are going to look at node.js, ROR and Closure.
We are also going to look at abstracting our our business logic to RESTful services on the top of WCF. This gives us a chance to use existing code but put it into an API.
We are also going to take a look at MongoDB.
I appreciate everyone who commented and we have not dismissed other ideas, these are just our first port of call.