There are good frameworks in PHP too and not all PHP code is garbage.
140 karma · joined March 15, 2014
There are good frameworks in PHP too and not all PHP code is garbage.
I have used both Flask and Django for a long time, so I think I could contribute a couple of points in this regard.
- Django with a very good documentation and batteries included helps to build a lot of functionality in less time without having to look anywhere else. In the same time, flask being a microframework, you need to look for the batteries yourself and it takes experience and knowledge to know which components to use and which to avoid.
- None of these two frameworks will magically fix the scaling issues or are free to scaling issues.When you hit issues with scaling, you need to find the bottleneck and fix it. There is no other magic bullet here. I would suggest do not be religious about things and try both of them without any bias in your personal projects and then evaluate. Do not form an opinion without knowing something yourself.
> The nature of Django encourages tight coupling between unrelated parts of the system - Models intertwine database operations and business logic, ModelViews intertwine db operations, business logic and the interface layer.
It totally depends how your architect your application and how you write code.
Any framework you choose, you need to write good code, keep an eye on db operations, enable caching where it is required and you will survive the scale just fine. All the arguments are exactly same in the favor of slack.
Do not spread the FUD that using a framework can magically make your application scale. I have seen very bad and very good code in both Django and flask. If you want your application to scale, you need to carefully work on it there is no silver bullet.
> That is pretty common practice for a lot of software and especially packages on npm.
This is mostly what I have a problem with. Almost everyone is other ecosystems do not do something like this and there is a very good reason for it. Why not just follow a known and standard process of releasing things. https://twitter.com/maybekatz/status/966730802187792386
Even the NPM dev acknowledge the current process to be faulty and are considering switching to use pre-release tags.
Are you not talking about Java here? ;)
Clearer code makes it easier to reason and hence easier debugging. Correct me if I am wrong.
Also, it really depends on person to person on how they write the code. Django does not mean big boilerplate nor does Rails.
My main question was on performance. How do they stack up next to each other? Python3 with Django is really working well these days. You can also check out the performance improvement on Instagram because of it. https://thenewstack.io/instagram-makes-smooth-move-python-3/
Python3 upgrade is a task, agreed. But it actually gives good returns. The language is nicer to write in and we even saved some memory and CPU on the same load after the upgrade. So highly recommended.
I never said that. My whole premise is that you can't say anything like this by just saying code count on two very different projects. Maybe you didn't read my comments properly.
I agree with this. But just saying Firefox has X millions of lines of code doesn't say anything about the possibility for Linux to be ported to Rust.
Many kudos and one day I will definitely buy a LICENSE.
Then when burnout struck me hard, I realized that I just don't want to open my laptop anymore. Also, even side project started to feel like a burden to me.
Then I decided, enough is enough and I need to do some changes to my life.
- I did join a gym near my house.
- I stopped coding in evenings. I would wake up early and code for 2-3 hours in morning and be content with whatever I achieve during that time.
- Evening hours after office would be only for gym, relaxing, having dinner and watching TV.
Believe me, it was the best decision I did for myself. My health both mental and physical improved drastically and I started loving coding again.
This is our gunicorn.conf that ensures gunicorn does not cause memory leaks
import multiprocessing
import os
import random
from getenv import env
def pre_fork(server, worker):
f = '/tmp/app-initialized'
open(f, 'w').close()
bind = 'unix:///tmp/nginx.socket'
workers = os.environ.get('WEB_CONCURRENCY',
(multiprocessing.cpu_count() * 1 - 1))
MAX_GUNICORN_REQUESTS = env('MAX_GUNICORN_REQUESTS', 100)
if MAX_GUNICORN_REQUESTS:
max_requests = MAX_GUNICORN_REQUESTS
MAX_REQUESTS_JITTER = env('MAX_REQUESTS_JITTER', 25)
if MAX_REQUESTS_JITTER:
max_requests_jitter = env('MAX_REQUESTS_JITTER', 25)You have wrong information.