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
Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice
yo leaving out braces is fine as long as you indent

Adbot
ADBOT LOVES YOU

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice

Cocoa Crispies posted:

check to see if something will work, do something and check to see if it failed

:colbert:

(though i guess if ur lucky enough to be using a language where exceptions aren't expensive as gently caress u can skip the first part)

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice
no but seriuosly the answer is, and always is, understand your tools and how they work and code what makes sense in the moment

if you're processing 10 million files per day and they are always there and only one day two years ago a file was missing because some idiot cj deleted it from under your job, sure don't check in advance because it's wasted cycles

conversely if you're converting 10 million strings per day into numbers and roughly 1% of them won't convert and when they don't you put in a -1, use something like tryparse or isnumeric assuming it's faster than exception handling with the tools you use

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice

Doc Block posted:

What happens when you add a statement but forget to add the braces?

same as when u accidentally use assignment instead of checking for equality in an if statement: poo poo breaks because terrible programmer wasn't careful (i'm being nice b/c this is a safe zone for terrible programmers)

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice

keygen and kel posted:

i think i want to start a project to access data in this horrible industry specific XML format from a horrible Web Service and dump it into a sql db. I'm back and forth between java and c# but i'm think c# because who am i kidding everyone uses windows, i'd like to make it not terrible what's a good starting point for learning c#. (i've done development before but it was a long time ago.)

http://msdn.microsoft.com/en-us/vstudio/hh341490
http://www.learnvisualstudio.net/

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice

Shaggar posted:

I don't like the xml datatype. there may be some highly specific valid uses but it smells bad. like it was probably a convenience thing for people who used to store xml as binary in their db and now its destined for abuse by idiots who cant do data design.

it's kinda dumb

if you use it right (i.e. querying from it) it's slow as heck and encourages bad design

if you just use it as a place to dump xml files for lookup later, use a filestream

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice

prefect posted:

just relax; every language is blamed for the sins of its worst users

qft

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice

dur posted:

ok so i don't know much SQL but i was just given a big file full of SQL queries and i get most of it but there's these parts like

code:
COUNT (*) COUNT


and i don't know wtf that is doing. wtf is that doing.

what database is that against i use ms sql server and oracle and that's greek to me

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice

dur posted:

well i figured it out. notepad++ highlights both COUNTs like their sql command things, but the second one is just a text output, like a column header. i changed it to FeatureCount so it's not as confusing

oh right, so like

select count(1) as count

except coded in a non-obvious way

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice

wolffenstein posted:

In the past week, I pulled an all nighter at a hackathon just to find out they threw out my backend code because "the frontend didn't look the way I imagined". I went to a meetup for civic coding, ended up being the only experienced programmer that knows git, and taught a group of designers how to use git and github to manage their 5k+ lines of single file javascript.

I'm unemployed, broke, and living with relatives after quitting my last job due to worse than php language and horrible location that made my depression worse.

gently caress I'm really depressed now.

is this a real post bc if so drat you can do better don't give up man

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice
i like tabs because if you like two space tabs or four space tabs or six space tabs or one space tabs it's only a text editor config away :)

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice
spaces are ok i guess

mixed tabs with spaces is evil

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice

prefect posted:

you're moving on up. if everything succeeds: you're a big success and had great ideas. if everything fails: you have architectural experience and have mistakes that you can draw upon as learning experiences

that's how management-types do it

truth. i have learned so much from my design gently caress-ups

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice
i like that you can do circuits in minecraft it's neat for that

but then they added magic and xp and garbage like that and i was like "children should not be exposed to this"

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice

Cold on a Cob posted:

children should not be exposed to this"

mlmp

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice

pre-emptive: the p is for post you sickos

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice
i've been coding in c# so long that i have completely forgotten how to manage memory

guess i need to learn to manage my memory about memory management

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice

Citizen Tayne posted:

I don't have one. I just remember things. That's what your brain is optimized to do, remember things about people.

not with all the goddamn name changes and av changes it's not

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice

AlsoD posted:

they like to do their management close to the metal

lol

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice

pointsofdata posted:

there's a stylecop rule which says any use of #region is not allowed, which i don't really get. maybe that's why i'm in this thread!

the only times i've seen #region in use (where it helped a lot) are really crazy dense codebases with poor soc and big nasty swiss army classes

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice

