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
Blotto Skorzany
Nov 7, 2008

He's a PSoC, loose and runnin'
came the whisper from each lip
And he's here to do some business with
the bad ADC on his chip
bad ADC on his chiiiiip

unixbeard posted:

is the term 'white space' inherently exclusionary?

yes. it is intended to convey that demons, which have no corporeal form and thus no physical color, are excluded from that portion of the code and thus cannot cause any bugs there. unfortunately it also keeps the cherubim (quoque ac seraphim) out as they also have no spatial extent :(

Adbot
ADBOT LOVES YOU

Stringent
Dec 22, 2004


image text goes here

unixbeard posted:

is the term 'white space' inherently exclusionary?

white space should be word filtered to liebensraum

Stringent
Dec 22, 2004


image text goes here

gucci void main posted:

yeah

square released some auto vim setup thing but it borks my vim to not work. probably another dumb 10.9/clang issue though

:ughh:

Brain Candy
May 18, 2006


please don't quote sulk !!!

Zlodo
Nov 25, 2006

tef posted:

this sorta dogma ridden hand writing over a confused language feature is possibly why go didn't include them

According to their FAQ it seems to me that the reason they don't like exceptions is the same reason as most people who don't like exceptions:

quote:

Why does Go not have exceptions?
We believe that coupling exceptions to a control structure, as in the try-catch-finally idiom, results in convoluted code. It also tends to encourage programmers to label too many ordinary errors, such as failing to open a file, as exceptional.

Blotto Skorzany
Nov 7, 2008

He's a PSoC, loose and runnin'
came the whisper from each lip
And he's here to do some business with
the bad ADC on his chip
bad ADC on his chiiiiip

Stringent posted:

white space should be word filtered to liebensraum

lebensraum. liebensraum would be room to love :3:

double sulk
Jul 2, 2010


ughh indeed!!! their setup script is a pos

tsspos, you might say

gabensraum
Sep 16, 2003


LOAD "NICE!",8,1
blinkzorz i like to write tryget functions for that question you asked a couple of pages ago rather than exceptions. i'm probably about to be jumped on for it being bad practice or something but it makes me consistently happy

code:
bool TryGetOut(string forum, output reply)
{
    if (forum == "yospos")
    {
        output = "bithc";
        return true;
    }
    
    output = null;
    return false;
}

var response;
if (TryGetOut("yospos", out response))
{
    print response;
}

MononcQc
May 29, 2007

tef posted:

if you read higher order perl (or you know what "0 but true" is for in Perl), you'd know what the semipredicate problem is and how exceptions can be used

I know your stance on exceptions in general, but what if you have different classes of exception handling mechanisms available for each of these cases? What about languages that may support exceptions, option types, tagged values, multiple return values, signals, continuations and/or whatever mix of them that exists?

I understand it's very well possible to have a favorite one (say option types), and to pretend that you have to pick only this one in ideal cases, but when faced in a language that offers more than one way to do it, can you still affirm only one of them is the one true form to be used for all cases available?

"One true form of exception handling", to me, sounds as reductionist of an approach as "one true form of concurrency", "one true programming language paradigm", or whatever. This is to say, it's perfectly fine to be opinionated about it and kitchen sink languages might be terrible, but there will be areas where one or more of them is better than some single other.

The general principles for fault tolerance require Separation of Concerns vis. Error Encapsulation (make sure that the contagion doesn't spread), Fault Detection (make sure that you know that someone is infected), and Fault Identification (you have ebola, son).

Error encapsulation (and this applies equally to modules, components, systems, architectures, organizations) is invariably best done at the lowest level possible, which invariably breaks #3 and #4 (fault detection and identification).

Treating all error conditions / exceptions with the same mechanism will generally ensure that you pick similar stances on encapsulation vs. detection and identification for all error conditions / exceptions, unless you decide to be extra careful about all of that.

Using multiple mechanisms will allow you to pick, case by case, which one you feel is worth breaking depending on the nature of the fault and what your specific application or system requires.

Option types are pretty awesome, but they're not blanked replacements for other mechanisms IMO. Context is king.

tef
May 30, 2004

-> some l-system crap ->
i give up i am too dumb to computer

tef
May 30, 2004

-> some l-system crap ->
where i stand on exceptions

- i hate non local exits
- option types are nicer for the semi predicate problem
- goal directed evaluation is lovely
- i'd rather have isolated proceses and a die statement to wind up the stack, which cannot be caught

coffeetable
Feb 5, 2006

TELL ME AGAIN HOW GREAT BRITAIN WOULD BE IF IT WAS RULED BY THE MERCILESS JACKBOOT OF PRINCE CHARLES

YES I DO TALK TO PLANTS ACTUALLY

tef posted:

a quick survey, who has read the paper on exceptions ?


christ, programmers

do you happen to have a copypasta of papers that everyone should have read? if so, copy/paste it plz

same to you mononcqc, you seem pretty educated about the theoretical side of things too

qntm
Jun 17, 2009

prefect posted:

i use black backgrounds in my editors, but i've been saying "white space" all this time :aaaaa:

indent using semicolons

MononcQc
May 29, 2007

tef posted:

where i stand on exceptions

- i hate non local exits
- option types are nicer for the semi predicate problem
- goal directed evaluation is lovely
- i'd rather have isolated proceses and a die statement to wind up the stack, which cannot be caught

Ah yeah, that makes more sense to me then.

- option types allow for the encapsulation-at-the-lowest-level part, and if you don't handle them, they can bubble up to help with detection/identification.
- die statement is a choice to go straight ahead for isolation (not spreading poo poo with side-effects outside of isolation/detection)
- using processes helps isolation especially well with that

there's a level above 'option types all the way down like they're turtles' in that ideal case, which is okay with me then. Move along :toot:

Shaggar
Apr 26, 2006

boss key posted:

blinkzorz i like to write tryget functions for that question you asked a couple of pages ago rather than exceptions. i'm probably about to be jumped on for it being bad practice or something but it makes me consistently happy

code:
bool TryGetOut(string forum, output reply)
{
    if (forum == "yospos")
    {
        output = "bithc";
        return true;
    }
    
    output = null;
    return false;
}

var response;
if (TryGetOut("yospos", out response))
{
    print response;
}

this isn't really something you'd throw an exception on. trygets are also kind of a hack in languages w/ null. ex: in c# doing dictionary[key] will throw an exception if the key doesn't exist, so you can either do dictionary.contains(key) and then dictionary[key] which costs u 2 lookups, or you can use dictionary.tryget(key, out value) which internally does it in one lookup. this prevents you from getting nulls out of the dictionary.

in java map.get(key) will return null if the key doesn't exist, but it will do so in one lookup. at that point you have to check for null.

its
C# code:
String value;
if(dictionary.tryget(key,out value))
{
//do thing
}
else
{
//do other thing
}
vs
Java code:
String value=dictionary.get(key);
if(value!=null)
{
//do thing
}
else
{
//do other thing
}
The c# is a little safer I guess cause it forces you to do the nullcheck if you want to get the value while the java option does not.

Shaggar
Apr 26, 2006

tef posted:

where i stand on exceptions

- i hate non local exits
- option types are nicer for the semi predicate problem
- goal directed evaluation is lovely
- i'd rather have isolated proceses and a die statement to wind up the stack, which cannot be caught

exceptions aren't non-local exits
option types don't fulfill the same role as exceptions
dying is rarely the correct way to handle an exception

MononcQc
May 29, 2007

dying with isolated processes basically means "oops part of my system failed" and instead of pretending everything is fine and handling an exception you don't know how to handle locally, you just let that part die and isolate it from the rest. The rest of the system can then detect that failure and decide what to do with it: retry, report, log, abort, kill more poo poo that depended on it, etc.

you're separating concerns (your consumer can't affect the process that died, just know it failed), you're going for the encapsulation of errors (the part that failed doesn't unwind the stack of everything that didn't fail, only its own, so the others can keep going if their operations were unrelated), you assume you have error detection (because you want to know other isolated processes died, and could be logging it for humans too), and you can do fault identification (because the other process isn't related and you might have a stack trace that gets reported on the side by the system away from the consumer's path, which may eat the exception and move along anyway).

processes and signals for exception handling is fairly sweet and has a lot of neat semantics.

They're not mutually exclusive with classical exceptions or option types for local handling of faults within each of the isolated processes.

MononcQc fucked around with this message at 16:09 on Aug 30, 2013

tef
May 30, 2004

-> some l-system crap ->

Shaggar posted:

exceptions aren't non-local exits
option types don't fulfill the same role as exceptions
dying is rarely the correct way to handle an exception

poop poop poop poop butt butt poop poop poop butt butt

tef
May 30, 2004

-> some l-system crap ->
poop,

butt, poop butt, poop-butt?

poop poo-poo butt poo, buttpoo, poobutt.

buttbutt. butt? butt butt butt, butt poop poo poo butt butt butt butt; butt butt butt butt butt

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
fungah, shaggared again!

tef
May 30, 2004

-> some l-system crap ->
https://www.youtube.com/watch?v=CX4Hd5UI7nM

Notorious b.s.d.
Jan 25, 2003

by Reene

unixbeard posted:

This is the best book if you want to learn about how unix works http://www.amazon.com/Programming-Environment-Addison-Wesley-Professional-Computing/dp/0321525949 ignore the advanced part though, it gets into details for sure, but starts off pretty introductory

apue is the introductory text on "how to use unix APIs"
there is seriously nothing easier

i recommend it to everyone if only so you can read strace output properly

Notorious b.s.d.
Jan 25, 2003

by Reene

gucci void main posted:

yeah

square released some auto vim setup thing but it borks my vim to not work. probably another dumb 10.9/clang issue though

lol osx and vim

if you are writing anything except objC, it's time to get on the linux and viper-mode bandwagon

Bloody
Mar 3, 2013

why would i want emacs to pretend to be vim when i can just use vim

Posting Principle
Dec 10, 2011

by Ralp

Bloody posted:

why would i want emacs

Posting Principle
Dec 10, 2011

by Ralp
can text editors be our new argument tia

Socracheese
Oct 20, 2008

vim supremacy

Notorious b.s.d.
Jan 25, 2003

by Reene

Bloody posted:

why would i want emacs to pretend to be vim when i can just use vim

because vim is less extensible and involves fighting with dumb poo poo for basic features
viper- and evil-mode exist to let you use your vim keybindings in a more flexible place




p.s. i still use vi but it is really "notepad for unix", not for editing code

Bloody
Mar 3, 2013

Notorious b.s.d. posted:

because vim is less extensible and involves fighting with dumb poo poo for basic features
viper- and evil-mode exist to let you use your vim keybindings in a more flexible place




p.s. i still use vi but it is really "notepad for unix", not for editing code

this sounds false i slapped in a couple basic plugins trivially and it does like everything i want now

jooky
Jan 15, 2003

sublime text 3 suits all of my text editing needs on osx

Zlodo
Nov 25, 2006

Posting Principle posted:

can text editors be our new argument tia

on what planet text editors arguments can possibly be new

tef
May 30, 2004

-> some l-system crap ->

Zlodo posted:

on what planet text editors arguments can possibly be new

Stringent
Dec 22, 2004


image text goes here

Otto Skorzeny posted:

lebensraum. liebensraum would be room to love :3:

ah, thanks!

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

Zlodo posted:

on what planet text editors arguments can possibly be new

earth

Condiv
May 7, 2008

Sorry to undo the effort of paying a domestic abuser $10 to own this poster, but I am going to lose my dang mind if I keep seeing multiple posters who appear to be Baloogan.

With love,
a mod


Posting Principle posted:

can text editors be our new argument tia

what text editor does bizarro superman use?

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde
*looks up from IDE*

wait, you can do that, you can edit code files like they're just text?

whoa

Notorious b.s.d.
Jan 25, 2003

by Reene

jooky posted:

sublime text 3 suits all of my text editing needs on osx

lol closed source hobby project

have fun with those timebombs when the maintainer gets bored

Shaggar
Apr 26, 2006

Notorious b.s.d. posted:

because vim is less extensible and involves fighting with dumb poo poo for basic features
viper- and evil-mode exist to let you use your vim keybindings in a more flexible place




p.s. i still use vi but it is really "notepad for unix", not for editing code

vi is definitely "notepad for unix" in that its so terrible that only an idiot who uses Linux could think it was a good idea.

Shaggar
Apr 26, 2006

jooky posted:

sublime text 3 suits all of my text editing needs on osx

Linux is so bad that some distros even have paid text editors. incredible

Adbot
ADBOT LOVES YOU

spongeh
Mar 22, 2009

BREADAGRAM OF PROTECTION
the yospos forecast calls for a heavy shaggaring throughout the labor day weekend

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