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.
 
  • Locked thread
Hellsworn Barn
Apr 11, 2008

hi

horse mans posted:

op here's som code i wrote for you hth

code:
var action = Act.Upon(programmer)
                .If(p => p.needs.Contains("safe space"))
                .Gas()
                .Permaban()
                .Kill();

i refactored your horrible code

Adbot
ADBOT LOVES YOU

Hellsworn Barn
Apr 11, 2008

hi

Mr SuperAwesome posted:

.net reflector is cool because you can disassemble real code that people sell and you realise the people writing it were fuckin nuts

try diving into the framework code...

Hellsworn Barn
Apr 11, 2008

hi

Bloody posted:

whats wrong with singletons please don't blackball me

static data

Hellsworn Barn
Apr 11, 2008

hi

JG_Plissken posted:

whats wrong with static data please don't blackball me

static things can't be changed and software that can't change is generally pretty lovely!!

Hellsworn Barn
Apr 11, 2008

hi
nosql nosql NOSQL

Hellsworn Barn
Apr 11, 2008

hi
Pro tip: always catch exceptions and log them straight away you can't trust that calling methods will catch it in fact you should have exception handling and logging in literally every method everywhere!

Hellsworn Barn
Apr 11, 2008

hi

chumpchous posted:

Jquery is p easy it's the functions nested within functions nested within functions from js that I don't really get

stop whatever you're doing and go read up on closures.

Hellsworn Barn
Apr 11, 2008

hi

Doc Block posted:

LOL if having everything be an anonymous type is considered good code in C#. B-b-but I saved myself a split second of typing, who cares about readability!

Of course, this is a Microsoft language, so of course C# devs think it's a good idea to put the class type in all methods and variable names.

i like var and make a point of using it everywhere and updating existing code to use it in favor of explicitly typed local variables.

Hellsworn Barn
Apr 11, 2008

hi
this is a dumb argument

Hellsworn Barn
Apr 11, 2008

hi
are you fuckers serious about checked exceptions

Hellsworn Barn
Apr 11, 2008

hi
no i do not shaggar and no i do not like checked exceptions

Hellsworn Barn
Apr 11, 2008

hi

OBAMA BIN LinkedIn posted:

when a trivial error can kill your program then you should drat well have to make sure that is what you intended

checked exceptions don't solve this problem they make it worse.

Hellsworn Barn
Apr 11, 2008

hi
Checked exceptions, won't compile without the throws clause:
code:
public void SomeMethod() throws SomeException
{
	SomeMethodThatThrowsAnException();
}
Unchecked exceptions, compiles just fine:
code:
public void SomeMethod()
{
	SomeMethodThatThrowsAnException();
}
What you ultimately end up with if you have checked exceptions:
code:
public void SomeMethod() throws SomeException, SomeOtherException, ListEveryExceptionThatCouldPossiblyBeThrownByCalledMethod
{
	SomeMethodThatThrowsAnException();
}

Hellsworn Barn
Apr 11, 2008

hi

or even better
code:
public void SomeMethod()
{
	try {
		EveryMethodYourProgramCallsThatThrowsACheckedException();
	} catch (Exception e) {
		throw new RuntimeException(e);
	}
}

Hellsworn Barn
Apr 11, 2008

hi

Shaggar posted:

well yes if you're a terrible developer that happens, sure. but if you cant properly deal w/ checked exceptions ur a huge idiot.

there is literally no way to "properly deal with checked exceptions." the key to safe exception handling is centralization. every process/app domain/whatever should have a centralized handler responsible for managing control flow based on exception type/data/context. the good part about checked exceptions is that they provide information regarding what exceptions may be thrown, which helps get the logic in your centralized handler right the first time. the bad part about checked exceptions is that it encourages bad exception handling practices by forcing you to deal with exceptions throughout your code. the good is greatly outweighed by the bad since proper design all but eliminates the need for conditional logic based on exception type.

Hellsworn Barn
Apr 11, 2008

hi

Shaggar posted:

handles it lazily

you know what's really lazy? bad fuckin design

Hellsworn Barn
Apr 11, 2008

hi
webservices are bad

Hellsworn Barn
Apr 11, 2008

hi
notorious bsd i don't think you've thought this through

Hellsworn Barn
Apr 11, 2008

hi
what if demand on your services is not constant (e.g. high demand one day a month)?

what about network saturation?

what about latency?

what about durability?

Adbot
ADBOT LOVES YOU

Hellsworn Barn
Apr 11, 2008

hi

Notorious b.s.d. posted:

lol if you think you can answer these questions more effectively with a poorly-understood distributed setup running on someone else's hardware

who said anything about someone else's hardware?

  • Locked thread