Shaggar posted:

array and list both have sort methods

oh did they add natural sorting for strings at some point? because that's what we're talking about here

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice

prefect posted:

you start with a giant manual process and then you automate that

yep

i guess i'm technically our 'build engineer' and it's just 'push button, receive software'

except in prod, they wouldn't let us set that up even if i wasn't the one pushing the button. i guess that's going to change though, or so i heard through the grapevine

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice
idk about msft but i think i read somewhere that apple maintains old machines for regression testing. wouldn't be surprised if msft does the same. also don't they bump up min requirements with patches sometimes? this could be why but idk, idk.

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice
i want a dumber house, not a smarter house. i want things i can fix myself with a soldering iron.

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice

eschaton posted:

the only database ports I've ever really heard of in significant number have been

SQLite → MySQL/PostgreSQL
MySQL → PostgreSQL
MySQL/PostgreSQL → MSSQL/DB2/Oracle

and of course the

Access/FileMaker/FoxPro → SQLite or anything that runs on a server

comedy option too

i've seen a lot of oracle to sql server too

oracle to anything can be pretty brutal though, loving oracle joins everywhere :barf:

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice

triple sulk posted:

i should use vs more than i presently do especially considering i can use it 100% of the time

vs + resharper is great

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice
sometimes trying to force everything into some abstracted dependency injected multiple inheritance poo poo pile is way worse than copy/pasting, hth

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice
been coding for around 15 years. i figure another 20 years or so of dev work and i'll figure out when i should refactor and when i should leave well enough alone. maybe.

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice

bobbilljim posted:

is there something inherently wrong with this if so please inform me (other than that its php top lols)

idk php but usually you just use a built in replicate function, or at least a for loop

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice
99.9% of the time if you're loving around with strings, someone already wrote a function to do it, so use it instead.

unless you're using sql server in which case download sql# lol

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice

AWWNAW posted:

one project i've had to deal with used a DI framework but instead of injecting the actual dependencies they just injected the whole DI container into the ctor of each class

:stare:

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice

Luigi Thirty posted:

I just got fired

now what

lovely

how's the package?

if it's good: enjoy your funemployment, calmly update resume, look for a good job
if it sucks: get drunk as poo poo this weekend, update resume in a panic, take first lovely job you're offered

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice

AggressivelyStupid posted:

Luigi what did you do

rm -rf on the production database drive and the five backup methods he was using all failed to restore

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice

uncurable mlady posted:

unless you're a dba

yessss

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice

MALE SHOEGAZE posted:

any of you all ever program while high? i find that it helps me engage with certain kinds of problems differently. more than anything, i think it makes me a more patient reader.

like, i don't do it all the time but sometimes it's pretty cool.

i find a single beer lets me get into it faster, i think maybe it just makes me less anxious?

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice

Shaggar posted:

mssql for sure.

i want materialized views and natural joins in mssql shaggar when will i get them??

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice

Shaggar posted:

you can index views in mssql if you really want to and natural joins are bad and dangerous.

indexed views are not the same as materialized views. i'd like the option to use either in different scenarios.

why do you believe natural joins are dangerous? you can already change FKs to silently break your existing queries so if that's your argument i don't buy it

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice

Shaggar posted:

Natural joins involve the server deciding which keys to join on which can change without you being aware of it. if someone adds a column with a name that matches a column in another table and the server decides to join on it now you've got different behavior without warning. natural joins are a really bad idea and they only exist to maybe save you a little typing.

ah. i want natural joins that use fks not something fragile like a column name, but the standard and implementations out there are as you describe so i'll concede on that one

i still want materialized views in addition to indexed views though :colbert:

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice

Shaggar posted:

idk what the benefit of a materialized view is over an indexed view

indexed views to have ridiculously restrictive prerequisites, like no outer joins allowed and no referencing other views. this is why i've never been able to use them effectively.

so presenting a choice between them is dumb on my part, i should have just wrote 'i want indexed views that work like materialized views ie. less restrictive requirements'

Adbot
ADBOT LOVES YOU

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice

Rex-Goliath posted:

upper management swooped in out of nowwhere to dictate that we should convert all of our xml to json during transmission in order to save bandwidth :shepface:

lol just put everything into attributes and use self closing tags bam you're done

  • Locked thread