Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
oraro
28 days ago
|
parent
|
context
|
favorite
| on:
Constructors Shouldn't Throw
Trying to keep an open mind here–if your constructor arguments are plain wrong then who should be throwing the error then? The Factory? The Builder? And what if they don't exist in the first place?
robotresearcher
28 days ago
[–]
Ideally you’d use the type system to ensure that arguments can’t be wrong.
For example, if arg values can’t be negative, use an unsigned arg type.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: