Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Shaggar
Apr 26, 2006
right. the developers should be forced to do it the right way every time. Especially when theres 0 benefit and tons of downside to doing it the wrong way.

If you let the developer decide not to handle an exception they should have they'll either A) not realize they were supposed to handle it or B) not handle it out of lazyness. either way it will bite you in the rear end later on and you have to fix it anyways, so might as well do it right the first time.

Adbot
ADBOT LOVES YOU

vapid cutlery
Apr 17, 2007

php:
<?
"it's george costanza" ?>
as far as i can tell from writing java for like 8 years or something (oh thank god i don't do it anymore) most java developers just treat checked exceptions as a different kind of return value

Tiny Bug Child
Sep 11, 2004

Avoid Symmetry, Allow Complexity, Introduce Terror
checked exceptions are fine, assuming catch(Exception e) { } still works in java

double sulk
Jul 2, 2010

static language supremacy

Tiny Bug Child
Sep 11, 2004

Avoid Symmetry, Allow Complexity, Introduce Terror

gucci void main posted:

static language supremacy

static languages: when you want to waste a whole lot of time telling the computer things it already knows

vapid cutlery
Apr 17, 2007

php:
<?
"it's george costanza" ?>

gucci void main posted:

static language supremacy

what language

Jonny 290
May 5, 2005



[ASK] me about OS/2 Warp

salted hash browns posted:

Where do you get these logs?

http://dispatch.accessfayetteville.org/

Jonny 290
May 5, 2005



[ASK] me about OS/2 Warp

08:58:53 BREAKING OR ENTERING 1337 N FIDDLESTICKS PL

coaxmetal
Oct 21, 2010

I flamed me own dad

Shaggar posted:

right. the developers should be forced to do it the right way every time. Especially when theres 0 benefit and tons of downside to doing it the wrong way.

If you let the developer decide not to handle an exception they should have they'll either A) not realize they were supposed to handle it or B) not handle it out of lazyness. either way it will bite you in the rear end later on and you have to fix it anyways, so might as well do it right the first time.

shaggar was right, mostly. Developers are lazy, and checked exceptions are fine.

Imo though, an ioexcection or something like it should be handled within the method, if possible, instead of throwing it.

tef
May 30, 2004

-> some l-system crap ->

Shaggar posted:

IOExceptions, for example. java decided to make these exceptions checked because otherwise its up to the developer to realize they need to handle them.

Java invented checked exceptions. Java is also the only language to use checked exceptions since their invention.

quote:

The only people who dont like checked exceptions are lazy p-languagers who arent writing code that matters.

That and the designers of C# :eng101: I guess C# is a p-language now. Like every other language that isn't Java.



oh shaggar, never change :swoon:

tef
May 30, 2004

-> some l-system crap ->

Ronald Raiden posted:

shaggar was right, mostly. Developers are lazy, and checked exceptions are fine.

What we need to do is give more work to lazy programmers. That will solve everything.

rotor
Jun 11, 2001

classic case of pineapple on pizzadog derangement syndrome

vapid cutlery posted:

as far as i can tell from writing java for like 8 years or something (oh thank god i don't do it anymore) most java developers just treat checked exceptions as a different kind of return value

this poo poo makes me so mad

i remember some new kid did this halfassed compiler that would raise a different kind of exception for each different kind of node it found, i mean what the gently caress

coaxmetal
Oct 21, 2010

I flamed me own dad

tef posted:

What we need to do is give more work to lazy programmers. That will solve everything.

eventually

coaxmetal
Oct 21, 2010

I flamed me own dad

rotor posted:

this poo poo makes me so mad

i remember some new kid did this halfassed compiler that would raise a different kind of exception for each different kind of node it found, i mean what the gently caress

lmbo ok thats terrible, maybe checked exceptions aren't such a great idea if thats how they get used

0xB16B00B5
Aug 24, 2006

by Y Kant Ozma Post
a thousand monkeys typing on a keyboard gives you windows lolol macs rule

tef
May 30, 2004

-> some l-system crap ->

at least shaggar is a gimmick, but with you, I don't know how you sleep at night

0xB16B00B5
Aug 24, 2006

by Y Kant Ozma Post

tef posted:

at least shaggar is a gimmick, but with you, I don't know how you sleep at night

coaxmetal
Oct 21, 2010

I flamed me own dad

tef posted:

at least shaggar is a gimmick, but with you, I don't know how you sleep at night

that really hurts tef

coaxmetal
Oct 21, 2010

I flamed me own dad
I swear I was planning to contribute to hyperglyph this weekend but dark souls and then spilling beer on my macbook happened.

tef
May 30, 2004

-> some l-system crap ->

rotor posted:

this poo poo makes me so mad

i remember some new kid did this halfassed compiler that would raise a different kind of exception for each different kind of node it found, i mean what the gently caress

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.

error handling and fault tolerance comes from isolation of components, and exceptions don't do anything to help with that. i don't understand the 'oh poo poo you're using a non-local exit for something other than a failure, how dare you' mentality.

(exceptions are also used to solve the semi predicate problem (instead of option types), and in some languages exceptions are more like co-routines (restartable exceptions) rather than delimined continuations :catdrugs:)

Sweeper
Nov 29, 2007
The Joe Buck of Posting
Dinosaur Gum

Tiny Bug Child posted:

checked exceptions are fine, assuming catch(Exception e) { } still works in java

this is exactly what is wrong with checked exceptions lol

if you add catch(Exception e) it defeats the entire purpose of having them checked. when one is added you will never know

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug
i used to be a big fan of "static void int public main(char** argv[]) raises Exception" in disposable code i'd never run again

then i quit programming java and life improved quite a bit because i didn't have to tell the computer what i was doing multiple times

rotor
Jun 11, 2001

classic case of pineapple on pizzadog derangement syndrome

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.

error handling and fault tolerance comes from isolation of components, and exceptions don't do anything to help with that. i don't understand the 'oh poo poo you're using a non-local exit for something other than a failure, how dare you' mentality.

(exceptions are also used to solve the semi predicate problem (instead of option types), and in some languages exceptions are more like co-routines (restartable exceptions) rather than delimined continuations :catdrugs:)

i'm not a bear about insisting exceptions be for error conditions, but they are expensive and will potentially hork your poo poo if you're not careful (in java anyway), so people need to use them sparingly and with care is all.

coaxmetal
Oct 21, 2010

I flamed me own dad

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.

error handling and fault tolerance comes from isolation of components, and exceptions don't do anything to help with that. i don't understand the 'oh poo poo you're using a non-local exit for something other than a failure, how dare you' mentality.

(exceptions are also used to solve the semi predicate problem (instead of option types), and in some languages exceptions are more like co-routines (restartable exceptions) rather than delimined continuations :catdrugs:)

using an exception in place of a return value, or as an additional return value seems wrong to me though. Exceptions don't have to be errors -- I use them for control flow in python, after all, but I don't think they should be thrown (heh) around willy nilly, esp since an uncaught exception that propagates up IS an error, at least in the languages with exceptions that I know.

rotor
Jun 11, 2001

classic case of pineapple on pizzadog derangement syndrome

rotor posted:

i'm not a bear

i kind of wish i was a bear, nothin to do but sleep all winter, then wake up and get fat as hell eatin berries and raw salmon, then maybe have some sex and go back to sleep for 4 months

Janitor Prime
Jan 22, 2004

PC LOAD LETTER

What da fuck does that mean

Fun Shoe

Sweeper posted:

this is exactly what is wrong with checked exceptions lol

if you add catch(Exception e) it defeats the entire purpose of having them checked. when one is added you will never know

But don't you still need something like a general Exception catcher that you use to tell your users "Sorry there was an unexpected problem, please try again later" instead of showing them a giant fuckoff stacktrace?

EVGA Longoria
Dec 25, 2005

Let's go exploring!

Jonny 290 posted:

so i taught myself more sql with perl this weekend. im scraping the local police dispatch logs, storing them in mysql and then geolocating them all. then i have a client script that calcs distance and alerts me if poo poo goes down within 1 mile radius of my house.

the sql bit was a little tricky b/c timestamps, incident descriptions and addresses can all be duplicated, but all 3 will never be duplicated at once, so I ended up taking an md5 of $timestamp.$desc.$addr and using that as a unique index field. Then since i'm scraping the whole page each minute and will see entries multiple times, i md5 each item and if that index exists, skip. i guess sql can do this but i didnt want to build up a bunch of huge gross queries at 2am saturday night

for the geo i'm doing a v. simple query via geocoder.us, which rate limits to one query every 15 seconds for free accounts, so i set up a background script to build a LIFO queue of items with no location and geolocate them out.

sounds like fun

i pretty much started perl with the sql stuff because we're doing that so much.

if you're writing your own db for that, did you consider using an orm (dbix::class)? that's how i would do it if i was taking in data and building my own db.

i've been focusing on the web developing recently. it's not great, but perl has some p great frameworks for it that let me accomplish what i'm looking for super easy.

tef
May 30, 2004

-> some l-system crap ->

Hard NOP Life posted:

But don't you still need something like a general Exception catcher that you use to tell your users "Sorry there was an unexpected problem, please try again later" instead of showing them a giant fuckoff stacktrace?

Or you could, you know, restart the bit that failed and it will probably be ok.

Instead of making your users do it by hand every time.

Jonny 290
May 5, 2005



[ASK] me about OS/2 Warp
oh poo poo that looks really cool and appears to be something that i could work right in. thanks :)

i'm really new to the DB side of poo poo so i'm bound to do tons of dumb trash.

Janitor Prime
Jan 22, 2004

PC LOAD LETTER

What da fuck does that mean

Fun Shoe

tef posted:

Or you could, you know, restart the bit that failed and it will probably be ok.

Instead of making your users do it by hand every time.

Right, because when an external service that your application uses fails, it's your application that has to restart it.

rotor
Jun 11, 2001

classic case of pineapple on pizzadog derangement syndrome

Hard NOP Life posted:

Right, because when an external service that your application uses fails, it's your application that has to restart it.

what people typically do is if a service fails that causes your service to fail and crash out is to:

a) try to immediately restart N times
b) after that, schedule a restart every X seconds/minutes/hours/fortnights

