jessesquires.com | Turing complete with a stack | Blog library
kandi X-RAY | jessesquires.com Summary
kandi X-RAY | jessesquires.com Summary
This is my personal site and blog. It is built with Jekyll and Bootstrap, and hosted at NearlyFreeSpeech.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of jessesquires.com
jessesquires.com Key Features
jessesquires.com Examples and Code Snippets
Community Discussions
Trending Discussions on jessesquires.com
QUESTION
I have a swiftlint
warning that bothers me.
warning: Nesting Violation: Types should be nested at most 1 level deep (nesting)
However, the nesting of structs is an established programming technique, and quite a few people advocate it.
Edit: Indeed @vadian points out the Swift language guide's rule:To nest a type within another type, write its definition within the outer braces of the type it supports. Types can be nested to as many levels as are required.
I am aware it clashes with the use of generics, and that Xcode may become unbearably slow. It actually was (through measuring the slowest compilation spots) the reason why I started looking at this nesting rule.
What is the reason for the lint rule, and what is the good practice in that respect? Please point out the technical reasons, rather than purely opinion-based advice.
Microsoft actually has a page about nested types, and when they are appropriate. While it is not targeted at Swift, it does have some interesting trans-language thoughtbits.
...ANSWER
Answered 2017-Mar-28 at 08:37After much searching, all I've found is @jpsim's remark that "the idea behind the nesting rule is to avoid complex interfaces".
Therefore, apart from the compiler issues outlined in my question, which will eventually subside, there seems to not be any technical reason for this rule.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install jessesquires.com
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page