Why use ‘lib’ vs ‘src’ directory names in JavaScript? Which is ‘standard’? [closed]

Interesting question, but it seems to me that some developers just take it by their own worldview. It also depends on the project: Some projects are built with smaller components, which are just little pieces of the main functionality: lib. lib/independent-pieces.js Other projects are monolithic, the components depend on each other: src. src/this-is-all-for-this-project-and-depend-on-each-other.js For third-party …

Read more

Python boolean methods naming convention

There is no standard naming convention specific to boolean-returning methods. However, PEP8 does have a guide for naming functions. Function names should be lowercase, with words separated by underscores as necessary to improve readability. Typically, people start a function with is (e.g. is_palindrome) to describe that a boolean value is returned.

Lambda variable names – to short name, or not to short name? [closed]

The way I usualy do it depends on the collection you’re enumerating over. If the name of the collection implies what type the lambda parameter will be, then I just go with the single letter, however if the collection isn’t as descriptive, then I’ll use a word. IE: myCollection.Where(person =>….); //non descriptive collection name myPeopleCollection.Where(p=>…); …

Read more