News for hackers. Stuff that matters.
Re:Choose Boring Technology (2015) by l0b0 on Sunday June 07, 2020 @01:18AM (#23444954)
As relevant as ever. It's fascinating how big web stacks are these days, even for small-to-medium sites: various combinations of at least one styling language (SASS/LESS/CSS), frontend framework (Angular/React), frontend language (JavaScript/TypeScript/Node.js), backend framework (Django/Express/Spring/Rails) backend language (Python/Ruby/PHP/Perl/Java), and message bus (ZeroMQ/Redis/RabbitMQ). That's just the frontend and backend. Then there's infrastructure: pick at least three infrastructure as code components (Puppet/Chef/Ansible/k8s/Docker/Docker Compose/VirtualBox/WMWare/heaps of shell scripts), at least two web servers (Apache/nginx/traefik/your language's built-in server), and at least two TLS certificate providers because someone's nervous about moving everything to Let's Encrypt. I'm well aware that these don't have identical feature sets, but that's the point of the article: choosing a small and boring set of technologies is an advantage, not something to be ashamed of.
Re:Choose Boring Technology (2015) by gavinray on Sunday June 07, 2020 @01:43AM (#23445062)
I don't know that necessarily correct.

Previous startup I was at had a stack like this:

- Frontend: Vue + Typescript

- Android/iOS App: Vue (NativeScript/Capacitor) + Typescript

- Backend: Node + Typescript

- Database: Postgres

- Deployment: Everything in Docker containers

I know of a lot of places taking similar stances where the frontend and mobile apps are done in this way (IE React and React Native) and then you get Javascript/Typescript on the backend as well, so the entire stack is just JS/TS the whole way through with a single UI/design language.

It was really easy to hire developers this way and the transferable skills were high.

However you look at it, this is sort of the deal with JS these days. From a productivity and development velocity perspective, it's really difficult to rationalize using other technologies when you can just holistically build your entire stack in one JS/TS UI framework for the clients (or Flutter, nowadays) and then JS/TS on the backend too.

This is why I'm mentally shoehorned into using Typescript for everything. I enjoy it a lot, but there are other languages I enjoy too, it just doesn't make as much sense to throw them in the mix because then you've increased technical complexity and made it that much more difficult to source talent.

Re:Choose Boring Technology (2015) by peferron on Sunday June 07, 2020 @04:27AM (#23445755)
I just built a frontend and backend with TS following this same logic. I'm super happy with TS for the frontend, but I regret picking it for the backend and am considering rewriting the backend in Clojure while it's still early.

My reasons are:

- I don't need to share type definitions between the frontend and backend; the frontend can generate TS type defs using GraphQL introspection regardless of which language the backend is implemented in.

- The backend is doing a lot of data manipulation, which TS is not very good at. For example, there's no built-in group-by function, and group keys must be primitives since TS doesn't have value equality for objects or arrays.

- Static typing doesn't help much with setting up GraphQL resolvers correctly, and overall feels much less useful than on the frontend where it's absolutely stellar to type check all GraphQL queries, React calls, 3rd party component props, and so on.

- I miss clojure.spec for validating calls to external services.

Plus a few more situational reasons:

- I work in a team that's already familiar with Clojure. I don't think it's a huge barrier to hiring either; I didn't know Clojure before I joined, they just recommended me a book.

- I personally don't find that using the same language everywhere helps much in reducing context switching costs. Using different languages actually feels more engaging, especially when one is as pleasant as Clojure.

Put all these together and I'm seeing real benefits in using different languages.

Re:Choose Boring Technology (2015) by danenania on Sunday June 07, 2020 @06:18AM (#23446234)
Have you tried Ramda for the data manipulation functions you miss from Clojure? It used to not work very well with Typescript (lots of inference issues), but now it's gotten quite good.

You can use something like https://github.com/vriad/zod to get both runtime validation and static types (via inference) at the same time. The downside is defining your types in a DSL instead of plain TS, but I think it's worth it for the runtime validation.

It probably depends on your project, but I find type checking to be at least as crucial on the backend as the frontend (probably moreso), and being able to share types/have editor auto-complete across the whole stack is a godsend. While node isn't my favorite backend environment, it's not too bad (async/await are fantastic for io), and code sharing/type sharing makes it the most productive choice overall imho, all things considered.

Clojure's a lot of fun though, and it has taught me a lot, so I do see where you're coming from!

Re:Choose Boring Technology (2015) by rdgthree on Sunday June 07, 2020 @05:17AM (#23445963)
It'll depend on what you're building, but there's some value in rendering React on our backend. For example, we render documents (HTML => PDF) and emails with the same React components we use for our frontend to keep styling consistent. There are also some utils we use (in similar contexts) on both sides largely for things like string formatting or annoying math. Not a ton of stuff, but it's nice to have one bulletproof util to format phone numbers in every context. Another one is payment fee calculation[0], so we can guarantee the user sees the same number they'll be charged.

I think the more powerful benefits are definitely hiring and having a team that can work on both sides (and in that regard I think your points are perfectly reasonable), but there are definitely some more direct benefits in our case.

[0]https://support.stripe.com/questions/passing-the-stripe-fee-...

Re:Choose Boring Technology (2015) by peferron on Sunday June 07, 2020 @05:52AM (#23446107)
I wasn't very clear with my earlier description; the frontend is a SPA served by Node.js, while the backend is a completely separate GraphQL API service which I'm considering to rewrite in Clojure.

So the frontend can actually do SSR to render PDFs or emails. However, it would definitely be much harder to to ensure that any phone formatting or fee calculation done directly in the user's browser matches what the API returns. So yeah, definite benefits in sharing a language there. Thanks for the examples!

Re:Choose Boring Technology (2015) by rdgthree on Sunday June 07, 2020 @06:14AM (#23446208)
Makes sense! We have the same setup. FWIW, it's nice to do the React rendering on the backend because it's a bit easier to pass values to those templates directly (as opposed to using URL params or something). We render the React to a string there, then just pass that HTML string to a Browserless[0] instance.

Certainly not a showstopper though, passing a URI is easy enough!

[0]https://docs.browserless.io/docs/pdf.html

Re:Choose Boring Technology (2015) by pkilgore on Sunday June 07, 2020 @12:28PM (#23448490)
> Static typing doesn't help much with setting up GraphQL resolvers correctly, and overall feels much less useful than on the frontend where it's absolutely stellar to type check all GraphQL queries, React calls, 3rd party component props, and so on.

We found @nexus/schema to be excellent for this particular problem, but only after you set it up correctly to feed in type information via its typegenAutoconfig options.

I agree it is less frequently helpful at catching type errors, but the errors it does catch tend to be more important to get correct than the frontend errors!

Re:Choose Boring Technology (2015) by cultofmetatron on Sunday June 07, 2020 @10:28AM (#23447577)
take a look at elixir/phoenix if you're considering a rewrite. The Absinthe library is excellent and well documented. I'm using it for my startup and the app is speedy as hell on minimal hardware.
Re:Choose Boring Technology (2015) by choeger on Sunday June 07, 2020 @03:21AM (#23445455)
You basically have arrived where lisp was some decades ago. Logical next steps are to write the OS and the editor and the VCS in JavaScript.

However, at some point you will have a look into your myriad of nodejs dependencies and see with horror that they rely on C++ extensions. Then you learn that your precious stack is just a GCC upgrade away from not building anymore. And noone in your company even remembers what that is, a C++ compiler flag.

Re:Choose Boring Technology (2015) by AmericanChopper on Sunday June 07, 2020 @03:50AM (#23445569)
Whether you end up with a hellish dependency tree is more up to the developer than the language. I’d say the only reason this is more common in node projects than it is in other languages is because dependency management in other languages is more tedious, so the barrier for introducing new dependencies is higher.

All of my node projects have had rather tidy dependency trees. It’s also been quite easy for me to use popular packages. If something breaks and hundreds of thousands of devs are impacted by it, it’s going to get fixed pretty quick. Which has been my experience in the rare occasions that in of my dependencies has broken, it’s been fixed before it even had a chance to impact me.

Re:Choose Boring Technology (2015) by randombytes6869 on Sunday June 07, 2020 @07:22AM (#23446585)
Trust me, its the lack of standard library. Python and Java are both "batteries included" . You can write apps decently with just 5-10 dependencies if you want. Every JS app I've worked on has like 10-20X the dependencies of projects written in languages with a good standard lib
Re:Choose Boring Technology (2015) by ProZsolt on Sunday June 07, 2020 @09:15AM (#23447102)
I'm currently learning Go and it's at the other end of the spectrum. Most of my apps have only one to three dependencies and one is usually a database driver. It's a really good feeling when there is something missing from the standard library and you questioning yourself that you really need that thing.
Re:Choose Boring Technology (2015) by scottlocklin on Sunday June 07, 2020 @10:18AM (#23447505)
> Trust me, its the lack of standard library.

It's almost certainly not, as R has plenty of batteries, and young nitwits in the Hadleyverse are writing preposterous node-like dependency graphs. It's fashion, and it should be curb-stomped.

Re:Choose Boring Technology (2015) by dahauns on Sunday June 07, 2020 @12:58PM (#23448704)
I don't see how R of all languages is a useful counterexample.

It's as far a way from a general-purpose language as it can get while technically still being one, in both scope and intended use/audience.

Re:Choose Boring Technology (2015) by scottlocklin on Sunday June 07, 2020 @09:08PM (#23452584)
It's a useful counterexample because the problem didn't exist for the 20 years before legions of nodejs bros descended upon it and bestowed upon us the mess of hot garbage it is today. At this point, there is an entire half of the ecosystem which is unusable unless you drink the 400 dependency kool aide.
Re:Choose Boring Technology (2015) by disgruntledphd2 on Sunday June 07, 2020 @11:00AM (#23447828)
To be fair though, there isn't as much good introductory resources on base R, that aren't very discipline specific.

I do completely agree otherwise, but those people will learn through bitter, bitter experience that those dependencies will break over time and will see the light that is base R.

Re:Choose Boring Technology (2015) by polytely on Sunday June 07, 2020 @04:15PM (#23450401)
Totally agree, I'm currently learning Elixir and it has been such a delight to work with compared to Javascript. I'm writing a simple static site generator and I've not used any external libraries yet, because everything I've wanted to do thus far has been easy to build with the functions included in the standard library.
Re:Choose Boring Technology (2015) by sradman on Sunday June 07, 2020 @05:28AM (#23446007)
Choose “proven” technology, or “boring” tech as the original article calls it, applies here too. Popular libraries that are embedded in multiple language runtimes are written in C. SQLite comes to mind. Choose boring dependencies written with boring integration interfaces.
Re:Choose Boring Technology (2015) by randombytes6869 on Sunday June 07, 2020 @07:19AM (#23446571)
> at some point you will have a look into your myriad of nodejs dependencies and see with horror that they rely on C++ extension

This is a big selling point of the most boring languages of all, Java and C#. Performance is close enough to C, and FFI is painful enough, that its rare to see any native code in a project. Other languages that are slower or have better FFI have a much bigger risk of bitrot if you're going to keep a backend around for decades.

Where I work we deploy the exact same pre-built artifact to our Mac dev machines, Linux servers, and Windows QA guys. With Go, Python, JS, Ruby, etc we would have to have it built specifically for the platform. They all use enough native libraries that you can't share a zip file. And its a huge pain to cross-compile for anything except Linux.

Re:Choose Boring Technology (2015) by speedgoose on Sunday June 07, 2020 @03:48AM (#23445566)
If a NPM package requires a C++ compiler, I ignore it and move on.
Re:Choose Boring Technology (2015) by mbrodersen on Monday June 08, 2020 @02:35AM (#23454147)
V8 (and other Javascript JIT compilers) are written in C++. Whenever you think you run Javascript code, what you are actually running is C++ code that will emulate and compile your Javascript into machine code, update the DOM with C++ code, access sockets using C/C++ code etc. all running on an OS written in C/C++. Your code is a very small percentage of the code that runs "your" application. C/C++ runs the world. Including Javascript, Python, Java etc.
Re:Choose Boring Technology (2015) by speedgoose on Monday June 08, 2020 @03:18AM (#23454324)
I do trust the C++ of V8 and NodeJS because it's used by many and well tested in the field.

I do not trust a random npm package with C++. C++ is way too level and insecure and it's not worth it.

Re:Choose Boring Technology (2015) by winrid on Sunday June 07, 2020 @03:38AM (#23445519)
Well, in my experience you cache those dependencies via something like jfrog. That helps. But yeah, dependencies require maintenance.
Re:Choose Boring Technology (2015) by randombytes6869 on Sunday June 07, 2020 @06:37AM (#23446325)
There's languages better than TS/JS for back-ends. I don't mind Typescript but I only use it because some flavor of JS is mandatory these days.

The non existent standard library and pretty nutty dependency management makes JS a bad choice for back-ends. There was a article a few days ago on how Deno is aiming to fix most of this and other issues, but I wouldn't use it for a couple years.

Back ends tend to stick around far long than front ends. Every company I've worked at is still running their original back ends, some decades old. Front ends are easier to replace because it tends to be just UI stuff, not a lot of business logic. I apt to take a lot less risk on the backend. It's probably going to be around forever and customers don't have to see how crusty it is :)

Re:Choose Boring Technology (2015) by mettamage on Sunday June 07, 2020 @03:13AM (#23445427)
Seconding this. I have the same experience.
Re:Choose Boring Technology (2015) by hackeryogi on Sunday June 07, 2020 @02:00AM (#23445134)
While I completely agree with your _sentiments_ I think there is a conflation between choosing _the right tool_ for the job vs using 'too many things'.

I shun the unnecessary - completely with you on that. But I'd prefer gaining relative mastery over _1 decent tool_ in each of the areas that you pointed out so that I have enough tools in my toolkit which prevent me from using the wrong tool for the wrong job. For example, I'd hate to use shell scripts to do something that ansible does really well.

A modern solution, fortunately or unfortunately, is built up of multiple smaller tool sets as you pointed out - and, if used correctly, each enhance productivity tremendously. Writing a frontend app (something that I've only recently started doing since I'm on my own) is immensely more productive if working with something like react rather than with a relatively old framework based on the jvm.

What I'm trying to say is - tech we use is ultimately a tool - we should optimise for productivity. In that case, Boring Technology helps being more productive since we know a lot more about it which makes it easier for us to bend it to our will as well as debug/diagnose the unknowns.

But it also doesn't mean we continue to use `grep` when silversearcher/ripgrep is out there in the world :)

That's the lens that I look with when I come across new tools/technologies (regardless of how long they've been around) - do they have the potential to be net-productivity enhancers over a long-ish period of time && by how much (0.5x? 5x?).

Re:Choose Boring Technology (2015) by ashildr on Sunday June 07, 2020 @06:08AM (#23446178)
The young people in my company made sure our webpage is a react app.

I gave in because they are having fun and it looks good, but it could have been done in static html (maybe using a generator) way more easily.

It hurts me everytime I‘m thinking about it.

Re:Choose Boring Technology (2015) by bottled_poe on Sunday June 07, 2020 @10:26AM (#23447549)
Ask them how they’ve addressed SEO. I doubt there’s a good answer. In my experience you’re better off just using Wordpress for a marketing website. It already does the vast majority of what a marketing website needs. Now, a rich web portal/SaaS product is a different story. Choosing the right tool for the job only comes with experience.
Re:Choose Boring Technology (2015) by agustif on Sunday June 07, 2020 @07:59AM (#23446752)
You could suggest them to use React/NextJS, but publish a static export (yarn export) which is the buildtime compiled HTML+CSS+JS from react, but without needing anything else.

Works well for static pages, this is what I did so II could use next/react and deploy to a boring LAMP server we have for our landing pages.

Re:Choose Boring Technology (2015) by bottled_poe on Sunday June 07, 2020 @10:27AM (#23447561)
Don’t do this. I’ve just been through the process. Trust me. For a marketing website just use Wordpress and save your time for something more valuable.
Re:Choose Boring Technology (2015) by agustif on Monday June 08, 2020 @01:35PM (#23458670)
It works for me, already shipped. A bit late for the advice I guess. Use what you know?
Re:Choose Boring Technology (2015) by cutemonster on Monday June 08, 2020 @02:58PM (#23459605)
Works for me too -- for me, Gatsby or Hugo etc are quicker and simpler than WP

Especially long term wrt security

Re:Choose Boring Technology (2015) by BigJono on Sunday June 07, 2020 @07:05AM (#23446489)
I fucking wish this was the extent of the web stack madness in half the places I've worked.

The amount of stuff you can ram into a front-end code base is truly insane.

Re:Choose Boring Technology (2015) by johnchristopher on Sunday June 07, 2020 @07:26AM (#23446605)
I don't totally share your sentiment (what does a UI designer/frontend guy care about Puppet/Chef/Docker ?) but there's something to be said about the fact that some pieces of css and javascript code is bundled as some angular/vue/react/whatever modules/bricks and you need a gulp/grunt/yarn/makefile to get some js/css code.
Re:Choose Boring Technology (2015) by jakelazaroff on Sunday June 07, 2020 @03:02AM (#23445373)
Most of these things are actually necessary, though. Other than the frontend framework and language, basically all of those layers have been required for decades. You literally can’t make an “app” without either a frontend or backend language.
Re:Choose Boring Technology (2015) by arsenico on Sunday June 07, 2020 @03:20AM (#23445452)
You're saying exactly what the message above states - either, or. It is totally possible to have a boring JS stack, or a boring Ruby stack, or a boring Python stack. And for most of use cases, that is more than enough. One of the best examples is Basecamp, but only because it has a very strict frugality around technology, which, as we see, pays off in the long run.
Re:Choose Boring Technology (2015) by jakelazaroff on Sunday June 07, 2020 @03:41AM (#23445533)
Sure, but what I was trying to get at was that it strikes me as very weird to count “CSS” or “a load balancer” or “a backend language” or “an SSL certificate” in a list of examples of how web development stacks have gotten out of hand.
Re:Choose Boring Technology (2015) by arsenico on Monday June 08, 2020 @12:11PM (#23457855)
CSS in itself is not getting out of hand. Supporting LESS, SASS and Stylus and vanilla CSS in one project is getting out of hand. Same for everything else.
Re:Choose Boring Technology (2015) by jakelazaroff on Monday June 08, 2020 @11:12PM (#23463270)
Who is supporting all of these things in one project? I’ve literally never worked on a project that’s used more than one CSS preprocessor.