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
Nomnom Cookie
Aug 30, 2009



Dessert Rose posted:

perhaps thats because they did not in fact follow the programming guide to the letter

misra can never fail, only be failed

Adbot
ADBOT LOVES YOU

Ator
Oct 1, 2005

Tiny Bug Child posted:

i want my compiler to error out if my program has any warnings

if C++, then this is proper coding and not sperg at all

Nomnom Cookie
Aug 30, 2009




Ator posted:

not sperg at all

hmm yes i agree

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
http://kingjamesprogramming.tumblr.com/

a markov chain trained on the king james bible and SICP

quote:

And Satan stood up against them in that day, and leap for joy: for, behold, your reward is great in heaven: for he maketh his sun to rise on the evil and on the role of procedures in program design.

And these three men, Noah, Daniel, and Job were in it, and all the abominations that be done in (log n) steps.

The global environment is chosen here, because this is the will of God.

Thou shalt therefore sacrifice the passover within any of thy cattle, and in the MIT Computation Center.

jony neuemonic
Nov 13, 2009

Opinion Haver posted:

one complaint i hear a lot is that bootstrap makes sites look same-y because customizing it is hard. apparently this is supposed to be easier with bootstrap 3

that was my problem with 2, and 3 has been much easier to work with.

bourbon/neat is still better.

compuserved
Mar 20, 2006

Nap Ghost

coffeetable posted:

http://kingjamesprogramming.tumblr.com/

a markov chain trained on the king james bible and SICP

welcome back, temple os guy!

MononcQc
May 29, 2007

Narcissistic Design - Stuart Halloway

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

thanks to this, i have spent the afternoon readin up on good unit testing practice b/c yeah my tests are often harder to maintain than the code itself

JewKiller 3000
Nov 28, 2006

by Lowtax
type error directed programming is so useful, how the hell do people working in dynamic languages get anything like that done?

and don't say tests, because if you reject static typing and then try to replicate its behavior with tests, you're doing it very wrong

uhh i guess i'll grep for calls to this function and hope for the best???

Brain Candy
May 18, 2006

JewKiller 3000 posted:

type error directed programming is so useful, how the hell do people working in dynamic languages get anything like that done?

and don't say tests, because if you reject static typing and then try to replicate its behavior with tests, you're doing it very wrong

uhh i guess i'll grep for calls to this function and hope for the best???

i think the point is that errors don't really have types (behaviors!). they have different values. so who cares if you can't distinguish between an EastAfricanFartBonerException and a SouthernEuropeanFartBonerException

Nomnom Cookie
Aug 30, 2009



JewKiller 3000 posted:

type error directed programming is so useful, how the hell do people working in dynamic languages get anything like that done?

and don't say tests, because if you reject static typing and then try to replicate its behavior with tests, you're doing it very wrong

uhh i guess i'll grep for calls to this function and hope for the best???

this is one of the things that java gets perfect, its type system. rich enough to easily do things like locate all usages of a method without the pedantic idiocy of haskell-style typing

MononcQc
May 29, 2007

I feel one of the problems highlighted in the type-based discussion were grievances that people tend not to have with polymorphic types -- stuff you see in Hindley-Milner type systems. That works for code itself, but hardly for all kinds of APIs and larger systems (i.e. distributed) where the error type isn't necessarily what you care about. Then there's the friction of an API being very active into pushing its implementation language's semantics to the public, which is, in a way, a leaky abstraction.

I mean, you care to know that the data format you're shoveling around is wrong so that it can be fixed, but the error itself doesn't ever prescribe how you should behave in case of failure, what to do once the contract is broken, or a connection. The type system tells you "well duh it's broken", but not how to react to that or other kinds of problems.

I'd have to listen to it more with more attention again though.

MononcQc fucked around with this message at 22:06 on Dec 8, 2013

Nomnom Cookie
Aug 30, 2009



java knows what to do in case of failure, too: throw an exception. too bad that catch blocks exist

JewKiller 3000
Nov 28, 2006

by Lowtax

Brain Candy posted:

who cares if you can't

this is not a phrase i should have to hear when the problem is already solved except for bad/lazy programmers

MononcQc posted:

Hindley-Milner type systems

:getin:

Malcolm XML
Aug 8, 2009

I always knew it would end like this.

Brain Candy posted:

i think the point is that errors don't really have types (behaviors!). they have different values. so who cares if you can't distinguish between an EastAfricanFartBonerException and a SouthernEuropeanFartBonerException

dependent types to the rescue

MononcQc
May 29, 2007

Nomnom Cookie posted:

java knows what to do in case of failure, too: throw an exception. too bad that catch blocks exist

I'll quote an old post I made in this thread:

MononcQc posted:

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).

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.

I still stand by these ideas, and "lol throw an exception" is a very lovely way to handle all errors no matter what. Seeing them all as the same is bad, seeing them all as individual snowflakes isn't guaranteed to give you good results either.

Zaxxon
Feb 14, 2004

Wir Tanzen Mekanik

it's like the other side of Rich Hickey's "Simple Made Easy"

suffix
Jul 27, 2013

Wheeee!
i assumed that was just Rich in a wig or something

Nomnom Cookie
Aug 30, 2009



i really like go's error handling mechanisms, actually. you can return an error object, which is up to the caller to handle, or you can panic, which kills the goroutine. in my experience this covers almost all error conditions...what i like to see in java code is for each task to concentrate on the happy path and bail from it by throwing, with error handling higher on the call stack. thats about the closest java will come to doing things the go way

