Comments (5)
Personal opinion, but I feel it harms readability because at first glance, it appears that the required file in question is one additional level away.
Using the distance test: from a distance ./
and ../
are indistinguishable, which approximates "at a glance" visual parsing. One should be able to count the /
s to know how many directory levels away a file is.
from nodebestpractices.
@kbariotis I personally adore those aesthetic improvements. I'm not sure whether we should focus on 'widely agreed best practices' vs 'suggestions for better programming'. I tend to believe that the first fits our DNA better.
Anyway, would love to discuss other ideas :)
from nodebestpractices.
@kbariotis thanks for joining the battle :)
can you kindly clarify why is this an issue? you also wrote 'always put ./' but in the //DO section the example doesn't contain ./:
module.exports.ModuleInAnotherFolder = require('../ModuleInAnotherFolder');
from nodebestpractices.
I am sorry @i0natan. They were upside down :/. So the issue is just a visual preference. IMO it enhances readability when you know that every require
will start with ./
.
from nodebestpractices.
@jasonkarns I really don't want to argue about that cause it's really a matter of preference and opinion and it's only a suggestion. I like the paths to be similar, much like others aligning their =
signs. :)
But, I would argue that ./
and ../
should be distinguishable especially to people coming from a *nix background. You don't count the /
's but rather the ..
's to find how many folders you have to go up.
Either way, nice talking to you :). Great repo!
from nodebestpractices.
Related Issues (20)
- Easy to translate advice HOT 1
- Translations status HOT 1
- Bonnes pratiques nodejs
- Arabic Translation
- Node practice 1
- Should include Corepack in our recommendation? HOT 5
- Bootstraping nodejs container may be misleading
- Node
- Node js fullstack HOT 4
- Wrong example HOT 2
- Broken link to env-var
- Nextjs as main framework? HOT 2
- Another comment regarding "1.1 Structure your solutions by business components" HOT 1
- Italian Translation
- The backend-testing-checklist.png file is missing. HOT 3
- Hinglish Translation HOT 1
- Кнас
- Dead link for safe-regex
- Mi006
- Is using cache for npm install in docker safe?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nodebestpractices.