
Ask HN: Are you programming server-side web apps without a framework? - open-source-ux
Web frameworks for server-side development are very popular - so much so that it&#x27;s more unusual to hear of apps and services that don&#x27;t rely on a framework. By web framework, I mean frameworks like Django, Flask, Ruby on Rails, Sinatra, Symfony, Laravel, etc.<p>Are you doing web development but without a web framework? If so, what were your reasons for foregoing a framework? How have you found the process of going framework-free?
======
billconan
I'm kinda doing it now, [https://github.com/shi-
yan/Swiftly](https://github.com/shi-yan/Swiftly)

Swiftly is a framework I wrote on top of bare socket a while back. I'm now
working on a simple saas idea with this.

I tried new languages and frameworks before, but I didn't like most of them.
mostly because I don't like the programming language. Python for example,
needs you to spend more time to dig documents in order to find out data types
and you will have to execute your code to find out typo errors.

Before using my own code this time, I investigated perfect and django, but
eventually decided to use my framework. because, As for perfect, I found it
unstable. The program crashes and no sufficient support. I disliked django
because it's too high level, too much details are hidden behind it. I don't
like to spend time on understand its config file.

------
smt88
> _If so, what were your reasons for foregoing a framework?_

Many other people have written about this, so I'll keep it short.

It's quick and easy to get started with frameworks, but you inevitably try to
do something that's very difficult to figure out how to do. Instead of just
writing code that does it, you have to search the docs of the framework to
figure out how to do it the way the framework wants.

But guess what? The framework can't/doesn't have infinite documentation, so
they often don't tell you how to do it.

You end up reading docs more than writing code.

Frameworks are also complicated and full of magic. You have to know the
language, but then you also have to learn the framework. You usually can't
just read the code to understand how the app works.

> _How have you found the process of going framework-free?_

Amazing. I'll never go back.

~~~
chuck32
> It's quick and easy to get started with frameworks, but you inevitably try
> to do something that's very difficult to figure out how to do. Instead of
> just writing code that does it, you have to search the docs of the framework
> to figure out how to do it the way the framework wants.

The problem with this mindset is that yes, its quicker to just bash out some
code that does what you want it to but what happens when another developer has
to work with that same code later down the line? They are going to have to
spend time to figure out how you've structured everything.

One of the advantages of using a framework is to follow a standardized
structure. That way a developer only has to learn the framework's structure
once, as opposed to learning the individual preferred structure of each and
every colleague he collaborates with.

> You end up reading docs more than writing code.

I would say that this the reality of being a software engineer. A good
software engineer spends more time reading docs, researching design patterns,
reviewing existing implementations and considering the implications of
different solutions than he does writing actual code.

> You usually can't just read the code to understand how the app works.

This isn't my experience with frameworks. Since pretty much all frameworks
follow the MVC pattern its usually clear where everything goes.

~~~
le-mark
> The problem with this mindset is that yes, its quicker to just bash out some
> code that does what you want it to but what happens when another developer
> has to work with that same code later down the line? They are going to have
> to spend time to figure out how you've structured everything.

For professional development, when someone is paying you, sure, this is
absolutely correct. But in the case of banging out a side project, it makes
much less sense.

I went frameworkless on an mvp last year. I was able to code and implement
features using raw apis quickly. I reached MVP status and launched. One year
later, no users and I'm closing the site. I'm sure glad I didn't waste a lot
of time learning a new framework who's complexity and standardization I never
needed!

~~~
chuck32
> I went frameworkless on an mvp last year. I was able to code and implement
> features using raw apis quickly. I reached MVP status and launched. One year
> later, no users and I'm closing the site. I'm sure glad I didn't waste a lot
> of time learning a new framework who's complexity and standardization I
> never needed!

But if you are already experienced in a framework like rails, django or
laravel, then bashing out a side project should be significantly faster with
the framework then without. There are so many things you dont have to re-
invent when using a framework like routing, installing an ORM, rendering
templates etc.

I honestly haven't read any convincing arguments against using a framework in
this thread other than "I don't want to spend time learning it" but if you
pick a popular and mature framework like rails or django then learning that
will benefit you loads in the long term.

Also keep in mind you could make the same argument against learning a
programming language like C and say "I just prefer writing assembly code
becuase I know exactly what bits go into which registers".

~~~
marktangotango
Why are you so concerned with what others do? IME there's this
language/framework tribalism culture in software that's extremely poisonous;
language/framework supporters go online and bash, spread fud, and denigrate
other languages and frameworks. It's poison and taints our entire profession.

I propose that avoiding such triabalism is adequate reason to not use
frameworks! You haven't advocated any particular framework but maintain some
sort of framework use is best position, which is odd. Learning frameworks does
take time, and when you're iterating a side project, with a mortgage, 3 kids,
and spouse, time is the last thing you have. Is this you? Probably not! But
that's the reality for some.

Certainly learn a framework to pay the bills, j2ee has been very lucrative for
me for 13 years. I would never use it for a side project!

~~~
chuck32
> Why are you so concerned with what others do?

This is a discussion about whether or not to use frameworks isn't it? I'm
argueing for using a framework rather than against, isn't that the whole point
of a discussion?

> IME there's this language/framework tribalism culture in software that's
> extremely poisonous; language/framework supporters go online and bash,
> spread fud, and denigrate other languages and frameworks.

Not sure if you're saying this because you think I'm bashing/fudding people
who don't use frameworks? I'm just argueing a point.

> You haven't advocated any particular framework but maintain some sort of
> framework use is best position, which is odd.

I think I've put my reasons for advocating frameworks over no frameworks
pretty clearly?

> Learning frameworks does take time, and when you're iterating a side
> project, with a mortgage, 3 kids, and spouse, time is the last thing you
> have. Is this you? Probably not! But that's the reality for some.

If you have a spouse/kids/mortgage then IMO its even more important that you
learn to use a mainstream framework for whatever language you are using
because its the way the industry is heading. Spending time on a side project
in that situation would be a very bad use of your time while learning a
framework will benefit your career immensely. The reality of the tech industry
is that you do need to spend some time to keep up to date with modern tech
trends, whether or not thats good or bad is another discussion.

------
jetti
I'm starting to make a blog engine in Elixir using Plug instead of a
framework. Sometimes I regret the decision just because the frameworks make
things so much easier and I'm not reinventing the wheel. That being said I'm
learning a lot so that's good...

------
crispytx
PHP is my GOTO language on the backend, and I don't use a framework. That's my
favorite thing about PHP - you don't really need a framework. (I know lots of
people do use PHP frameworks, it's just my opinion that you don't really need
one.)