what i get to work with is usually a series of try/catch blocks that weave the happy and sad paths together. its not fun

MononcQc
May 29, 2007

Go doesn't cover poo poo like goroutine A depends on goroutine B, and B dies, so what does A do? There's also no way for a goroutine to interrupt/kill another one.

Which is some of the most basic poo poo you need in many cases. I guess you need to do it by hand with special dedicated channels and global variables, but it's not there as a base mechanism.

Nomnom Cookie
Aug 30, 2009



MononcQc posted:

Go doesn't cover poo poo like goroutine A depends on goroutine B, and B dies, so what does A do? There's also no way for a goroutine to interrupt/kill another one.

Which is some of the most basic poo poo you need in many cases. I guess you need to do it by hand with special dedicated channels and global variables, but it's not there as a base mechanism.

to me, either the task is expected to die, in which case you should be able to handle it, or its not, in which case case kill the process

Brain Candy
May 18, 2006

JewKiller 3000 posted:

this is not a phrase i should have to hear when the problem is already solved except for bad/lazy programmers

who is left when you take those out

jooky
Jan 15, 2003

whats a good book to learn ruby

i am a bad programmer

Brain Candy
May 18, 2006

Nomnom Cookie posted:

to me, either the task is expected to die, in which case you should be able to handle it, or its not, in which case case kill the process

what do you do about blocking i/o other than not use it?

Vanadium
Jan 8, 2005

MononcQc posted:

Go doesn't cover poo poo like goroutine A depends on goroutine B, and B dies, so what does A do? There's also no way for a goroutine to interrupt/kill another one.

Which is some of the most basic poo poo you need in many cases. I guess you need to do it by hand with special dedicated channels and global variables, but it's not there as a base mechanism.

The rust people are super afraid of killing other tasks at arbitrary points, probably not least because they only have hopeful type system separation between them and are worried about their locks and destructors. :(

FamDav
Mar 29, 2008
yeah p sure his types beef was with error propogation and tight coupling of message types through distributed systems.

in haskell you use libraries which sit on top of the loosely coupled services and give you all the hugbox static typing you could want. he's not arguing against, he's just saying don't force your bespoke types on me because now your forcing me to play by your language semantics.

Nomnom Cookie
Aug 30, 2009



Vanadium posted:

The rust people are super afraid of killing other tasks at arbitrary points, probably not least because they only have hopeful type system separation between them and are worried about their locks and destructors. :(

java strongly discourages Thread.terminate() because of locking problems. if a thread gets killed while holding a lock then whatever it was messing with can be left in an inconsistent state. its also very rude

Brain Candy posted:

what do you do about blocking i/o other than not use it?

I don't know, what DO you do about blocking i/o? what do you do when a thread is stuck in D state forever because of a hardware problem?

use a thread pool or smth w/e idc

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

jooky posted:

whats a good book to learn ruby

i am a bad programmer

use one of the many fre eonline tutorials to get a hang of the language (it's pretty easy), and just do stuff

MononcQc
May 29, 2007

ah yeah I forgot about y'all people's shared memory things. Killing procs randomly should be doable only if you get a kind of 'on kill' callable -- a defer for panics, for example, should be definable for that in go if you were yo allow that.

Nomnom Cookie
Aug 30, 2009



blowing away a process is fine, thats what finally blocks are for. blowing away a thread is a whole of kettle different bugs synchronization

Brain Candy
May 18, 2006

Nomnom Cookie posted:

java strongly discourages Thread.terminate() because of locking problems. if a thread gets killed while holding a lock then whatever it was messing with can be left in an inconsistent state. its also very rude

this isn't an intrinsic problem, it's implementation

http://docs.oracle.com/javase/6/docs/technotes/guides/concurrency/threadPrimitiveDeprecation.html

Nomnom Cookie
Aug 30, 2009




are you suggesting that Thread.stop() should schedule the thread to be stopped when it releases the outermost lock?

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

Nomnom Cookie posted:

thread … bugs … synchronization

lol

Brain Candy
May 18, 2006

you can politely get rid of threads by telling them to kill themselves

(the secret of blocking is that blocking without timeouts is a bad plan)

Brain Candy
May 18, 2006

Nomnom Cookie posted:

are you suggesting that Thread.stop() should schedule the thread to be stopped when it releases the outermost lock?

if your thread touches a lock other than for a queue you have already failed

jony neuemonic
Nov 13, 2009

Brain Candy posted:

you can politely get rid of threads by telling them to kill themselves

shame it doesn't apply to posters.

compuserved
Mar 20, 2006

Nap Ghost

jooky posted:

whats a good book to learn ruby

i am a bad programmer

but i repeat myself

Nomnom Cookie
Aug 30, 2009



Brain Candy posted:

if your thread touches a lock other than for a queue you have already failed

i tend to agree, but java has synchronized blocks and Thread.stop() has to deal with them. there's no good way to immediately kill a thread while it's holding a lock. how is this not an intrinsic problem? the semantics of java practically guarantee that anything recognizably similar to Thread.stop() will be either broken or useless

Nomnom Cookie
Aug 30, 2009



Brain Candy posted:

you can politely get rid of threads by telling them to kill themselves

(the secret of blocking is that blocking without timeouts is a bad plan)

work uses NIO to get read timeouts...but its still thread per connection. apparently nowadays you can easily solve the c10k problem by creating 10000 threads

Adbot
ADBOT LOVES YOU

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde
Service reminder that everyone should read lauer & needhams duality paper

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