TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: Experienced C programmer, new to web, which language/framework to use?

44 点作者 architgupta大约 14 年前
I am an experienced programmer in C (mostly systems / file systems and networking code, writing high performance code). I also have a lot of programming experience in C# (college and internships)<p>I want to build a rich webapp, which will be a platform for others to create content. So the webapp will need to evolve continuously.<p>I have some experience of building a webapp in asp.net MVC (Microsoft's ruby-on-rails clone). What I am unhappy about in the Microsoft world is - lack of a good ORM, software licenses (offset by BizSpark), good deployment tools (appharbor is solving the issue but they are still a bit new).<p>I am an ok programmer in both ruby and python. But I am fluent in C# (with the new language primitives, its fairly equivalent, you can also write stuff in F#).<p>I can pick up a language fairly quickly if the framework enables an order of magnitude quick web development than other platforms.<p>My experience has been painful with ORMs so if a framework has a good answer I think that win alone seems fantastic.<p>[Edit: ORM issues: Number one issue was migrations on a live site. We ended up doing most ORM by hand to deal with no good framework support for migrations.]

27 条评论

danenania大约 14 年前
As far as the Rails vs. Python framework discussion, I've found that the best choice depends on what sort of app you're building.<p>For apps that are primarily user facing, I think Rails is way ahead. The framework is well-designed, but more important than that are the plugins--the number and quality of polished, batteries-included, well-documented plugins are unmatched by other frameworks I've looked at. The amount of time and effort this saves is incredible. Ruby is also a great language and though overall it doesn't feel quite as nimble to me as Python, it has added power in some areas (like blocks), and its OO model feels more pure than python's. Heroku is another huge benefit for Rails, as are tight integration with HAML, SASS, and CoffeeScript (much improved syntaxes for HTML, CSS, and JS, respectively).<p>On the python side, I've used both django and web2py and I found web2py a much more productive framework even though it has a smaller community, so web2py is the basis for my comparisons.<p>While I've found Rails to shine for primarily user-facing apps, I think python could be a better choice if your app is less user-focused and more oriented towards data processing, number crunching, and other heavy lifting on the back end. Python has a more mature ecosystem of libraries for these kinds of tasks, and given that I find Python to be more fluid and expressive than Ruby, I'd prefer it for writing in complex logic that goes beyond the typical CRUD scenarios.<p>There is a feeling when participating in Python communities that more emphasis is put on data manipulation and abstraction, and less on ui, user experience, and polish, which tend to receive more utilitarian treatment. In Rails, the pattern is reversed.
评论 #2479303 未加载
andrewcooke大约 14 年前
Your being worried about ORM reminds me that I felt similarly in your position, years ago. Looking back, I think this may be partly a lack of experience with languages with memory management - you simply have to learn to let go. But there is also a valid worry about flexibility and the degree to which you are losing the power of SQL. To address that you need to think carefully about what you are doing and have some faith in the experience of others. If you go with Django, and want to make a normal-ish web site, Django's ORM is fine. In fact, it's surprisingly powerful for what it is. But if you really want to be able to access SQL within your ORM then, at least for Python, you need to use SQLAlchemy. The downside is that SQLAlchemy will complicate Django. So I would suggest starting with Django alone, and really giving that a fair chance, and then, if necessary, looking at SQLAlchemy.
Aaronontheweb大约 14 年前
I think C# and ASP.NET MVC has some of the best options available as far as OR/Ms go. Dapper, which was open sourced by the StackOverFlow team, is something I just started using and it took me all of 5 minutes to pick up. It allows you to still write your own custom SQL statements but maps everything to a family of POCO objects you want to use. Dapper is also the fastest OR/M in C# terms of its benchmarks if that's a concern for you.<p>LINQ-to-SQL is another great option that's easy to set up and actually performs pretty well if you compile the queries.<p>Fluent NHibernate is much heavier duty, but once you have all of your mappings set up then it's braindead easy to do anything to your database.<p>If you're using Mongo in C# then I highly recommend checking out the NoRM project - it's like LINQ-to-SQL for Mongo. I'm using it in production at <a href="http://captainobvio.us" rel="nofollow">http://captainobvio.us</a> and it's been a breeze to work with
评论 #2479320 未加载
cephas大约 14 年前
Django vote here. No disrespect to Rails. Depending on needs, take a look a mongodb as you can mix that in nicely (with pymongo). Node is intriguing as well - though not really a complete framework.
acangiano大约 14 年前
&#62; I want to build a rich webapp, which will be a platform for others to create content.<p>If you have some experience with ASP.NET MVC, you'll find starting with Rails easy enough.<p>&#60;flame&#62; Unlike Django, you have an up do date free ebook to learn from and many others available for purchase (<a href="http://programmingzen.com/rails-books/" rel="nofollow">http://programmingzen.com/rails-books/</a>). And don't forget extensive free guides (<a href="http://guides.rubyonrails.org/" rel="nofollow">http://guides.rubyonrails.org/</a>).<p>Ultimately both will get the job done. Rails just has a richer ecosystem and a larger, more active community.&#60;/flame&#62;
评论 #2478745 未加载
评论 #2478917 未加载
评论 #2478732 未加载
fjc大约 14 年前
I made a similar leap from C/C++ and C# without much web development a year ago. I have since developed several projects using both Rails and Sinatra using both ActiveRecord and DataMapper for ORM. The Sinatra/ActiveRecord combination is my current default.<p>In general, ORM pain decreases significantly as soon as you go with a dynamic language like Ruby or Python. Hibernate nearly made my head explode the first time I saw it.<p>In summary: I would recommend Ruby, Sinatra and DataMapper as a starting point.
评论 #2478862 未加载
hartror大约 14 年前
Which do you prefer Ruby or Python?<p>Both Rails and Django have lively helpful communities with great documentation and extensive libraries.<p>You could even play with both over a few hours and pick the one that has the style you prefer.<p>What was the issue you had with ORMs?
评论 #2478774 未加载
hasenj大约 14 年前
I would recommend Node.js<p>Though that alone doesn't say much. I recommend first of all you write the code in coffee-script and not in javascript.<p>Node is bare-bones and the choice of template languages and what not is left up to you. I recommend stylus for css, and jade for html templates.<p>For databases I recommend MongoDB (or some other nosql type database). There's a Node module called 'mongoose'; it seems decent but I haven't used it so can't say much.<p>MongoDB uses flexible documents (json objects) instead of sql-type tables, and allows you to add/remove fields dynamically to individual objects ("records") without having to redefine a "schema". So at least in theory it should make migrations a lot easier.<p>Why do I recommend Node instead of Django or Rails? Simple: I think it's the future. Node.js is very lite, has an awesome package manager, lively vibrant community, solves the concurrency problem beautifully, it's evolving rapidly, but more importantly: it makes simple things simple.<p>Ever saw a comparison of a "hello world" in Java vs. Python? Java requires you to do a lot of setup upfront, where as python just lets you say:<p><pre><code> print "hello" </code></pre> Well, Node is kinda like that.<p>Creating a project in Django and/or Rails requires a lot of boilerplate. Where as in NodeJS it's a single .js file with about 5 lines of code. And sure, Django/Rails have tools to automate the creation of this boilerplate, but it's still a clutter to your environment.<p>(For the record: there <i>is</i> a lite framework for python called Flask, but it lacks all the other benefits of Node)
评论 #2480754 未加载
SkyMarshal大约 14 年前
Raphters C web framework might interest you. I haven't used it so can't attest, and it's new, probably not as mature as Rails/Python frameworks/etc. But just in case:<p><a href="http://news.ycombinator.com/item?id=2407334" rel="nofollow">http://news.ycombinator.com/item?id=2407334</a><p><a href="http://news.ycombinator.com/item?id=2436885" rel="nofollow">http://news.ycombinator.com/item?id=2436885</a><p><a href="http://thechangelog.com/post/4608227295/raphters-a-web-framework-for-c" rel="nofollow">http://thechangelog.com/post/4608227295/raphters-a-web-frame...</a>
DanWaterworth大约 14 年前
&#62; I want to build a rich webapp, which will be a platform for others to create content.<p>I'd advise against Django then. Django is great when you have a small number of trusted contributors, but a pain otherwise.
评论 #2478711 未加载
FreshCode大约 14 年前
Fluent NHibernate solved all my problems. I asked a similar (strangely, downvoted) question on SO: <a href="http://stackoverflow.com/questions/5522590/rapid-orm-for-painless-asp-net-mvc-prototyping-on-sql-server" rel="nofollow">http://stackoverflow.com/questions/5522590/rapid-orm-for-pai...</a>, which prompted me to check out Fluent NHibernate.<p>Before that I was using LINQ-to-SQL with a repository layer and StructureMap, but I spent way too much time writing repository methods and mapping columns manually. Do yourself a favour and try NHibernate without the XML mappings.
评论 #2478769 未加载
irahul大约 14 年前
If you are fluent in C# and are willing to put up with the license cost, you should go with ASP.Net MVC.<p>Regarding ORM, NHibernate isn't working for you? I haven't used it personally but have heard good things about it.<p>If you have time to evaluate, you can try building a mini app with Rails and/or Django before deciding. I recommend "Rails 3 tutorial" and Django book for learning Rails or Django. The Rails 3 tutorial builds a small twitterish app. Django book doesn't have a cohesive apps built in the book but the examples are all real world.
评论 #2478761 未加载
tretiy3大约 14 年前
I just can`t understand why do you need to switch to the SAME technology? asp.net mvc is ok. all you will get, while switching to python or ruby, is lack of type system, generics, linq, f# power etc. it is big price, comparable to the development speed gain (???), cheap hosting (???), powerfull orm (???). If you want something really fresh, i think its better to take some no sql approach. or compose entire app on client with javascript. You can take all this modern things while using asp.net mvc. sory for my english.
olegp大约 14 年前
If you don't want the hassle of dealing with deployment and don't mind going all out with JavaScript, which you will need to pick up anyway, then let me recommend a startup I'm helping out: <a href="http://www.akshell.com" rel="nofollow">http://www.akshell.com</a><p>We have a pretty straightforward database library which lets you avoid writing SQL but isn't a full blown ORM that you can check out here: <a href="http://www.akshell.com/docs/0.3/guide/db/" rel="nofollow">http://www.akshell.com/docs/0.3/guide/db/</a>
vhackish大约 14 年前
For building something that is content management, Django - as others have said - is a good choice. Going forward though, as a veteran C and web programmer I <i>really</i> like node.js. I think you will enjoy coding in JavaScript since it's like C syntactically, and you will really like the power and flexibility of node.js.<p>Also there are plenty of ORMs for node.js - I like Mongoose and mongodb personally, but there are several others.
damilare大约 14 年前
From your experience, looks like Django will be a good bet for you. Try it out <a href="http://djangoproject.com" rel="nofollow">http://djangoproject.com</a>
评论 #2478706 未加载
gte910h大约 14 年前
I'd say learn Google App Engine's webapp framework.<p>ROR is very good at consumer facing apps, but there is a bit too much there there to learn quickly, or to use for other purposes (iPhone app backends, etc) for people new to the platform.<p>Either will serve you well once you master them, and I'd learn both eventually.
评论 #2479374 未加载
LookingToLearn大约 14 年前
I have a similar question which I asked over here:<p><a href="http://news.ycombinator.com/item?id=2478537" rel="nofollow">http://news.ycombinator.com/item?id=2478537</a><p>That hasn't got many upvotes, so probably very few will see it, but it seems related enough to mention here and ask for advice.<p>Thanks in advance.
w1ntermute大约 14 年前
Use C: <a href="http://news.ycombinator.com/item?id=637676" rel="nofollow">http://news.ycombinator.com/item?id=637676</a><p>(the article's gone, but there are some excerpts at <a href="http://gadgetopia.com/post/6839" rel="nofollow">http://gadgetopia.com/post/6839</a> )
runjake大约 14 年前
This question gets asked time and time again (a few times a week on HN), and really, the only valid answer is "Try both &#38; stick with the one you like best".<p>There are a plethora of right languages &#38; frameworks. Try both &#38; stick with the one you like best.
mermeladas大约 14 年前
I'd suggest reading this- <a href="http://www.quora.com/Technology-Trends/What-are-the-most-future-friendly-web-application-frameworks-to-select-in-2011" rel="nofollow">http://www.quora.com/Technology-Trends/What-are-the-most-fut...</a>
keyle大约 14 年前
If you want a job, learn PHP or go C#. Keep the others as 'having some experience in'. C is still your best asset though, some operations done server-side will always need some C.
评论 #2479026 未加载
pdenya大约 14 年前
CakePHP is nice and easy to learn, easier to deploy. It's not as trendy as RoR but there are a vast amount of easy to integrate PHP resources.
trustfundbaby大约 14 年前
You're already familiar with ASP.NET MVC which takes a lot of its inspiration from Rails ... so yeah ... go with Rails.
mahmud大约 14 年前
others without the requirement to build a site can side-step the web and start with android. it's a cleaner model than the web that learned a lot from it. android xml files are far superior to anything css or javascipt.
gaius大约 14 年前
Question: What would an ORM give you that LINQ can't?
naughtysriram大约 14 年前
i would say go for node.js because, 1.c style syntax 2.nodejs is itself evolving 3.you can learn serverside scripting 4.event based design 5.very good framework for deploying web apps