1 karma · joined Dec 1, 2017 (8y ago) · 4 submissions
comment 1y ago · link · parent
I’m curious to get your thoughts on the long-term future of the intercontinental submarine cables given advances in cheap high-bandwidth satellites, as proven out by SpaceX. In 100 years, are we still maintaining physical fiber across such distances? And is there a role and/or benefit of data centers in space?
I have a long drive coming up, will have to finish this and come back with more specific thoughts.
comment 1y ago · link · parent
### Reduce Cognitive Load By:
*1. Simplify Conditionals*
``` // High cognitive load if val > someConstant && (condition2 || condition3) && (condition4 && !condition5)
// Low cognitive load isValid = val > someConstant isAllowed = condition2 || condition3 isSecure = condition4 && !condition5 if isValid && isAllowed && isSecure ```
*2. Use Early Returns*
``` // Nested ifs if isValid { if isSecure { doStuff() } }
// Early returns if !isValid { return } if !isSecure { return } doStuff() // Happy path is clear ```
*3. Prefer Deep Modules*
- *Deep module*: Simple interface, complex implementation (e.g., UNIX I/O with 5 methods) - *Shallow module*: Complex interface for simple functionality - Few deep classes > Many shallow classes
*4. Use Self-Describing Values*
``` // Numeric codes requiring mental mapping 401 // expired token? 403 // insufficient access?
// Self-describing { "code": "jwt_has_expired" } ```
*5. Apply DRY Carefully*
- Don't create abstractions too early - Avoid tight coupling between unrelated components
### Avoid These Anti-Patterns:
*1. Inheritance Chains*
``` AdminController extends UserController extends GuestController extends BaseController Use composition instead ```
*2. Too Many Layers*
- Unnecessary abstraction layers add indirection, not simplicity - Only add abstractions when you need actual need to
*3. Framework Magic*
- Keep business logic framework-agnostic - Use frameworks as libraries, not containers for your logic - New developers shouldn't need months to learn framework "magic"
comment 3y ago · link · parent
I am in full agreement the thekevan -- I would take excepted yield and multiple by .75. Things just don't work out very well at least 25% of the time.