News for hackers. Stuff that matters.
Re:Building the Same App Using Various Web Frameworks by apitman on Wednesday September 11, 2024 @12:19AM (#41507978)
Creating an app is one thing. What I want to know is what's the update experience like 3 years later when I haven't touched the code in forever and I'm getting a flood of dependabot notifications about critical vulnerabilities.

I'll just have vanilla thanks.

Re:Building the Same App Using Various Web Frameworks by 0xblinq on Wednesday September 11, 2024 @01:10AM (#41508191)
Exactly!. Why use a library when you can write everything from scratch yourself. That for sure won't have any bugs or security issues and will be super easy to pick up by the next dev.

I also follow this approach with my operating system. I'm tired of vulnerabilities so I'm writing my own.

Re:Building the Same App Using Various Web Frameworks by zwnow on Wednesday September 11, 2024 @01:25AM (#41508247)
I am currently building my own car and house, cant trust these engineers to do it right!
Re:Building the Same App Using Various Web Frameworks by shahzaibmushtaq on Wednesday September 11, 2024 @01:53AM (#41508399)
I am currently becoming a doctor too, can't trust these doctors to examine me properly!
Re:Building the Same App Using Various Web Frameworks by PaulRobinson on Wednesday September 11, 2024 @02:13AM (#41508498)
Don’t forget to become an organic chemist. What does big pharma know about drug development and production? Plus, it means all my vaccines and medications are Organic and Homemade. Those words definitely mean “better” in all cases.
Re:Building the Same App Using Various Web Frameworks by oarsinsync on Wednesday September 11, 2024 @02:16AM (#41508514)
https://news.ycombinator.com/newsguidelines.html

In Comments

Be kind. Don't be snarky. Converse curiously; don't cross-examine. Edit out swipes.

Comments should get more thoughtful and substantive, not less, as a topic gets more divisive.

Please don't fulminate. Please don't sneer, including at the rest of the community.

Please respond to the strongest plausible interpretation of what someone says, not a weaker one that's easier to criticize. Assume good faith.

Re:Building the Same App Using Various Web Frameworks by moi2388 on Wednesday September 11, 2024 @02:24AM (#41508545)
I grow my own mushrooms. On my own body of course, can’t trust the soil these days.
Re:Building the Same App Using Various Web Frameworks by seanthemon on Wednesday September 11, 2024 @02:02AM (#41508441)
I'm currently becoming a receptionist so I can tell you you can't see yourself for another month.
Re:Building the Same App Using Various Web Frameworks by EGreg on Wednesday September 11, 2024 @06:10AM (#41509864)
Aw guys sorry. I used to be a virologist but now I am an expert on war and geopolitics in about a dozen countries. Gotta do what you can to keep up with the Twitterses. Best of luck with that whole medicine thing though!
Re:Building the Same App Using Various Web Frameworks by archerx on Wednesday September 11, 2024 @03:10AM (#41508819)
Exactly! Third party libraries never have bugs or security issues and are all known by all developers like the back of their hands!

I doubt you could write your own OS if your life depended on it though.

Re:Building the Same App Using Various Web Frameworks by protomolecule on Wednesday September 11, 2024 @04:59AM (#41509481)
Can you?
Re:Building the Same App Using Various Web Frameworks by archerx on Wednesday September 11, 2024 @01:01PM (#41513247)
I never claimed I could.
Re:Building the Same App Using Various Web Frameworks by protomolecule on Wednesday September 11, 2024 @03:09PM (#41514396)
Sorry, I probably got confused by too much sarcasm in this thread.
Re:Building the Same App Using Various Web Frameworks by meiraleal on Wednesday September 11, 2024 @04:32AM (#41509328)
Don't bring reddit to HN.
Re:Building the Same App Using Various Web Frameworks by EGreg on Wednesday September 11, 2024 @06:11AM (#41509868)
Pssht. Real programmers build their own hardware https://xkcd.com/378/
Re:Building the Same App Using Various Web Frameworks by adamhartenz on Wednesday September 11, 2024 @01:04AM (#41508165)
Your vanilla app will have the same vulnerabilities, but you just won't know, because there are not thousands of people checking your code constantly. Not knowing, and not having vulnerabilities are two very different things.
Re:Building the Same App Using Various Web Frameworks by 8n4vidtmkvmk on Wednesday September 11, 2024 @01:13AM (#41508207)
Having a very tiny attack surface helps. 30 lines of JS is unlikely to have a critical vulnerability compared to 100k lines of random libraries.
Re:Building the Same App Using Various Web Frameworks by threatofrain on Wednesday September 11, 2024 @02:38AM (#41508615)
Having a very tiny app helps. In 30 lines of JS I couldn't implement a small data structure. But if you're building a front-facing app for consumers then public opinion is the judge of whether your app is emotionally delightful (more important than useful).
Re:Building the Same App Using Various Web Frameworks by Joeri on Wednesday September 11, 2024 @01:30AM (#41508271)
I think a vanilla project will have fewer vulnerabilities, not more. Most of the vulnerabilities in frameworks are in the very complicated build tooling or deeply nested dependencies. A vanilla project doesn’t have that, so there are entire classes of vulnerabilities that don’t occur there. Vanilla does come with a higher risk of XSS, but basically all you need is a templating function that does XSS defense like lit-html and you’re good to go.
Re:Building the Same App Using Various Web Frameworks by Juliate on Wednesday September 11, 2024 @06:20AM (#41509920)
Yes. A higher risk of SQL injection too, also. Or of brute force attacks/scans, but those are often not managed at the app/framework level anyway.
Re:Building the Same App Using Various Web Frameworks by Joeri on Wednesday September 11, 2024 @12:57PM (#41513198)
SQL injection will depend a lot on what backend language you’re working with. Most have platform database api’s that can do parameter binding.
Re:Building the Same App Using Various Web Frameworks by norman784 on Wednesday September 11, 2024 @01:09PM (#41513331)
I suppose that you are not writing your db driver from scratch and you are using a driver that was at least written in the last 10 years, so it will support for sure prepared statements and you will use it, that means no possibility of SQL injections.
Re:Building the Same App Using Various Web Frameworks by devjab on Wednesday September 11, 2024 @02:39AM (#41508624)
I’d like you to elaborate on how an app with no external dependencies has the same line or vulnerabilities that an app which pulls literal thousands of external dependencies. Even if you still use Node/Bun/Whatever as your core but then build your own app with no external dependencies you’re going to reduce the security risks you have greatly.

This is if you’re using JS. If you’re building your application in something like GO only using the standard library and writing all the JS you use yourself, then you’ll have almost no external vulnerabilities.

I know it’s common in software engineering to rely on others to be your security, but this has proven to be a terrible idea so many times by now. The most known example is Log4j, but there have been many other examples. This is made even worse with how attacks are done today, which is largely automated. So if you use an extremely common technology which turns out to have vulnerabilities then you’re also going to be far more likely to be attacked.

Re:Building the Same App Using Various Web Frameworks by graemep on Wednesday September 11, 2024 @04:09AM (#41509175)
Front end is tricky, but is less security critical as you should not trust the client anyway.

I think Node may be a lot worse than this, but looking at two Django projects, one on which I have really kept dependencies to a minimum and one I feel has two many dependencies I get 9 and 74 dependencies respectively.

Re:Building the Same App Using Various Web Frameworks by j-krieger on Wednesday September 11, 2024 @02:57AM (#41508730)
> I’d like you to elaborate on how an app with no external dependencies has the same line or vulnerabilities that an app which pulls literal thousands of external dependencies.

Because it is not vetted. These dependencies are run through multiple checking tools day by day. You will get automated alerts for dependencies, which you can then easily patch. There is an entire industry behind checking for vulnerabilities in public libraries. The best incentive for something is and has always been money.

You have neither of this if you roll your own entirely.

> I know it’s common in software engineering to rely on others to be your security, but this has proven to be a terrible idea so many times by now.

This is a false equivalency. Log4j was found, publicly discussed and was subsequently patched.

Re:Building the Same App Using Various Web Frameworks by Juliate on Wednesday September 11, 2024 @06:17AM (#41509901)
That depends a lot on how complex, large and critical your app is. And on the skills of the builder and the maintainer.

The surface attack is considerably reduced if you do not rely on a large list of dependencies. Moreover, you do manage to know _better_ the ins and outs of each bit of your system (because you wrote it, and the whole surface has been walked on at least once).

Unless you are of a specific interest to an attacker, not relying on external dependencies makes you less detectable as your app may not behave as scanner expect it to.

It's a bit like comparing going on a trip by walking with one person you know well or with 100 people: you still get to make the trip, but, the delays, the risks, the provisions, the contingencies, the consequences of an incident are not really in the same scope.

But for any large project involving more than 4/5 people, perhaps relying on no external dependencies may be a bit complex to manage in the long run.

Re:Building the Same App Using Various Web Frameworks by j-krieger on Thursday September 12, 2024 @07:44AM (#41519726)
> Moreover, you do manage to know _better_ the ins and outs of each bit of your system (because you wrote it, and the whole surface has been walked on at least once).

This only holds if you work only for yourself.

> Unless you are of a specific interest to an attacker, not relying on external dependencies makes you less detectable as your app may not behave as scanner expect it to.

Another argument can be made that you're investing too much valuable time into things that have been solved before - and likely better than a single person could manage.

> But for any large project involving more than 4/5 people, perhaps relying on no external dependencies may be a bit complex to manage in the long run.

In my experience, this is true for any one project with more than one (1) developer, even if the developer might change in the future. Any junior front end developer can be productive in a years old angular project. They might not be in a custom dependencyless project.

Re:Building the Same App Using Various Web Frameworks by afpx on Wednesday September 11, 2024 @12:06PM (#41512680)
I keep typing 'apt update' without verifying the source code.
Re:Building the Same App Using Various Web Frameworks by austin-cheney on Wednesday September 11, 2024 @06:49AM (#41510096)
Security by popularity is nonsense just the same as security by obfuscation.
Re:Building the Same App Using Various Web Frameworks by pelasaco on Wednesday September 11, 2024 @06:55AM (#41510122)
> Security by popularity is nonsense

This is not what the author was suggesting. The author is suggesting that, more people using an open source piece of code has a higher chance to be revised which ultimately would lead to a better security.

Re:Building the Same App Using Various Web Frameworks by austin-cheney on Wednesday September 11, 2024 @07:13AM (#41510212)
This argument comes up super frequently. Yes, more people actually reading the source code is better for identifying security vulnerabilities, but that almost never how it’s either articulated or implied.

When most people make this argument the suggestion is that popular software must be more secure because somebody would have certainly identified and reported the vulnerability. That makes several assumptions not qualified by evidence. In other words it’s wishful thinking.

As a case in point when I reported my first V8 defect it was around the time of Node 4.4. Chrome had been out for several years at that point with many millions of users. The defect I found was that V8 could not perform recursion using only function name. WTF. The problem was missing test cases, not a lack of eye balls.

Re:Building the Same App Using Various Web Frameworks by diatone on Wednesday September 11, 2024 @01:33PM (#41513525)
To adjust an old joke about economics:

“Two open source maintainers are walking along the street when one says:

Look! A repo exposing an API allowing unprivileged deletion of users!

The other replied: that vulnerability clearly cannot be real, as someone would have fixed it already.”

Re:Building the Same App Using Various Web Frameworks by gessha on Wednesday September 11, 2024 @08:52AM (#41510865)
Who checks dependencies other than the author of the library ? The only time I check them is when they break and that's not a good thing.

I see this argument as “it’s not my job” type of argument.

Most of the time you just install and use. If I had infinite time, I’d do it because it’s fun but I don’t so I don’t.

If there’s a trust chain and I know for sure certain libraries are reviewed I’d have a peace of mind. Alas, that’s not the case and we spend our days in back burner paranoia or blissful ignorance.

Re:Building the Same App Using Various Web Frameworks by pelasaco on Thursday September 12, 2024 @11:19AM (#41521929)
well a lot of people do it. Specially if the code is part of a project going through some auditing, or certification.
Re:Building the Same App Using Various Web Frameworks by ranger_danger on Wednesday September 11, 2024 @10:02AM (#41511496)
Technically obfuscation is perfect until it's found. And many times it's never found (the same is true for passwords in general, you could argue that's a form of obfuscation). For example who would ever find a compressed file that masquerades as completely unrelated and harmless looking plain text that was made with a custom dictionary? I think it's more about how good the obfuscation is rather than it being used at all.
Re:Building the Same App Using Various Web Frameworks by austin-cheney on Wednesday September 11, 2024 @02:45PM (#41514153)
This has been disproven many times. Way back in 2010 it was demonstrated that any 14 character password with special characters could be guessed within 10 seconds using a rainbow table. Likewise obfuscation only hides defects from people, not bots, which only serves to speed compromise and slow resolution.
Re:Building the Same App Using Various Web Frameworks by ranger_danger on Wednesday September 11, 2024 @05:00PM (#41515303)
A rainbow table is ineffective against one-way hashes that include large salts, which is most modern password algorithms.

I also don't see how this is related to, or disproves, anything I said...

Re:Building the Same App Using Various Web Frameworks by agos on Wednesday September 11, 2024 @04:09AM (#41509173)
do you often write stuff and then not touch it for three years?
Re:Building the Same App Using Various Web Frameworks by apitman on Wednesday September 11, 2024 @12:44PM (#41513057)
Unfortunately yes. Usually just on little toy projects though.

A more real recent example is this app at work: https://github.com/iobio/bam.iobio.io

That repo is currently unmodifiable due to dependency deadlock/hell. As an experiment we tried re-implementing it as a vanilla web component app. The experience was immediately so pleasant that we committed to that course. We're almost finished. No regrets.

If you want to compare them side by side:

old: https://bam.iobio.io new: https://bam2.iobio.io

This is a relatively simple app. Just a couple pages and a bunch of d3 charts which we only needed to make simple web component wrappers for.

YMMV.

Re:Building the Same App Using Various Web Frameworks by raincole on Wednesday September 11, 2024 @02:09AM (#41508477)
Your first paragraph and the second one seem completely unrelated.
Re:Building the Same App Using Various Web Frameworks by j-krieger on Wednesday September 11, 2024 @02:54AM (#41508706)
> What I want to know is what's the update experience like 3 years later

Exactly. I've been there with vanilla js projects. It doesn't make any difference whether it's been written by me or by another engineer.

It's a nauseating experience. There are little if any conventions. You can't trust any APIs if you've not read what they do exactly.

I will never understand this sort of purism on HN. For any medium web app, by choosing a framework, you will move the mental load of maintaining and bike shedding to thousands of other engineers, leaving you to do the actual work.

Re:Building the Same App Using Various Web Frameworks by azangru on Wednesday September 11, 2024 @03:24AM (#41508914)
> For any medium web app, by choosing a framework, you will move the mental load of maintaining and bike shedding to thousands of other engineers,

Suppose you chose a framework. Suppose you were unlucky in your choice. Let's say you chose Angular.js in 2014... only to discover in 2016 that something called Angular 2 is coming out, and that Angular.js is on its way on being discontinued, and the migration story is horrible...

Or suppose you chose Backbone in 2012, and then by about 2015 it kind of died...

Or suppose you chose Meteor in 2013. It was quite popular then... until it wasn't.

Or suppose you chose Aurelia, which had its moment somewhere around 2015 or 2016, when Rob Eisenberg was promoting it taking advantage of the dreaded Angular migration story and of a sneaky clause in the React license. Yeah, it's dead now.

And so on and so forth. At least what you write yourself, for the specific purposes of your application, lives as long as the application itself, and is as fresh as ever.

Re:Building the Same App Using Various Web Frameworks by j-krieger on Sunday September 15, 2024 @05:40AM (#41546402)
I was still writing and maintaining Angular JS projects in 2020, when I left my old job. It was a worse option than Angular 2.0, but it still worked fine. The documentation still existed.

I was also maintaining Backbone projects.

> And so on and so forth

The web space needed some time to settle down, I'll give you that. The web as we know it is really only less than 20 years old. Technologies took a similar time to settle back when we chose between C, Fortran, Ada and Java (the new kid on the block at the time). If you were _really_ cool, you may also looked into Python.

Engineers had similar discussions back then.

Nowadays, choose React, Angular or Vue and you will have no problems maintining projects 20 years from now.

Re:Building the Same App Using Various Web Frameworks by archerx on Wednesday September 11, 2024 @03:12AM (#41508832)
My experience says other wise but results may vary.
Re:Building the Same App Using Various Web Frameworks by idoubtit on Wednesday September 11, 2024 @05:07AM (#41509534)
The post is about 3 web frameworks for server-side development with Python or NodeJs. What does "vanilla" mean in this context?

Are you really coding web applications with plain Python or plain NodeJS? Does vanilla mean there are no dependencies?

Re:Building the Same App Using Various Web Frameworks by apitman on Wednesday September 11, 2024 @09:29AM (#41511168)
I mostly use Golang, but you could do Python or NodeJS if you wanted. I would probably prefer Deno since node's HTTP functionality is a bit low level.

Getting all the way to 0 dependencies can be tough depending on what you're building, and maybe not worth it. But it's a great feeling when it happens.

What's more important than how many dependencies you import is the quality of them, how well they fit your project (using a high percentage of the library's functionality is a good sign), and the total number of transitive dependencies.

One thing I do sometimes is using git submodules for dependencies. It's annoying to work with, but that friction helps me avoid importing too many things on a wim. It also encourages me to use dependencies that are self-contained.

Re:Building the Same App Using Various Web Frameworks by cryptonym on Wednesday September 11, 2024 @06:32AM (#41509997)
The real pros of vanilla are:

- not having to update due to issues in dependencies of dependencies of dependencies

- not having to rewrite it all because framework maintainer decided to shift to a new paradigm and no longer maintain the old version

- not having your massive framework generating weird request flow that isn't defined in any RFC and can't integrate with industry standards

- not having to pay for specialised hosting because only one or two companies know how to properly host and scale a website built with your massive framework

- being able to integrate or understand actual web technologies because you don't have a massive framework abstracting it all from you

Some frameworks or libraries may have been designed with some of this in mind. If you want to scale and integrate with other stuff, pick wisely because your whole code base will end-up tied to that framework, especially if "full-stack". Tho I have to admit developper experience can be awesome.

Re:Building the Same App Using Various Web Frameworks by austin-cheney on Wednesday September 11, 2024 @07:03AM (#41510168)
For me it’s:

* having code that is more than an order of magnitude smaller and even faster to build and execute.

* working with developers that can actually program and aren’t super afraid of state management, APIs, DOM, measuring things, test automation, and so much more. I really get tired of hearing about reinventing wheels by people who cannot create wheels or drive cars.

Re:Building the Same App Using Various Web Frameworks by cryptonym on Thursday September 12, 2024 @08:02AM (#41519818)
I can relate to working with devs who actual knows about web technologies and are not afraid to learn about stuff outside of their framework-provided comfort zone.
Re:Building the Same App Using Various Web Frameworks by Kagerjay on Friday September 13, 2024 @11:04AM (#41531894)
Im in this phase right now, I used gatsbyJS and netlify in my last projects and things became unmaintainable and difficult to upgrade after a few years, am in the process of just doing a complete rewrite where I have more granular control over everything regardless of framework / business corporatization
Re:Building the Same App Using Various Web Frameworks by d13 on Wednesday September 11, 2024 @07:25AM (#41510296)
Don’t “npm install” anything and just copy the compiled .min.js library/framework files into your “/libs” folder.
Re:Building the Same App Using Various Web Frameworks by apitman on Wednesday September 11, 2024 @09:32AM (#41511197)
I tend to use git submodules to vendor into ./lib. It's rather clunky to work with, but once you know a couple commands it works pretty well. As a bonus, GitHub pages recursively clones submodules automatically. If you're using ES modules, you can host a site with no build step (ie github actions) directly from your main branch.
Re:Building the Same App Using Various Web Frameworks by gregors on Wednesday September 11, 2024 @09:04AM (#41510959)
Going vanilla (assuming it's built of sufficient quality) will save you untold amounts of headache and cost. The bloated dependency stacks and unnecessary breaking feature churn in a lot of these libraries are just a waste of money and time for most organizations.