python (65.1k questions)
javascript (44.2k questions)
reactjs (22.7k questions)
java (20.8k questions)
c# (17.4k questions)
html (16.3k questions)
r (13.7k questions)
android (12.9k questions)
How we can achieve writing reusable and modular code
How we can achieve writing reusable and modular code in an Enterprise code. What are the basics to get started
VIKRAM SINGH CHOUHAN
Votes: 0
Answers: 1
Are there penalties for just using the new keyword instead of creating a class variable before calling the class method?
Example
(1)
var classVar = new class();
classVar.Method();
(2)
new class().Method();
I like the second way, less wordy.
Is there a performance difference?
Is it considered bad coding practice?
BenG
Votes: 0
Answers: 2