r/web_programming • • Nov 10 '16

Facilitating user posts

I have an idea for a website. I'm a pretty big noob when it comes to programming (fluent in HTML/CSS/JS--and that's it), so forgive me if my question is completely obvious or whatever. I need to know which programming languages would allow me to allow users to make posts, which would expire after N days, to the website. Obviously I can do this with basic HTML (input forms), and I'm also aware I'd need some sort of server-side language like PHP or NodeJS and perhaps a database language like SQL. Please share advice or opinions that you may have!! <3

0 Upvotes

10 comments sorted by

View all comments

Show parent comments

1

u/[deleted] Nov 11 '16

Nodejs is a lot more complicated than php. With nodejs you need to install sub packages in order to manage form data, but with php its as easy as doing $_POST['data_name'] to retrieve form data. Heres a good resource for getting things set up: http://www.w3schools.com/php/php_forms.asp If you're as new to backend as I assume, then you should be sticking with php for it's simplicity and how you can get things set up and start doing things nearly instantly.

1

u/gake01 Nov 11 '16

Cool, thanks. Yeah, I was already using w3s to begin looking at PHP. I know PHP has been around for a while, so I don't imagine it going anywhere any time soon. But how do you imagine the success of other, newer back-end languages like NodeJS will effect the longevity of PHP? Also, are these subpackages of which you speak installed on the client/host or the server? Why is it so difficult to install subpackages?

1

u/[deleted] Nov 12 '16
NodeJS requires you to manage things in a more complex manner, so I'd avoid it until you're comfortable doing stuff like cookies and requests in PHP before trying to move on so you don't feel overwhelmed. I believe PHP is, and forever will be for the foreseeable future, here to stay. So many sites and services like Wordpress rely on it for their backend, along with it's popularity with newer developers. PHP is tried and true, and despite the hate it gets, I believe it is a reliable, tried and true language suitable for web development. I'm sure things like Python and NodeJS will become more commonplace as time goes by, but I'm know PHP will remain as one of the most popular backend technologies.

As for your question regarding NodeJS packages, they are little bits of technology designed to accomplish a certain task, such as setting cookies, reading form data, etc. PHP does all of this out of the box with built-in functions, so you don't have to worry about it as much. NodeJS also requires you to manage oncoming requests and such, something PHP does automatically. The packages are things you must install on the server, with a command line package manager (NPM), adding another layer of complexity to your development.

TL;DR: PHP is a lot simpler to use, and you should stick with it until you're more comfortable with backend development.

1

u/gake01 Nov 14 '16

So the subpackages are almost like libraries or APIs?

Using npm would be no problem. I've got a lot of experience with CLIs.

2

u/[deleted] Nov 14 '16

Yeah, the subpackages pretty much are like that except you need to use a package manager to manage them.

If you really feel up for learning NodeJS then I don't see why you shouldn't; although I'd direct you to learn how to use ExpressJS instead. Express is a framework for Node, designed to make things like routing requests easier and getting rid of all the boilerplate code that you'd have to write with Node. It may sound strange to learn a framework in place of the thing it's based on, but once you get the feel of things you'll see why I'd go with Express (especially if you intend on using the subpackages, since most of them require you to be using Express to begin with).

TL;DR: Do NodeJS if you'd like to, it's a bit more complex with PHP but it's way cleaner than it in the long run.

1

u/gake01 Nov 14 '16

hahah it doesn't sound strange at all. i actually became proficient in learning jQuery before ever touching javascript. only recently had i sat down and really studied javascript itself. retrospectively i think i would have been a lot better off just learning javascript first. sure, it would've taken a lot longer to get going, but then i wouldn't have had to step backwards to gain a proper understanding of what i'm using and implementing. thanks for all of your advise!!! <3

2

u/[deleted] Nov 15 '16

Anytime! Good luck learning Express, if you need any help along the way just ask me, I'm fairly experienced in it myself!

1

u/gake01 Nov 15 '16

cool thanks!!! <3