I've been working in javascript for a little over a year, one thing that I've never liked is when my constructor functions have 3+ parameters and I have to stack them vertically for readability, especially when using angular, I view constructors as functions (which may be wrong, I have no formal education) I'd like to keep my functions and constructors using the same format for consistency. This makes me use very short variable names to avoid stacking them (which is terrible for maintainability) EX:
constructor(public fb: FormBuilder, private db: DatabaseService){
}
VS:
constructor(
private fs: AngularFirestore,
public fb: FormBuilder,
private db: DatabaseService
) {}
As you can see above; 3 parameters and it is now the ugliest thing I've ever seen in my life LoL. What is the correct way of doing this?
TL;DR
How can I refactor my constructor functions so that they are more maintainable?
Edit
Based on some of the comments I think this merits a response: If I view this in an objective manner (my own opinions aside) conventional wisdom states that when writing functions the less parameters the better. If we assume that constructors are functions then that logic must then extend to dependency injection.
