Is it a bad practice for a required switch to start without having any option checked?

I currently have several (required) components in a form, in which I must select only one option (of the 2 that exist). The previous designer used a switch, however the first time none of the 2 is selected by default, this because the client indicated that he did not want to give priority to one, then I do not know if it is a good practice and if I should change for another component, for example a dropdown enter image description here

Best practice for cleaning fake customers in Magento 1

What if a Magento 1 shop had a nasty bot attack. Thousands of fake customer account were created and subscribed to the newsletter. Some of the account are quite easy to find (fake domains for example), others have another pattern (Front name and last name are exactly the same) and some follow no pattern at all.

Now we are faced with the task of cleaning out these fake customers / subscribers, and we I am wondering what would be best practice? Write an SQL script that filters customers based on certain patterns? Or something else?

What is the best practice for data table cell content alignment

We are currently working on a windows based application where users capture data. Some data is captured in a table where other data is captured in text blocks. Im currently faced with the dilemma of how to align contents specifically decimal values. Editable cells in a grid are indicated with a pencil icon which disappears once in edit mode. You will notice that the table consists of various field types, decimals and text. So what should I do and why?

A> right align all cell content

B> left align all cell content

C> right align only decimal values in cells

D> Whatever else you can suggest

enter image description here

¿is good practice this schema for a nosql database in mongodb?

i would like to know if i am right with the next schema, i hope you understand what i want to explain.

This is a little app, that’s would help to students to manage their school grades, i was thinking of create a new collection for each new user,like:

-new user “newUser01”

-create a collection whit the name “newUser01”.

-and store all the data for that user in their own collection.

of course following a data structure for each collection, for make the proper query.

but, i think that would be a bad practice, what do you think?

And how i can create a general class for make queries to the proper collection of each logged user.

(I will use nodejs for the backend with express and typescript)

i use to work with express/typescript in this way:

for each collection i create a class for make queries to the proper collection, but with the schema that i already explain above, this is not longer a proper way, with mongodb in the cli i can do something like:


and with mongoose, in the callback i can call the method getCollection with the variable db like:

  mongoose.connect("url",(err,db)=>{  db.getCollection("newUser01").find({});  });

But i am working with typescript and strongly typed models, how i can achived my goal?.

Is it bad practice to have a helper package in go for testing purposes. Or is this introducing dependence’s

I find myself repeating the same code when writing unit tests, for example… When writing functions that work with files, In the setup for the test i often write some code to create a file (in a directory specified with an environment variable) populate it then after i have run the test I destroy the file and folder.

To me this seems the correct way of doing things as the test is completely independent of anything other than an environment variable which can easily be set on multiple os’s.

However I am clearly violating DRY principle by writing this file creating code every time, so I thought I could make a helper package that simplifies this, however i feel that would mean the test would become “dependant” on the helper package.

So the questions are.

  1. In this situation should the DRY principle be violated so as to avoid unnecessary dependence’s?

  2. It’s ok to create a helper package as long as it can be imported from an external location like git hub?

    1. Is there another approach (perhaps using dependency injection)?

Best practice on Web Chat “please wait” messaging

We are currently integrating a web chat functionality on a utilities website, where customers can query their bill, or changing plans etc. with their electricity bills. (this will be available to all customers whether they are logged in or not).

The web chat will sit top right on all paged, and when clicked, will initiate a web chat sessions. In the event of a bottleneck of chats starting, we need to design a pre-screen before the chat initiates with an agent. I cannot find any best practice information our there, so my thought was to provide the following while the user waits:

  • An apology message saying that chat agents are busy.
  • Current wait time: XX minutes.

Would this be considered an overshare of information to the customer? or is the visibility and transparency appreciated and considered good Ux? Any hats thrown into the ring on this one are much appreciated! A brief mockup is something I put together below as a first pass:

enter image description here

Best practice for a 3 parts web app

I’m about to code an app that will end up having 3 parts:

1 server side bot(not available to users directly) [php] 2 online crm-kinda/UI [php] 3 client side bot(for windows users only) [py] 

1 and 2 both use the same database but different tables. 2 will provide 3 with data upon request.

For 1 and 2 should i create different structures? 1 OOP and 2 MVC – both using the same singleton db class? Or should i just extend 2 to take 1 under its wing even tho there’s no user functionality in 1 – everything being ran by the server for the server?

Are there any resources that i could read about the best practices in this kind of scenario?


1 /var/www/[bot] 2 /var/www/html/[UI]  3 [user's pc]    

Update items based on a read operations on same items is a bad practice?

DynamoDB is the database solution, I’m using to store my items. It’s a NoSQL/Document database and I got a real problem on real-time updates of items.

First, the saved format is like

{   expiredTime: 'Yesterday(this is a epoch or formatted string)',   state: 'enum values EXPIRED and VALID' } 

The problem is I need accuracy and real-time compatible data for read requests, but DynamoDB has not supported that type of trigger.

So, I thought about an idea of a subscriber of read requests in my code, then if read requests contain expired time is the past. The subscriber will update the state of items. Any function calls the items will receive altered state (corrected) even the listener haven’t finished.

Is this considered bad practice? Because I must not allow any read requests except the one attached a subcriber.