Live data from Hacker News

Ask HN: I want to write a simple webapp, how should I start?

news.ycombinator.com

31–40 of 60 posts

Re: Ask HN: I want to write a simple webapp, how should I start?

#32
The fortunate thing is that you have a fair amount of options when it comes to technologies for a web app. I personally have used php for years and have been working extensively with ruby and python recently. Here are some general things to consider.

Language choice.

For a long time PHP was the defacto standard. It has a lot of resources and tutorials plus the advantage of a huge amount of hosting options. However, I'm the last five to ten years, the field has opened up. Ruby and python both have strong communities and with app hosting solutions like Heroku, it is just as easy to get them up and running. All three are fine choices and if you're looking to make a career of web programming, you'll find plenty of jobs for all three.

Frameworks.

Frameworks are essentially scaffolding you can build your app around. The benefit is that you can get up and running pretty fast with them. Ruby has rails, python has django, and php has a plethora, with laravel being my favorite right now.

The downside of these is that they add another level of complexity to your app. In addition to learning the basics of a programming language, you also have to learn about routes,models, controllers, etc. While this information is very beneficial to have, it could overwhelm when you're just starting out.

If you want an app working fast, you can try one of the frameworks. However, if you want to understand the language more fully, at the cost of time, you may want to try your hand without a framework. If you do choose that route, php may be the best choice, since it was the only one designed specifically with web programming in mind. I'd reccomend php with mysql (using PDO for database interactions).

I'm currently on mobile right now, but if you'd like any more resources I can reply when I get to a real computer.

Re: Ask HN: I want to write a simple webapp, how should I start?

#34
post #16
post #13

If you go with PHP, I would suggest learning how to use Composer[0], PHP's sort of de facto package manager, to organize your project. What you're describing seems like a really simple application, but even so, with dependency management, a router and the PSR autoloader it's much, much easier. Of course, choosing another language (Python, Ruby, whatever) will likely mean choosing a framework and the package manager f…

Wow, thanks, haven't thought of that. I was thinking to use either a virtual machine or the LAMPP stack on my NAS/Raspberry. I tried Xampp, but it kind of screwed with my installation back than. Plus, the Pi isn't really doing anything, time to change that.

If you're going the PHP route, I recommend Laravel. It's easy to pick up, there's a ton of interest and plenty of places to teach you. They even have a neat little Vagrant box to help you with the initial set up.

Re: Ask HN: I want to write a simple webapp, how should I start?

#36

If you want to go up with PHP then better use Laravel + Mysql or Postgresql. And if you want to learn you can opt for laracast.com videos. They are one of the best resource for laravel. P.S Laravel is one of the best PHP based framework.

A lot of people is talking about Laravel. I'm new on web development, and I thought that Symfony 2 was more popular. Any specific reason for prefering Laravel to Symfony ?

Re: Ask HN: I want to write a simple webapp, how should I start?

#37
Depends what your goals are. if you want to learn a lot; you could write it in PHP/MySQL; if you just wanna get it done, you could do it in Rails (or some other framework).

The thing is, there are really lots of ways something like that could be achieved.

I use Ruby/Rails for philosophical reasons; I really love the language and framwork. I could do php - i just don't like php. Been there, done that. Others prefer JS for everything, or maybe ASP. None are "wrong". but there are differences and tradeoffs to each path; its not arbitrary by any measure.

If you want some fancy search, I do favor elasticsearch quite a bit. Everything else I've used doesn't compare. (but again, largely preference (because its better))

Re: Ask HN: I want to write a simple webapp, how should I start?

#38
Really, front end JS frameworks don't make sense for an app like this (I would only use a JS framework if there was a significant amount of rich client interaction; in your case there is not, you're justing searching from a form).

Rails or Django would be easiest, IMO, and they have a ton of libraries to make the search easy. You should absolutely not have to write any algorithms or anything... whatever you choose would probably just look like ExampleSearchLibrary.new(magazine_records).search(string_from_form) and that's it. I think the hardest part is getting all the magazine data in a DB, and designing the model layer in a way that makes sense. I'm assuming it's already digital, so it would be a matter of writing scripts to scrape & save.

Re: Ask HN: I want to write a simple webapp, how should I start?

#40
I'm surprised to see so many leaning towards PHP.

Personally I think it would be easier to use an embedded database such as leveldb, and build everything out with browserify, npm, and io.js. This way you can build your application as single process. The entire application can then just be streams of data and tiny modules of code that do one thing well.

Post reply on HN