14 votes
Accepted

What is the right time to go for Code Refactoring, not optimization?

First of all, no Java does not have enforced coding standards. Anything you can make work in JavaScript I can also make work but look worse in Java. Working, in any language, doesn't ensure that it's ...
candied_orange's user avatar
12 votes

Does RESTful response always return a 404 and empty content when an array is expected but the result is empty?

You're right, the behavior is indeed strange. A null and an empty array are, semantically, two different things. An empty array indicates exactly that: the array exists but contains no elements right ...
Arseni Mourzenko's user avatar
9 votes
Accepted

Django web app: how to save thousands of variables per user

Using a column per question makes it difficult to add more questions later. Instead, model the relation between users and questions in your table. I.e. the questions are encoded explicitly as data, ...
amon's user avatar
  • 134k
7 votes

Using singletons in Python (Django)

Using Singletons in Python What is a singleton? A singleton is an object of which there is only one, semantically, in memory. Builtin singletons None is a frequently used singleton. NotImplemented is ...
Aaron Hall's user avatar
  • 5,945
7 votes

Does software architecture depend on framework being used?

Your framework choices strongly influence the architecture your applications will have. Many of the architectural decisions have already been made by the framework for you, so trying to impose your ...
Robert Harvey's user avatar
6 votes

Django web app: how to save thousands of variables per user

You should normalise your database schema. This means that instead of just having a User table, you would also have a Questions table containing information about each question, then you would also ...
Sean Burton's user avatar
6 votes
Accepted

Communication between two apps

The idea that App 2 makes a request back to App 1 is a common architecture to get web services to work together. Usually, this would work like this: App 1 makes a request to App 2 the request ...
amon's user avatar
  • 134k
5 votes
Accepted

Populate User info between services on microservices architecture

It should depend on the way the data is stored and used. Storage: Some architectures will have a separate database for accounts, and another one for user information. This makes particularly sense ...
Arseni Mourzenko's user avatar
5 votes
Accepted

Why do people keep reusing superclass names in their subclasses?

Generally there are two schools of thought on this: Multiple types with the same name are fine if the name makes sense for them all. Differentiate them via a package/namespace/module etc name. Avoid ...
David Arno's user avatar
  • 39.3k
5 votes
Accepted

