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
Shaggar
Apr 26, 2006
don't use orms and double don't design ur db code first.

Adbot
ADBOT LOVES YOU

Shaggar
Apr 26, 2006

Martytoof posted:

every language that isn't c-style looks weird as gently caress

i got over it for objective-c because it's mostly c-style with a bunch of brackets, but i'm having a hard time with python and stuff

and then i tried to learn ruby on rails because i wanted to make a quick website and everything about it was weird as gently caress. i am a little depressed that i can't pick this stuff up easily anymore :(

don't be. p-langs are purposefully bad and different for the sake of being bad and different.

Shaggar
Apr 26, 2006

gucci void main posted:

c# is probably the only language you should learn if you want reliable tools/debugging/to not kill yourself

c# has good tools but javas are more mature

Shaggar
Apr 26, 2006
all man style, hard tabs only.

Shaggar
Apr 26, 2006
ugh, the default vs theme is too bright.

Shaggar
Apr 26, 2006
2 tabs is too big for tabwidth.

Shaggar
Apr 26, 2006

OBAMA BIN LinkedIn posted:

its 2 spaces shaggar. thats what it means. the width of the tab is two spaces. hope this helps.

that's far too small. 4 or 5 for sure.

Shaggar
Apr 26, 2006

gucci void main posted:

not that I can't afford it, but I hate the idea of trying to justify $70 for sublime text (not that you ever have to pay for it really)

no you idiot. you should not pay money for a text editor.

Shaggar
Apr 26, 2006

OBAMA BIN LinkedIn posted:

unless its visual studio

visual studio is an ide

vim is a shitpile turd

Shaggar
Apr 26, 2006
if intellisense wasnt garbage people would never use var.

Shaggar
Apr 26, 2006

prefect posted:

