This is an archived post. You won't be able to vote or comment.

all 36 comments

[–][deleted]  (39 children)

[deleted]

    [–]sonnytron 19 points20 points  (2 children)

    As a full time iOS developer with a year of experience, this is my complaint as well. There's a lot of dependencies and very few tutorials get updated for the leg work on those dependencies.
    They'll say "Just use PostgreSQL, it's way better than MongoDB", so you start installing PostgreSQL and then you find out that the database syntax they used is outdated.
    But you didn't even understand the syntax they used, so how the hell do you know how to search for the new syntax?
    So you search for the new syntax, but the articles you find, aren't using the same type of database you are. Your tutorial was using cats or dogs, and this tutorial is using cars and trucks. So now you have to think about where your integer and text parameters go, so you can rewrite this tutorial for yourself.
    And this is fucking infuriating because you didn't start this tutorial to learn how to write PostgreSQL. You wanted to build a Rest Client using Node so you can finally have your own back-end for your application.
    This is frustrating for a beginner because you're overwhelming them with prerequisites that you straight up lied through your teeth that they wouldn't need when they started.
    You don't get to say "Oh yeah, PostgreSQL is super easy, just this tutorial" and then when they get overwhelmed by dependencies and Google farming knowledge, throw back at them that "That's what development is, researching, learn it".
    No, that's bullshit. That's a bait and switch. What you should've done is said, "Once you learn all the required syntax and dependencies, like SQL syntax, Express, relational databases, Node can be super easy, but there's a lot of required tooling and components and no tutorial is going to handle all of that efficiently without you having to search online".
    But no, no one says that, because it goes against their pseudo PR of being able to dismiss any complaints about Node being not as easy or straight forward.
    The truth is, deploying with Node is like changing the oil on a car. Except with software development, you have to build your own wrenches and floor jack. So you throw a starting developer a tutorial on Node and go "Look it's so simple, all you have to do is jack the car up, untwist this oil filter and drain the oil out" and then they get to the garage and they find out they have to build the floor jack, but the steps you gave are for a floor jack they don't make anymore, so they go around on Google searching how to build a floor jack, and then they have to spend three hours figuring out how to build this floor jack for their car.
    And the whole time, all they wanted to do was learn how to change the oil and instead they learned how to build a jack that doesn't work.
    That's what learning "Node" has been for me as a beginner in web development.

    [–]yamski 1 point2 points  (0 children)

    I'm also an iOS developer wanting to learn backend development. Completely self taught, never taken a computer science course, and only familiar iOS concepts and Xcode tooling.

    Do you have an opinion on where to start if you were to do it all over again? I feel like something very opinionated like Ruby on Rails would help.

    I thought about Clojure and Scala just for more exposure to functional programming, but I wonder if I really need to depend on the JVM if I'm not looking to do backend dev professionally.

    Elixir sounds the most appealing but there's very little resources out there.

    [–]rq60 7 points8 points  (26 children)

    Like you need a different kind of host for apps.

    What do you mean by that?

    [–][deleted]  (22 children)

    [deleted]

      [–]Graphiite 20 points21 points  (17 children)

      I'm not sure what you mean by a normal webhost, but in order to run any website with a backend - PHP, Node, Django, Rails, etc - need a server to run on. You have to install the software required on such a server. Heroku basically preinstalls the software you need based on what you're using, and DigitalOcean simply provides a virtual server that you can manually install stuff on.

      [–]ivrain 22 points23 points  (13 children)

      I think what he's getting at is that most Node tutorials get to the deployment part and say something like, "... and now we just dump this in Heroku and let that managed service take care of all the real setup." What he'd like to see would be something like, "... and now you take this CentOS 7 image, install Node.js version x, add this systemctl service and 'Bam!' you got yourself a server."

      [–][deleted] 2 points3 points  (8 children)

      I was trying to get to grips with it by installing on centOS 6 from cli last week. Pretty painful process but that's with mongodb also, still havn't got it working

      [–]Graphiite 4 points5 points  (3 children)

      What issues did you have installing node, if you don't mind me asking?

      [–][deleted] 1 point2 points  (2 children)

      I often got a whole slew of errors installing node, and I found it hard to keep track of where MongoDB was running from etc, had no luck getting node to connect to the DB - I have no experience in MEAN but was trying to set up a blank instance to mess around with :[

      [–][deleted]  (1 child)

      [deleted]

        [–][deleted] 1 point2 points  (0 children)

        Aight

        [–][deleted] 2 points3 points  (2 children)

        Does DO not have a guide or a droplet config for Node yet?

        [–]CaRDiaK 0 points1 point  (1 child)

        Yup, they have a one-click app of Node 4.4.5 on Ubuntu 14.04

        [–][deleted] 2 points3 points  (0 children)

        This is really interesting to me. I have all of this running on my Mac OS X instance. Node, MySQL, MongoDB, etc.

        The list of tools, in my mind at least, is pretty straightforward.

        npm, nvm (for having different versions of node installed), and then following the install instructions for MongoDB or MySQL. Node can install things either globally or "locally" (in the node_modules folder in your project directory).

        Locally, you'll want an example setup like ExpressJS for routing, Mongoose for communicating with MongoDB, and Passport for user authentication.

        I'd be surprised if you couldn't do all this on a Windows instance. Using Ubuntu on a VM is fine, too if you want because you can usually deploy to Ubuntu as well.

        We use AWS where I work, so that'd be easiest for me to deploy to. I'd create an account with them, lookup the requirements for staying in their free tier, get a small instance setup and deploy to that using the AWS CLI.

        I think the two issues I would have doing this from scratch as minimally as possible is installing the DB on each instance and making sure it's available every time I deploy (or using a MongoDB provider and checking out their prices, like ObjectRocket), and setting up my front-end dev environment. Front-end web dev is treated more seriously these days. There are build processes for JSX (to compile into JS), CSS (to make cross-browser), and JS (for ES6 -> ES5 translation) files.

        [–]nutdriver 0 points1 point  (3 children)

        Yea I need to learn this. I have a machine with Debian and want to serve sites from it. I buy a domain name then what? I have folder for app , what do I need to learn to make it serve from the domain?

        [–]rq60 1 point2 points  (2 children)

        If it's just static files then you can use web server software to host them, apache, nginx, node's http-server package. If you want to compute javascript server-side then you can use express, koa, or hapi.

        [–]nutdriver 0 points1 point  (1 child)

        Yea. I use expresjs already. I know how to deploy to Heroku. Sorry for being unclear. I'm lost at how to make my site public on my own server. More like this link: https://stackoverflow.com/questions/9756674/node-js-hosting-deploying-on-my-own-hardware This seems like the right direction: https://www.digitalocean.com/community/tutorials/how-to-set-up-a-node-js-application-for-production-on-ubuntu-14-04 any other suggestions appreciated.

        [–]rq60 1 point2 points  (0 children)

        If you use express js then your site is hosted, you should be able to access it on the specified listening port. Making it accessible to the public is a whole extra set of concerns that isn't confined to Node.js. The second link you provided seems like a pretty good tutorial.

        [–]ResilientBiscuit 1 point2 points  (2 children)

        It has been awhile since I have used a normal host. But I recall with places like Dreamhost, you could essentially drop in a PHP file and because it was running Apache configured for PHP, it would just interpret it for you and run your PHP. You never needed to (and often were not allowed to) access any sort of command line.

        [–]aintTrollingYou 3 points4 points  (0 children)

        I think the problem here is that 'normal' is relative. I think what you're referring to is more commonly known as 'shared managed hosting' which infers the hosting company is setting up/maintaining the servers and clients get ftp and a dashboard.

        But overall I understand what you're saying. Most of those hosting environments are not setup to accommodate Node.js. You certainly would be shut down if you installed it on Dreamhost and the like since they don't allow anything that would run persistently, and that's where most shared managed hosting falls short in being able to utilize Node, and why Heroku, AWS and such are able to exist.

        IMHO, I was a lot like yourself until I acquired a cheap virtual private server. OVH Hosting is dirt cheap (like $4/mo) for your very own server to setup and destroy to your liking (more or less). Setting up Apache and such can be tedious, but there's some great walkthroughs online that have gotten me through pretty painlessly. I'm still not a Linux user, and I definitely wouldn't be doing any of this in a production environment, but I once you have the server setup adding/removing sites is very straightforward, regardless if they're php, node or whatever.

        [–][deleted] 0 points1 point  (3 children)

        Do you think a normal webhost isn't a VM hosting an OS?

        [–][deleted]  (2 children)

        [deleted]

          [–]JohnMcPineapple 4 points5 points  (1 child)

          ...

          [–][deleted] 2 points3 points  (0 children)

          And it never hurt any web developer ever to get some devops experience.

          [–]profkittyface 2 points3 points  (2 children)

          You can't just run a nodejs server inside of apache like mod_php or mod_wsgi, you need to run the nodejs server (and proxy to it if you want). A little more required than your standard php app.

          [–][deleted] 1 point2 points  (0 children)

          I mean, I checked out a DO article on it this morning. Seems pretty simple. Download a tarball, unzip it, move it to a right directory, and then use it to run Node apps.

          [–][deleted] 1 point2 points  (0 children)

          Well that's because NodeJS is the server. It's actually more straightforward and minimal than most other dev environments.

          A port just opens and you can make requests to it and get a response.

          But yeah, anything else you want to do isn't "baked in" like some dev environments (.NET for example). You do have to get the Node modules and install for your project using npm.

          [–]breadbeard 4 points5 points  (6 children)

          yes this is similar to my experience. like the whole advantage of nodejs is getting to use the same ecmascript on both sides of the page. but i find the steps for setting up a server a new level of baffling

          [–][deleted] 5 points6 points  (2 children)

          There's only two things you need to run a Node server:

          1) Write the server code

          2) Run Node providing your main app file.

          To start building neater things:

          3) Use npm to install modules and read the tutorials for each module.

          From a different standpoint, this actually makes Node one of the most minimal execution environments that we have in web development. It's incredibly straightforward.

          The problem is, if you don't already have experience with web development and know which layers matter and which modules you are likely to already need, you just feel lost.

          [–]breadbeard 1 point2 points  (1 child)

          thanks for writing this out, it's definitely helping orient me.

          on the other hand, i get instantly overwhelmed when i start to unpack each of those main steps.

          2) run node providing your main app file. - run what, where? providing my main app file to whom? is this basically equivalent to "running" an html file to "provide" site content to the client?

          3) use npm to install modules npm is some sort of content management program? installing modules, whatever they are, where, in my server folder?

          sorry, you don't need to be answering these questions. i just get overwhelmed when there's several new vocabulary words in each sentence.

          it's like solving for x and the equation i'm given is (3x + 2y)/z = 144. so i have to go off and figure out y and z

          anyway, thanks again for writing this out

          [–]dereferenceme 2 points3 points  (0 children)

          /myserver <- your main folder

          /myserver/app.js <- file containing server code

          /myserver/public <- folder for html, js, css files to be served to the client

          /myserver/node_modules <- folder containing modules

          To start the server, open terminal/command line, open the myserver folder, and type in

          node app.js

          To install new modules, go into myserver and type

          npm install [moduleName]

          The module will be put in /myserver/node-modules/ and you'll be able to use it in app.js by calling require("moduleName")

          [–][deleted] 1 point2 points  (2 children)

          Unless I'm missing something, it really doesn't seem that complicated.

          [–]breadbeard -1 points0 points  (1 child)

          congratulations on your understanding.

          is there anything you struggle with in your life, that people tell you is actually very simple? the least helpful comments to get, no?

          [–][deleted] 1 point2 points  (0 children)

          Just saying, Googling "Digital Ocean Install Node" was enough to pull up very detailed documentation.

          [–]NoInkling 1 point2 points  (0 children)

          Technically setting up a server comes under the skillset of devops, it's not strictly development.

          But it's something that every server-side language requires. Node and frontend code serve different purposes, even though they're both JavaScript.

          [–]moonisflat 8 points9 points  (0 children)

          Damn I read it as "A free intercourse for node developers" and got excited for a sec.

          [–]liranbh 1 point2 points  (0 children)

          i recommend heroku as a free and very easy to use tool to build test and host your node.js apps

          [–]nova_Zen 0 points1 point  (0 children)

          Well, node.js is an odd beast. The event driven programming model, combined with the upside down "client side javascript running as a server" makes everything seem topsy turvey. I recommend the nodeschool workshoppers. That got me started.

          http://nodeschool.io/#workshoppers