------
petepete
It depends how complex the thing you're building is and what it needs to do.
If you're building a web app for low/moderate traffic (i.e. not Youtube or
Facebook) that talks to a database, authenticates users, has a load of assets
that require preparing/precompiling, serves dynamic server-rendered templates,
implements caching etc you may as well use a framework. Much of the work is
done and decisions have been made by experts.

I wouldn't classify Sinatra in the same way as the other frameworks you
mention; it's _very_ lightweight and (intentionally) doesn't offer much out of
the box. It's ideal for building APIs and other simple things but, if you need
a fully-fledged site that does everything listed above, the case for just
using Django or Rails is much stronger.

I now build APIs and services with Go. It's well suited for the task and makes
deployment super-easy.

~~~
smt88
You seem to be confusing "using code that other people wrote" with "using a
framework". You can write an app that's 90% already written via libraries
without using any framework at all.

The different between libraries and frameworks is control. The framework tells
you how to do it. But just using libraries, you tell the libraries how to do
it.

> _If you 're building a web app for low/moderate traffic (i.e. not Youtube or
> Facebook) that talks to a database, authenticates users, has a load of
> assets that require preparing/precompiling, serves dynamic server-rendered
> templates, implements caching etc you may as well use a framework._

All of this can be done with libraries.

~~~
petepete
Yes, you could painstakingly evaluate, test and use individual libraries for
all those tasks, and then manually write the glue to make them work together,
and when the time comes spend additional time ensuring that when upgrades are
applied everything still works nicely together.

Or you could use Rails.

~~~
smt88
The time you spend "painstakingly" evaluating and testing libraries is much,
much less than the time spent painstakingly trying to do something in the way
that the framework forces you to do it.

Using a framework is optimizing for the first few months of development and
shooting yourself in the foot later on. That especially includes the time
spent either finding devs who are very competent with the framework or
training someone.

If you just use libraries properly, you can hire anyone (even someone who
doesn't know the language at all) and just throw them into the code base. They
can follow the code and actually understand it without googling every 2
minutes. There's no magic.

Have you tried both approaches long-term on multiple projects? If you haven't,
how can you know that frameworkless is more work?

~~~
petepete
I've written many projects frameworkless, my current project included. I love
the extra flexibility it gives and that I only add what I need. It's not a
black and white issue.

Not all from are as magic as you say, and if they were such a pain they
wouldn't be in such demand. For most people they provide a helping hand.

You might be expert enough not to need one but most people, myself included,
quite like having the foundations laid and just concentrating on
functionality.