i want to put some run-time configuration-type information into an app.config file (this is c#). do they document the kind of xml formatting you need to use anywhere?

like, do you use tags or attributes?


edit: i'm an idiot and of course i found it as soon as i pinched off a post about it :downs:

c#'s configuration manager is bad rear end. if you're just looking to do simple name value pair stuff you can use the default appSettings section, but if you want to get fancy you can write your own extended config sections w/ custom config managers.

Shaggar
Apr 26, 2006

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.

var is one of the few dumb mistakes that snuck into c# from p-langs. the most glaring of these mistakes is no checked exceptions.

Shaggar
Apr 26, 2006

Cold on a Cob posted:

is this some sort of deployment thing where you do different settings for different servers? if so look into slowcheetah. if this is client side stuff, lol sorry have fun :tipshat:

vs2012 has slowcheetah built in for the default config files (app.config, web.config,etc...)

Shaggar
Apr 26, 2006
I need to get an ssd cause this spinny drive sucks, but vs2012 is still decently fast.

Shaggar
Apr 26, 2006

prefect posted:

how do i map a network drive with c#? :saddowns:

(i'm having a tough time finding what i need in the dot-net class library reference)

shaggar, i apologize for arguing with you all the time

I don't think theres a way to do it which is probably cause its a userland feature and lots of c# stuff runs w/out user credentials. if you're just looking to access network files you can treat \\computer\sharename as any other folder in c#. if you want to map a drive for a user then shelling out to net use or a batch script or something is probably doable.

e: looks like someone wrote a p/invoke wrapper for u http://www.codeproject.com/Articles/6847/Map-Network-Drive-API

e2: other option is to include the windows script host libraries via COM http://techisolutions.blogspot.com/2011/12/map-network-drive-using-c-vbnet-code.html

Shaggar fucked around with this message at 17:06 on May 14, 2013

Shaggar
Apr 26, 2006

prefect posted:

i wound up shelling out

but my program actually works! :woop:

(people tell me i shouldn't be so surprised when things work)

one of the dirty secrets of .net is that on windows you have access to everything in com which is a whole shitload of stuff. you can also register your .net libraries in com too so old com poo poo can use them. what that means is if you've got some old rear end vb6 app and you want to do something like webservice or have a nice database model or w/e you can do that in .net and then expose it to the vb6 via com so you never need to upgrade from vb6!!!

Shaggar
Apr 26, 2006

Hellsworn Barn posted:

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

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

Shaggar
Apr 26, 2006
yes the one truly bad brace style

Shaggar
Apr 26, 2006

Doc Block posted:

And what, pray tell, is the Shaggar-approved brace style?

all man style, hard tabs only (duh)

Shaggar
Apr 26, 2006

Doc Block posted:



real men use the K&R One True Brace Style
code:
int main(int argc, char *argv[])
{
    if(yourmom == laffo) {
        gb2gbs();
    } else {
        yospos_bitch();
    }

    return 0;
}

cool ugly unreadable crap

Shaggar
Apr 26, 2006
forcing you to handle exceptions is always the right choice. if someone eats the exception or handles it lazily then you can point right at their code and tell them their fired.

if you don't force people to handle exceptions then they will just ignore them completely and let them bubble up the stack beyond where they could have been handled. at that point you have to dig through the code and documentation to find where it was thrown and where it should have been handled.

Shaggar
Apr 26, 2006

tef posted:

you're not forced to handle exceptions though, the whole point is that any line can throw one so you don't have to be explicit which one.

checked exceptions are a poor implementation of option types.

nah option types would be an awful, overcomplicated way to do error handling. exceptions are easy to deal w/ and checked exceptions ensure that developers deal with them instead of ignoring them.

Shaggar
Apr 26, 2006

PleasingFungus posted:

java question time. my understanding is that, taking advantage of the fact that java strings are immutable, identical strings are stored at the same location in memory. e.g.:
code:
String foo = "butts";
String bar = "butts"; //should be stored in the same place as foo!
googling tells me this is called "string interning", and that java's implementation is called the 'string pool'. anyway.

wouldn't that imply, then, that the == / != operators would work for comparing strings? I'd assumed that ==/!= were just comparing the values of the internal pointers (and wiki agrees with me here), so...?

for string litteralls this will work, but not string objects

Java code:
//these are automatically interned afaik so they are the same reference
String a = "butts";
String b = "butts";
		
System.out.println(a==b); //prints true
System.out.println(a.equals(b)); //prints true

String c = new String("butts");

System.out.println(a==c); //prints false as it points to a new string object w/ a different reference!
System.out.println(a.equals(c));  //prints true b/c .equals is the right way to compare strings

//SAVAGE OPTIMIZATION!
c=c.intern(); // replaces the reference to c with a referenced to an already interned instance of "butts" if it exists.  if it doesn't, then the string is interned and a reference to the interned string is returned
		
System.out.println(a==c); // true

interning strings manually (as w/ String c in this example) allows you to use ==, but at the cost of permanently storing the string in perm gen (if its java 6, in 7 its heap). if you did not intern c, then it would be collected once it goes out of scope.

Shaggar
Apr 26, 2006
but yes, use enums instead.

Shaggar
Apr 26, 2006
do it and then get another job where u have to move back to the city w/ higher pay based on the cost of living differential.

Shaggar
Apr 26, 2006

AWWNAW posted:

my group desperately needs more developers but we're located in the American south which means we ain't finding poo poo and my boss doesn't want to hire remotely and I can kinda sympathize with him

the remote dev we have now is constantly confused as to what's going on

also I committed several shameful hacks today that will later blossom into bugs

is it real south or northern carpet bagger south?

Shaggar
Apr 26, 2006

AWWNAW posted:

Mississippi

no thanks

Shaggar
Apr 26, 2006
lol that makes me mad irl when I look at it.

Shaggar
Apr 26, 2006
just use jaxb to serialize the objects directly.

Shaggar
Apr 26, 2006
actually idk. I know cxf can automatically serialize stuff w/out annotations but idk if it adds them itself before passing it off to jaxb or if jaxb is smart enough to figure it out w/out them

Shaggar
Apr 26, 2006
WCF is pretty easy to use. The default service created by visual studio when you create a wcf service application is a basic example that's kind of useful.

As with java and CXF you define the service using an interface and model objects and then you tie an implementation to the interface at runtime.

The easiest way to get started is just to modify the existing service interface (IService) and play around w/ it and the implementation.

Shaggar
Apr 26, 2006

CamH posted:

just create a new project in visual studio and go for it. it's literally that easy

yeah its literally this

Shaggar
Apr 26, 2006

CamH posted:

C# is the best language sorry for your lots

also this

Shaggar
Apr 26, 2006
it has a spacious back seat that will be perfect

Shaggar
Apr 26, 2006

anyone using mongo deserves what they get

Shaggar
Apr 26, 2006
can you even do anything worthwhile in xcode?

anyhow, does resharper make intellisense as good as eclipse autocomplete? that might make it worth buying

Shaggar
Apr 26, 2006
eclipse autocomplete isn't slow. it also doesn't give you garbage like vs intellisense so it ends up being like 10x faster to use.

Shaggar
Apr 26, 2006
did you disable the default 200ms delay?

Shaggar
Apr 26, 2006

CamH posted:

why is that even a setting (no didnt)

to give it that authentic open sores feel.

Adbot
ADBOT LOVES YOU

Shaggar
Apr 26, 2006
like it literally exists because greybeards think they can type faster than autocomplete so they didn't want it coming up.

  • Locked thread