5 ms·
The Golden Rule of Programming
- ciupicri 14y agoIs Error establishing a database connection the golden rule of programming? :-)
- shuma 14y agonever knew that the golden rule was a database error.
- GiraffeNecktie 14y agoFor me, it's more of a "general rule" than a "golden rule".
- deleted 14y ago[deleted]
- jconnop 14y agoWelp. That's an interesting golden error. Cached version: http://webcache.googleusercontent.com/search?q=cache:vyvuBLO-YSwJ:www.stackify.com/golden-rule-programming/+&cd=1&hl=en&ct=clnk http://webcache.googleusercontent.com/search?q=cache:vyvuBLO...
- pbosko 14y ago"If database connection can be null, it will be null."
- MJR 14y agoThis is deep. I believe the golden rule is to keep your database online.
- adamtulinius 14y ago"if it can be null, it will be null" And here comes a repetition of Maybe Foo in haskell, and Option in Scala/Java. Hehe :-)
- damncabbage 14y ago"If it can be null, it will be null" So explicitly define what is allowed to ever be "null": http://lukeplant.me.uk/blog/posts/null-pointers-vs-none-vs-maybe/ http://lukeplant.me.uk/blog/posts/null-pointers-vs-none-vs-m...
- bunderbunder 14y agoWould that we could all just up and switch programming languages at the drop of a hat like that. Explicitly defining what is ever allowed to be 'null' is a great habit that serves me extremely well during evenings and weekends. But it's completely useless to me, by virtue of being impossible, between 9am and 5pm.
- 3amOpsGuy 14y agoI'm not a C# coder but I understood it was possible to have non-nullable types? Keep meaning to try C# for a project sometime. I understand it to be a more expressive, programmer friendly Java.
- bunderbunder 14y agoValue types are non-nullable. But they're also stack-allocated* and passed by value, so they're really only appropriate in certain cases. You can't use them as general-purpose non-nullable objects. *In practice, though technically that bit's an implementation detail of Microsoft's run-time and not part of the language spec.
- spo81rty 14y agoFor some data types. Strings and objects can always be nullable.
- PuercoPop 14y agoIsn't it just an specific formulation of Murphy's Law? If something can go wrong it will. And that is not just the golden rule of programming, it's the golden rule of Life!
- spo81rty 14y agoSorry, MySQL crashed :-(