Live data from Hacker News

Ask HN: What's your favorite way of getting a web app up quickly in 2018?

news.ycombinator.com

381–390 of 569 posts

Re: Ask HN: What's your favorite way of getting a web app up quickly in 2018?

#381
I also use Django and Postgres. For deployment (keeping things in sync) I use Git :)

Set up your bare repository at say /root/myapp in your cloud server then clone this to your local dev area. Then clone it again to your cloud server django directories say /web/myapp . Finally git ignore you settings.py file so it can be different in each server.

This can actually scale up to reasonably sized prod/test/dev/local_dev cloud server setup by using appropriate branches though I know the traditionalists would be squirming in their seats.

Re: Ask HN: What's your favorite way of getting a web app up quickly in 2018?

#382
post #275
post #99

Earlier quoted context omitted.

Coming from nodejs, phoenix is incredible. Out of the box, phoenix just uses nodejs to generate all your frontend assets, and channels are incredibly easy to use. I'm still learning about how elixir works under the covers, but so far I'm really impressed.

How much learning curve if One doesn't know Erlang to get speed up in phoenix?

These are two separate things: Erlang and Elixir are one, Phoenix is another.

In general, you don't need to know any Erlang to start working with Elixir. In time, as you advance your knowledge and start looking at more advanced features, you'll need the ability to read Erlang at some point, but that's actually pretty trivial: Erlang syntax is one of the simplest/smallest out there. It's much better in this case than it's with Clojure and Java.

The functional nature of Elixir may be a little weird, but, if you're worried about this, it's not taken to the extreme like in Haskell. At the end of the day, you do have a process dictionary (don't use it), and normal IO. It's true for both Erlang and Elixir, but Elixir adds some improvements on top of that: in Elixir, you can re-bind a variable (Erlang has single assignment only), you get the familiar syntax for accessing elements of collections (`coll[:keyname]`), the `if` is "fixed" to be normal if-then-else (the usual Erlang construct is dubbed `cond` in Elixir) and so on. It's FP but in the spirit of OCaml rather than Haskell: pragmatic and striving to be convenient without pulling the users' minds through a monad.

Now, Phoenix is another thing altogether. As far as frameworks go, Phoenix is very well designed, with a couple of orthogonal concepts being composed into a highly functional whole. To be honest, I didn't use Phoenix yet, personally - I did some code review for colleagues, but my own projects are written with Plug for now. Plug is a library which is comparable to WSGI spec in Python plus some additional utils, like in Werkzeug. Phoenix is built on top of Plug, so I figured learning it first is not a bad idea.

Turns out you can get by with Plug (and eventually some "plugs" packages from other people) for quite a while; the experience is like with Flask or Sinatra. You have to know what you want, exactly, but if you do, it's trivial to build a basic framework out of the available plugs. It's actually a strong selling point of the whole tech: as I mentioned, Plug is as much a library as a specification (with the same motivation as WSGI) and it's great for interoperability of components. The whole stack is composable and extensible at the same time, which is not that easy to pull off as far as framework designs go.

Documentation is decent, although its searchability is less so, I had a good time with devdocs.io for the core language and with hexdocs for plugs. It's definitely grokkable, and I'd say worth a try.

Re: Ask HN: What's your favorite way of getting a web app up quickly in 2018?

#383
After reading most of the comments im really suprised to see folks still using vm servers and managing the stack themselves. Seems like high enough overhead.

I know cost is on peoples minds so why not serverless? Haven't seen anyone mention aws lambda or gcp cloud functions. You get a massive free tier , like 2 million requests and free db...

Anyone doing this?

Re: Ask HN: What's your favorite way of getting a web app up quickly in 2018?

#384

Vanilla php + html5up + sqlite3. Everyone else here is trying to be stylish and fancy. Your customers don't care what language it's in or whether the code is beautiful. No cutting edge incomplete frameworks, convoluted tooling, piles of inaccurate documentation to read, inexplicable cryptic error messages with a bunch of incorrect solutions on stack overflow, or other incompetently over engineered bullshit. Just go a…

In many areas of the US (the entire west coast for example), PHP is dead - plain and simple. Independent of whether it is good or not, selecting dead or obscure technologies for your clients is completely irresponsible and leaves them with a maintenance catastrophe just because you like php. Yes there is a lot of hipster-ism out there in platform choice but there are plenty of mature, fast, and popular options out th…

I don't know which planet you're living on but all you need to do is search Indeed.com for title:php and you'll find PHP is up there with Java, C# and Javascript in terms of the number of jobs. In some countries Java, JS and PHP are the only languages used in any significant numbers. Likewise in more technologically advanced countries once you get away from the tech hubs. I'm not a fan of PHP and I wish it was true but dead it certainly ain't.

Re: Ask HN: What's your favorite way of getting a web app up quickly in 2018?

#385

Django, Docker and AWS ECS and ELB. Absolutely worth the effort to learn how to build a Docker image and put together bash scripts to push the image and update an ECS service. We have a base project which includes nginx and uwsgi set up to simply serve the Django app and static files on port 80. Having an ECS Docker cluster with spare capacity greatly assists getting new projects up and running quickly, especially if…

May I ask how you’re managing secrets with this setup? For example, the secret key or database URL. Our current setup deploys an env file which is sourced before starting the process. I’m less sure how this translates to a production docket deployment.

I've only been using Docker/ECS on side projects, but I generate the production build Docker image with the production .env included, push it to a private repo on Amazon ECR, then pull it in to ECS from there.

My understanding is the best practice for Docker/ECS production deployment is to create Docker images containing the full app build, rather than managing the app deployment separately from image deployment. As opposed to development Docker images that rely on docker-compose to mount the host filesystem in the Docker container, the production image Dockerfile includes COPY instructions for the production build files, to be included in the image.

Re: Ask HN: What's your favorite way of getting a web app up quickly in 2018?

#387

Earlier quoted context omitted.

In many areas of the US (the entire west coast for example), PHP is dead - plain and simple. Independent of whether it is good or not, selecting dead or obscure technologies for your clients is completely irresponsible and leaves them with a maintenance catastrophe just because you like php. Yes there is a lot of hipster-ism out there in platform choice but there are plenty of mature, fast, and popular options out th…

There are many successful companies and start ups that use PHP. The same way they exist for other languages and platforms. No start up became a unicorn because of the programming language they used.

With the possible exception of Clojure :). See Paul Graham on Lisp as the secret weapon.