rotor
Jun 11, 2001

classic case of pineapple on pizzadog derangement syndrome
because why should users have to keep track of when some poo poo comes back up and then restart things by hand based on some (likely untracked) software dependency

rotor
Jun 11, 2001

classic case of pineapple on pizzadog derangement syndrome
why? I'll tell you why: because gently caress users, god i hate them so much

homercles
Feb 14, 2010

dont drink the orm koolaid

rotor
Jun 11, 2001

classic case of pineapple on pizzadog derangement syndrome

homercles posted:

dont drink the orm koolaid

this, also it was flavor-aid

Tiny Bug Child
Sep 11, 2004

Avoid Symmetry, Allow Complexity, Introduce Terror

rotor posted:

i kind of wish i was a bear, nothin to do but sleep all winter, then wake up and get fat as hell eatin berries and raw salmon, then maybe have some sex and go back to sleep for 4 months

i saw a youtube the other day of a bear just sitting in a big ol river near a waterfall and i got pretty jealous b/c it looked way better than sitting in an office chair

rotor
Jun 11, 2001

classic case of pineapple on pizzadog derangement syndrome

Tiny Bug Child posted:

i saw a youtube the other day of a bear just sitting in a big ol river near a waterfall and i got pretty jealous b/c it looked way better than sitting in an office chair

this is what im sayin

tef
May 30, 2004

-> some l-system crap ->

rotor posted:

why? I'll tell you why: because gently caress users, god i hate them so much

this is the state of programming today, when code isn't written by autists with no empathy, it is written by misanthropes.

rotor
Jun 11, 2001

classic case of pineapple on pizzadog derangement syndrome
if there was a "bring keyboard to mains voltage" instruction, I would use it every time someone used the "right-click, copy" menu item.

Adbot
ADBOT LOVES YOU

homercles
Feb 14, 2010

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.
i need this on leenocks, mouse selecting stuff doesn't work for lots of pasting, keyboard copy commands might not work because of the app, or keyboard focus could be off in a far away land or perhaps my WM is feeling grabby, pasting stuff into a VM is only guaranteed by the "right-click, copy" menu item.

linux. the choice of a gnu generation

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply