In some cases, where there is a long set of identifiers required to access a particular value is too long for my likings, I’ll assign the value to a throwaway “nickname” simply to make it clearer what the purpose of the value being defined is.
Here, I move the necessitated “long name” to the far right-hand-side of the block of code, but on the previous evaluated line, to take it out of the reader’s path: they won’t notice it when skimming the code along the left edge, as most do.
(It’s far further to the right in the actual implementation; I re-aligned it for this shot, to make it visible inside 400 pixels’ width.)
(P.S. I know Dribbble isn’t Forrst. I’m not posting my code as code, I’m posting it as visual art. I consider source code a medium for artistic expression, hence why I’m posting my work here in this way. I’ll be trying to post shots from various languages / markups, in various styles; anything I consider to be visually interesting. I also may be adjusting the hilighting and typography to make the shots more visually appealing.)
2 Responses
(from: from-new.js @ fb19155, lines 144 ‒ 199)
In some cases, where there is a long set of identifiers required to access a particular value is too long for my likings, I’ll assign the value to a throwaway “nickname” simply to make it clearer what the purpose of the value being defined is.
Here, I move the necessitated “long name” to the far right-hand-side of the block of code, but on the previous evaluated line, to take it out of the reader’s path: they won’t notice it when skimming the code along the left edge, as most do.
(It’s far further to the right in the actual implementation; I re-aligned it for this shot, to make it visible inside 400 pixels’ width.)
about 1 year ago
(P.S. I know Dribbble isn’t Forrst. I’m not posting my code as code, I’m posting it as visual art. I consider source code a medium for artistic expression, hence why I’m posting my work here in this way. I’ll be trying to post shots from various languages / markups, in various styles; anything I consider to be visually interesting. I also may be adjusting the hilighting and typography to make the shots more visually appealing.)
about 1 year ago