Re: Ask HN: What's your favorite way of getting a web app up quickly in 2018?

#390
post #231

Earlier quoted context omitted.

PHP is not mature or fast or popular? And PHP is very far from dead no matter where you are. In fact is getting a lot more interest now since PHP 7. If you don't like PHP that's one thing but what you said is just wrong.

PHP isn't dead, and it will never be dead, but as a long time and continuing professional Perl developer myself, let me tell you that you're better off just accepting that your language of choice isn't in vogue anymore. It's not all bad once you're on the ass-end of history. I'm sure you can easily identify a few negatives being the language de jour bring (such as lots of shitty programmers joining the community all…

Perl 5 is pulling me like a superstrong magnet. I haven't had time to read the basics and things like choosing the correct sigil + accessor trim me up, but still, it has many niceties. To begin with, you can have a statement "use v5.x;" and be done with which interpreter problem: it can tell you it needs sth. different, and does not fail because you have python3 to be 3.x, but the script needs 3.x+y, or you have the shebang as python3.x but the system has 3.x+y which is compatible, but you can only have one full path in the shebang... Then the context variable $_ is just lovely. The availability of mature libraries for everything is a trait Perl shares with a small number of languages. Its integration to Unix and its expressivity are second to none. The documentation, while not as accessible as Emacs', is available on you computer offline in man pages, and perldoc can give you proper docs on functions (unlike crappy help() in Python which never shows you anything useful and you have to go to the docs, usually online), add to that POD being a very nice way to add documentation to your scripts and also view them (if its in the path you can "perldoc " and get help. And once you know your way around perl* man pages, you can just program independently, with little or no need to go online for Perl stuff. All niceties other languages/communities could've had, but just don't, because, well IDK why.

I'm a 25yo, so when I started programming Perl hatred was the hot thing already. Well, luckily as a curious person I discovered its just baseless cargo cult. Perl is one of the best tools to have in your toolbox.

Post reply on HN