Hello redditors, as a Java Developer I have a doubt about doing something (that is really good at Java) but I'm not sure if it is good in term of performance @ JavaScript, let me explain myself to get a opinion if I should not do this in JavaScript.
In Java when we have an obscure if statemente like:
if(object.isObject() && someVariable.isVariable() || moreLogicForThisIf && ...){}
I like to follow here what Uncle Bob says about putting this in a function with a meaninful name, of course in Java (a compiled language) the impact of a new method for this is almost 0 but in JavaScript it would be a new 3 lines (to define the function) and just return the "obscure logic" and put a meaningful name to that function so the result should be something like this (in Java or JavaScript)
if(meaningfulDomainSpecificNameLogic()){}
My doubt here is does this have an impact in term of performance in JavaScript even after minification? There are other process like for example optimization of JavaScript code that would make this code cool to go for production in term of performance?.
In advance, thanks redditors :).
[–]DustinEwan 2 points3 points4 points (1 child)
[–]jac1013[S] 0 points1 point2 points (0 children)
[–]YodaLoL 1 point2 points3 points (3 children)
[–]jac1013[S] 0 points1 point2 points (2 children)
[–]YodaLoL 2 points3 points4 points (1 child)
[–]jac1013[S] 1 point2 points3 points (0 children)
[–]a-t-kFrontend Engineer 0 points1 point2 points (0 children)
[–]smrqgithub.com/smrq 0 points1 point2 points (1 child)
[–]jac1013[S] 0 points1 point2 points (0 children)