|
Socracheese posted:yeah but in most cases its doing something trivial like pulling a username or saving a single 'object' so who even cares if it runs in 2ms instead of 3ms a good orm will allow you to skip object creation altogether for speed, send raw queries, and hell even create your model from your DB structure. writing a bunch of raw sql is job security but who the gently caress wants that job in the first place?
|
# ? Jul 24, 2013 00:04 |
|
|
# ? May 9, 2024 02:38 |
|
Shaggar posted:w/ checked exceptions, the compiler informs you about the possible errors and asks you to handle them lol you mean your ide autocompletes an empty catch block with a comment quote:w/ option types, the compiler informs you that you should read the code or ask the developer about what is going on because it has no idea nah you can return them, or you know, write an if statement saying "if this is ok, do some stuff". then you can use exceptions for things that are, you know, exceptions and can't really be recovered from, kill the process and restart.
|
# ? Jul 24, 2013 00:07 |
|
tef posted:- error handling (both of the recoverable and unrecoverable types) I agree with most of your post but this bit really annoys me. whether or not an error is 'recoverable' is a system-level property, not one that's visible at the point the error is encountered. for a file-handling library, a missing or corrupt file is a unrecoverable error. for an application using that same library to read a config file, a missing file just means you log an error message & load some defaults. a huge part of the premise of exceptions is that you can delegate responsibility for determining the response to an error upwards. this is the fundamental flaw of c-style thinking. maybe. I don't know. I got real mad about code when I was writing that but I'm not sure I'm actually disagreeing with anyone. anyway. it's sort of unfortunate that the same syntax is used for a number of very disjoint purposes (nonlocal goto to escape nested loops & python's StopIteration being the most common egregious offenders), but I'm not sure how you'd specialize exceptions to discourage that kind of thing. c++ pulls it off by making try/catch blocks too expensive to use except in times of dire need, but, um... (it's possible a language I'm unfamiliar with has already solved this problem; I'm really not familiar with as many languages as I'd like to be. need to find a pet project to learn haskell or erlang or somesuch with.)
|
# ? Jul 24, 2013 00:07 |
|
use option types for things that can be handled, and let programmer decide wether to delegate it upwards use exceptions for things that can't and get rid of the catch statement. keep processes/isolated threads, and when they die you can see why, and chose to restart it.
|
# ? Jul 24, 2013 00:10 |
|
tef posted:lol you mean your ide autocompletes an empty catch block with a comment quote:nah you can return them, or you know, write an if statement saying "if this is ok, do some stuff". then you can use exceptions for things that are, you know, exceptions and can't really be recovered from, kill the process and restart. also, runtime exceptions are always code problems so restarts will never help.
|
# ? Jul 24, 2013 00:10 |
|
with option types you can get rid of null, too
|
# ? Jul 24, 2013 00:11 |
|
Shaggar posted:yes, you can go ask the developer what each exception means cause he probably didn't document it anywhere, they you can decide which ones you think are "errors" even though that's the job of whoever calls the method. hopefully the dev remembered it all or you just read thru all the code yourself to figure out where the possible errors are. good luck
|
# ? Jul 24, 2013 00:11 |
|
only an academic could think option types are a good way to handle errors.
|
# ? Jul 24, 2013 00:12 |
|
hm. exceptions for non-local exits : proper use of functions & return statements :: exceptions for error-handling : use of many small processes ala classic unix? mm. tef posted:use option types for things that can be handled, and let programmer decide wether to delegate it upwards haha, saw this when I hit preview interesting. I'll have to think about it.
|
# ? Jul 24, 2013 00:12 |
|
if it throws an exception that's what you've got to deal with. if it throws the wrong exceptions theres nothing you can do. obviously you're being obtuse cause any idiot could understand the difference between being made aware of an error mistakenly (incorrect use of exceptions) vs not being made aware of anything (option types) and hoping for the best. checked exceptions provide a mechanism for error handling, option types do not.
|
# ? Jul 24, 2013 00:13 |
|
they don't really force anything as evidenced by 90% of java programs in production
|
# ? Jul 24, 2013 00:15 |
|
you can do option types in java, just have every method return a string and parse it out to see if its an error or good data.
|
# ? Jul 24, 2013 00:15 |
|
Shaggar posted:you can do option types in java, just have every method return a string and parse it out to see if its an error or good data. tbc would be proud of you, shaggar.
|
# ? Jul 24, 2013 00:15 |
|
tef posted:they don't really force anything as evidenced by 90% of java programs in production some programmers are bad so we should give up and not have good tools. let me tell you about my python library....
|
# ? Jul 24, 2013 00:16 |
|
dawwww
|
# ? Jul 24, 2013 00:18 |
|
Shaggar posted:also, runtime exceptions are always code problems so restarts will never help. false, let me tell you about this little guy called SQLException (connection was closed) and how a simple process restart will make it work again
|
# ? Jul 24, 2013 00:20 |
|
that's deffo a code flaw. probably an improper connection closing issue likely to do w/ a connection pool.
|
# ? Jul 24, 2013 00:23 |
|
if ur handling the connections urself its also a design flaw. if ur not handling the connections urself, theres a bug in whatever library is doing it.
|
# ? Jul 24, 2013 00:24 |
|
and yet restarting makes lovely software more robust oh no i mean, let's just have production die every time while you crappy code janitors argue over which design pattern fixes the bug
|
# ? Jul 24, 2013 00:26 |
|
also I hate loud intern cause hes loud and he doesn't know anything about development despite having graduated w/ a cs degree. luckily hes been pigeon holed into somewhere he cant do any damage, for the moment.
|
# ? Jul 24, 2013 00:27 |
|
tef posted:lol you mean your ide autocompletes an empty catch block with a comment Shaggar posted:yeah if you're a bad programmer good programmers don't need ides
|
# ? Jul 24, 2013 00:27 |
|
tef posted:and yet restarting makes lovely software more robust oh no if something is failing regularly because of code flaws and you don't want to fix it then it must not matter.
|
# ? Jul 24, 2013 00:28 |
|
Cocoa Crispies posted:shaggar was right lol
|
# ? Jul 24, 2013 00:28 |
|
Cocoa Crispies posted:shaggar was right without an ide the only way to find out what public methods your OS uses is to compile your code and run it and see if you got it right. much easier to just guess with autocomplete until you figure it out
|
# ? Jul 24, 2013 00:32 |
|
Shaggar posted:if something is failing regularly because of code flaws and you don't want to fix it then it must not matter. thanks how!!
|
# ? Jul 24, 2013 00:32 |
|
Cocoa Crispies posted:shaggar was right i reckon there're three or four good psych/sociology papers that could be found in programmer machismo
|
# ? Jul 24, 2013 00:33 |
|
text editor usage coincides w/ p-lang and Linux usage and is a clear sign of mental health issues
|
# ? Jul 24, 2013 00:34 |
|
Shaggar posted:text editor usage coincides w/ p-lang and Linux usage and is a clear sign of mental health issues yes, excellent mental health and j-languages are a clear sign of mental disability
|
# ? Jul 24, 2013 00:35 |
|
"just restart the server when it fails" -tiny tef child.
|
# ? Jul 24, 2013 00:35 |
|
gets 99.9999999% uptime
|
# ? Jul 24, 2013 00:39 |
|
every time windows crashes, shaggar sits with his computer off until he knows microsoft have shipped a patch, before trying to use it again.
|
# ? Jul 24, 2013 00:39 |
|
windows doesn't crash unless its a hardware problem, but im sure restarts will fix a hardware problem. also its great when the thing that's supposed to handle the restart on failure fails so everything sits in a hung state. just restart it every 5 minutes cause no ones actually using it anyways
|
# ? Jul 24, 2013 00:41 |
|
that's because a j-lang programmer wrote it and it's pausing to collect garbage
|
# ? Jul 24, 2013 00:42 |
|
whoops, no one told me about that option type error value so my gigantic if block didn't handle it! I guess the service hasn't worked for days but no one noticed... 100% uptime
|
# ? Jul 24, 2013 00:43 |
|
tef posted:and yet restarting makes lovely software more robust oh no runit will restart up to once a second until your code figures out how to not crash. its rly cool and installing runit is the first thing i do on redhate systems now
|
# ? Jul 24, 2013 01:00 |
|
Shaggar posted:whoops, no one told me about that option type error value so my gigantic if block didn't handle it! I guess the service hasn't worked for days but no one noticed... 100% uptime option types alone dont help much but look at scala for example. it's a really clean way of describing uncertainty without endless ifnulls and you then reserve exceptions for situations where you really want to crash the process. java 8's sugar over inner classes will probably help a lot wrt writing similar code in java
|
# ? Jul 24, 2013 01:04 |
|
why not just use checked exceptions to help avoid the possibility of missed problems. the point is that with checked exceptions you can guarantee that the errors the method writer knows can happen will be handled. with an option type, even if the user has the intention to handle everything, they can make a mistake that the compiler wont catch. theres no benefit to doing it that way and a ton of downside.
|
# ? Jul 24, 2013 01:08 |
|
lol
|
# ? Jul 24, 2013 01:10 |
|
I mean seriously. whats the upside? you maybe kind of save some typing if you choose to ignore the problem?
|
# ? Jul 24, 2013 01:11 |
|
|
# ? May 9, 2024 02:38 |
|
would i get probated for c/ping this primo shaggarposting to CoC
|
# ? Jul 24, 2013 01:17 |