What makes LINQ (C#) unique compared to another DSL such as Django query syntax?

What makes LINQ (C#) unique compared to another DSL such as Django query syntax? Simply put: what makes C# Language INtegrated Queries unique is that it is a Query Language that is Integrated into ...
Jörg W Mittag's user avatar
4 votes
Accepted

Fully API-based website - is it a good idea?

It sounds like you are talking about a 'single page app' This term is used to refer to websites where all or most of the actions you take are accomplished via client side javascript AJAX calls, ...
Ewan's user avatar
  • 75k
4 votes
Accepted

Hardcoding on frontend

The answer to this depends how much you want the UI to cope with future requirement changes, such as additional buttons for different kinds of filterings. For trivial apps, most people will hard-code ...
b0nyb0y's user avatar
  • 394
4 votes

What is the right time to go for Code Refactoring, not optimization?

From your question, it appears your are confusing "refactored" with "optimised" and are actually referring to the former. When should you refactor? That's easy, straight after (never before) your ...
David Arno's user avatar
  • 39.3k
4 votes

Django - separation from the frontend (Templates)

So you need to show different states of your application -- a landing page, a list of cars, a single car's details, a procedure with a set of forms and prices etc for when you actually buy the car, et ...
RemcoGerlich's user avatar
  • 3,310
4 votes
Accepted

How do I know a product is in the "will_expire" state?

This is the classic age problem. You want to know how old your customers are. Should you check every customer every day to see if it's their birthday? No. Don't even store anyone's age. Store their ...
candied_orange's user avatar
4 votes
Accepted

How should I update non-maintained database tables between production and development?

A problem occurs when I need to manually modify the non-maintained data in the development version. Then don't. Instead, create an SQL script which does. Reapply that script at an appropriate time ...
Doc Brown's user avatar
  • 207k
4 votes

Can I manage thousands of concurrent connections with a non-Node stack?

Always be prepared to do things over, sometimes you have to. But also don’t let perfect be the enemy of good enough. Since this is a first attempt, program it using the languages and libraries you ...
Robert Baron's user avatar
  • 1,132
4 votes
Accepted

Understanding the importance of Gunicorn and Nginx for Django web development

This doc mentions DO NOT USE THIS SERVER IN A PRODUCTION SETTING. It has not gone through security audits or performance tests. So I guess that's the part where "Django is not designed for real-...
lennon310's user avatar
  • 3,212
4 votes

Is microservice approach always best fit for ETL processes?

Using a microservice architecture is mostly about two things: independent development lean scaling (with as little software on each new server as possible) Independent development is likely not ...
Lutz Prechelt's user avatar
3 votes

Data Transfer Between Loosely Coupled Modules of an Application

This question appears misguided. You say you want to 'transfer data between loosely coupled modules', but in almost any reasonable real world case, you would be transferring data 'for a reason'. The ...
Lewis Pringle's user avatar
3 votes

Advantages and disadvantages of building web app purely with microservices and hybrid with web framework

Frameworks have come a long way. They're very powerful and get amazing things done. They've also become so ingrained into the languages they work with that employers have to mention them when ...
candied_orange's user avatar
3 votes

Does RESTful response always return a 404 and empty content when an array is expected but the result is empty?

Don't forget that 4xx errors are client errors, per HTTP specification. It really comes down to do you want to tell the client that its request was wrong, or do you want to say you don't have anything ...
imel96's user avatar
  • 3,518
3 votes

How to develop front end (UI) for my Django website

Perhaps learn how to use html + bootstrap. Bootstrap is a modern package to make responsive sites where the CSS and JavaScripts are almost, if not all, taken cared of for you. So no need to dig way to ...
berdstack's user avatar
3 votes

How can I model unknown and an unknown number of attributes on an object?

Django can store JSON directly in the database with JSONField. It is supported in some databases only, but https://docs.djangoproject.com/en/dev/ref/contrib/postgres/fields/#jsonfield and http://...
btilly's user avatar
  • 18.3k
3 votes

Django Fat Models: Where should I put model creation logic?

I would recommend create classmethod on ReceiptItem. In large code bases, you want model instance creation logic to be not spread all around your code base. Think what happens when in future you ...
mahoriR's user avatar
  • 131
3 votes

Does software architecture depend on framework being used?

The answer to your question from the title depends on the definition of "software architecture". One popular definition is: the design decisions which are costly to change at a later point time (at ...
Doc Brown's user avatar
  • 207k
3 votes
Accepted

Why does the Django Rest Framework encourage separating Model, Serializer and Views for the same object across multiple files?

This was a common convention at the time django was developed, followed by other frameworks of the time like Rails where you had a models directory with all your models, a controller directory with ...
Cormac Mulhall's user avatar
3 votes
Accepted

Is Python's Django WebFramework good to design Expert System as a Web App?

A web app is an application accessible through the web. One possible way of doing a web app is to have a front end (that's the part that presents the application for use in a web browser, including ...
Hans-Martin Mosner's user avatar
3 votes

Can I manage thousands of concurrent connections with a non-Node stack?

So I did some googling, Django has its own set of stuff for websockets, Django channels and behind that Daphne servers. There doesn't seem to be any documentation about how scaleable Daphe is. There ...
Ewan's user avatar
  • 75k
3 votes

What makes LINQ (C#) unique compared to another DSL such as Django query syntax?

While Linq is certainly an attractive feature to consider on its own merits, the real value of Linq is all of the other powerful language features that were added to the C# language and framework that ...
Robert Harvey's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible