|
rotor posted:if there was a "bring keyboard to mains voltage" instruction, I would use it every time someone used the "right-click, copy" menu item. same but with the securecrt "copy and paste" function
|
# ? Aug 27, 2012 17:59 |
|
|
# ? May 9, 2024 10:10 |
|
even if lazy developers just catch(Exception e) {} its still better for good developers because it makes it very clear when they should handle those exceptions rather than having to inspect the documentation. checked exceptions are ftw
|
# ? Aug 27, 2012 18:09 |
|
although you could do it horribly wrong and use exceptions as flow control like in python
|
# ? Aug 27, 2012 18:10 |
|
Shaggar posted:even if lazy developers just catch(Exception e) {} its still better for good developers because it makes it very clear when they should handle those exceptions rather than having to inspect the documentation. You could return an object, that made it clear you had to handle things. foo = obj.blah() if (foo.valid()) { .... } else {....} it makes it clear too.
|
# ? Aug 27, 2012 18:21 |
|
so clear, in fact, you can see obviously where it is returned, and where it is handled.
|
# ? Aug 27, 2012 18:26 |
|
and you could return it from a function, or even pass it into another function for handling. checked exceptions on the other hand don't really get you any of that.
|
# ? Aug 27, 2012 18:27 |
|
tef posted:the idea that all exceptions must be errors is a weird one, especially when, at heart they are often more about non-local exits, rather than handling errors. you still have to write all the error handling code. The idea that procedures should receive invocation specific data by function arguments is a weird one, especially when, at heart it is about passing data about rather than any mathematical abstraction. You still have to actually use the data. Error handling and fault tolerance comes from isolation of components, and function arguments don't do anything to help with that. I don't understand the 'oh poo poo you're using global variables for something other than global state, how dare you' mentality. tl;dr; you use exceptions to tell the human reading the code that this is an error. Also, explicitly handling errors in the return value of every function is slow and ugly.
|
# ? Aug 27, 2012 18:47 |
|
slugly
|
# ? Aug 27, 2012 21:39 |
|
rotor posted:you can tell I'm a hardcore coder by the lovely, archaic tools I use. shhhh.....
|
# ? Aug 27, 2012 21:50 |
|
Zombywuf posted:The idea that procedures should receive invocation specific data by function arguments is a weird one, especially when, at heart it is about passing data about rather than any mathematical abstraction. You still have to actually use the data. ur not clever enough to pull this off
|
# ? Aug 27, 2012 21:51 |
|
JawnV6 posted:ur not clever enough to pull this off It might be more of an in joke. Also, everyone read this book http://www.dreamsongs.com/Files/PatternsOfSoftware.pdf
|
# ? Aug 27, 2012 22:32 |
|
speaking of checked exceptions, I ran across this today:code:
|
# ? Aug 27, 2012 23:38 |
|
JawnV6 posted:ur not clever enough to pull this off thanks jawn
|
# ? Aug 27, 2012 23:58 |
|
Zombywuf posted:It might be more of an in joke. Yep
|
# ? Aug 28, 2012 01:32 |
|
tef posted:You could return an object, that made it clear you had to handle things. not if you're calling a method that already returns an object. unless you're gonna make all objects potentially contain exceptions which would be dumb. exceptions are the right way to do it and checked exceptions are the right way to do it for problems that should be handled in code.
|
# ? Aug 28, 2012 01:41 |
|
Shaggar do you think the code should handle database exceptions or just let them bubble up the call stack instead?
|
# ? Aug 28, 2012 02:03 |
|
tef posted:the idea that all exceptions must be errors is a weird one, especially when, at heart they are often more about non-local exits, rather than handling errors. you still have to write all the error handling code. it could be because the name "exception" implies "exceptional circumstances"
|
# ? Aug 28, 2012 02:07 |
|
i guess it all boils down to arguing over the definition of "is"
|
# ? Aug 28, 2012 02:09 |
|
tahnk god i work in objective-c which doesn't have exceptions uh huh huh huh fuh fuh fuh
|
# ? Aug 28, 2012 02:09 |
|
lol
|
# ? Aug 28, 2012 02:27 |
|
Ronald Raiden posted:I swear I was planning to contribute to hyperglyph this weekend but dark souls and then spilling beer on my macbook happened. goon project on unity?
|
# ? Aug 28, 2012 02:30 |
|
Tiny Bug Child posted:static languages: when you want to waste a whole lot of time telling the computer things it already knows maybe if you use a bad language that can't determine types for you
|
# ? Aug 28, 2012 04:07 |
|
|
# ? Aug 28, 2012 04:10 |
|
sulk, the good posts:
|
# ? Aug 28, 2012 04:11 |
|
|
# ? Aug 28, 2012 04:13 |
|
Hard NOP Life posted:Shaggar do you think the code should handle database exceptions or just let them bubble up the call stack instead? I generally wrap db exceptions in model exceptions and throw them up the chain. The db connection module probably cant do much to fix the problem, so it should throw it up through the model interfaces to let whatever's consuming them handle it (most likely to notify someone of the db problem). The abstraction lets you change the underlying db system w/out freaking out the consumers.
|
# ? Aug 28, 2012 05:06 |
|
yaoi prophet posted:maybe if you use a bad language that can't determine types for you right. the good languages (like php) don't complain when you want to add two numbers because one of them is a string or some other fake computer idea, they just do it
|
# ? Aug 28, 2012 05:11 |
|
Tiny Bug Child posted:right. the good languages (like php) don't complain when you want to add two numbers because one of them is a string or some other fake computer idea, they just do it stfu boring trash
|
# ? Aug 28, 2012 05:15 |
|
i dont really think type safety is worth the effort. ok, yeah, I will occasionally write code where i pass the string "true" instead of the boolean true or whatever, but the bugs these cause are typically obvious and easy to find. the flexibility you give up by moving from an un- or weakly-typed language to a strongly typed one is imho a trade not worth making, as a general rule.
|
# ? Aug 28, 2012 05:16 |
|
rotor posted:i dont really think type safety is worth the effort. yea and debuggers are too hard and ide's are too complicated
|
# ? Aug 28, 2012 05:18 |
|
BUT BUT BUT what happens if you try to add 5 and "five"
|
# ? Aug 28, 2012 05:18 |
|
vapid cutlery posted:yea and debuggers are too hard and ide's are too complicated why debug a program when it can just run right the first time cause it does the obviously correct thing w/r/t type juggling.
|
# ? Aug 28, 2012 05:18 |
|
vapid cutlery posted:yea and debuggers are too hard and ide's are too complicated yeah but those have benefits
|
# ? Aug 28, 2012 05:19 |
|
Tiny Bug Child posted:why debug a program when it can just run right the first time cause it does the obviously correct thing w/r/t type juggling. do u ever get tired of your boring 1=0 nonsense
|
# ? Aug 28, 2012 05:19 |
|
vapid cutlery posted:do u ever get tired of your boring 1=0 nonsense no because it's so incredibly handy and it works the way i want it to 99% of the time yet people never stop trying to hold up php's type juggling system like it's a bad thing
|
# ? Aug 28, 2012 05:21 |
|
Tiny Bug Child posted:no because it's so incredibly handy and it works the way i want it to 99% of the time yet people never stop trying to hold up php's type juggling system like it's a bad thing i'm talking about your dumb gimmick where you say the wrong thing repeatedly as if it's funny or interesting. loving lmao if 1=0 is a normal php thing. jesus christ
|
# ? Aug 28, 2012 05:23 |
|
vapid cutlery posted:i'm talking about your dumb gimmick where you say the wrong thing repeatedly as if it's funny or interesting. loving lmao if 1=0 is a normal php thing. jesus christ i don't do that maybe you're confusing me with a guy that calls you a good poster
|
# ? Aug 28, 2012 05:26 |
|
Tiny Bug Child posted:i don't do that maybe you're confusing me with a guy that calls you a good poster you're weak as poo poo
|
# ? Aug 28, 2012 05:29 |
|
vapid cutlery posted:you're weak as poo poo mlyp
|
# ? Aug 28, 2012 05:30 |
|
|
# ? May 9, 2024 10:10 |
|
rotor posted:i dont really think type safety is worth the effort. probably my biggest frustration with strongly typed haskell is 'okay i want to know what the hell type this is evaluating to so i can fix it', it's easy to do that if the function i'm defining isn't used anywhere else but if it is i have to rename it to foo', let foo = undefined, and check the type of foo'
|
# ? Aug 28, 2012 05:32 |