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
brap
Aug 23, 2004

Grimey Drawer

Snapchat A Titty posted:

no u





but is there a less ugly way to write this?

Swift code:

if costSoFar[next] == nil || newCost < costSoFar[next]! { ... }

Swift code:

if let cost = costSoFar[next] where newCost < cost { ... }

Adbot
ADBOT LOVES YOU

VikingofRock
Aug 24, 2008




DimpledChad posted:

so my company is planning to scrap its lovely php codebase and rewrite the product using a better language/platform. yay! only thing is, i think my boss wants to use go. i know that the terrible programmers here have a general antipathy towards go, and i'm inclined to agree. does anyone have any good articles/arguments i can use to make the case to the higher-ups for why we should not use golang?

edit: it's obviously still a lot better than PHP, so it's a win-win i guess. still, might as well try.

I think the main problem people have with Go is the lack of generics. How much will that affect you? I've actually heard it's a decent language otherwise.

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



fleshweasel posted:

Swift code:
if let cost = costSoFar[next] where newCost < cost { ... }

ty but that isnt the same

i need like this, either the key isnt there, or it is, but its val is larger than newCost:

code:
if (!costSoFar.hasKey(next) || newCost < costSoFar[next]) {

Powerful Two-Hander
Mar 10, 2004

Mods please change my name to "Tooter Skeleton" TIA.


Valeyard posted:

grab your junk and shout "program this" and walk away

Shaggar
Apr 26, 2006

Snapchat A Titty posted:

no u





but is there a less ugly way to write this?

Swift code:
if costSoFar[next] == nil || newCost < costSoFar[next]! { ... }

C# code:
double nextCost;
if(costSoFar.TryGet(next,out nextCost) && newCost < nextCost )
{
	//stuff
}

Dessert Rose
May 17, 2004

awoken in control of a lucid deep dream...

Shaggar posted:

C# code:
double nextCost;
if(costSoFar.TryGet(next,out nextCost) && newCost < nextCost )
{
	//stuff
}

cute joke, but you made the same mistake fleshweasel did in comprehending what the code actually does

Dessert Rose
May 17, 2004

awoken in control of a lucid deep dream...
which is even less understandable; how do you see || and write &&?

Dessert Rose
May 17, 2004

awoken in control of a lucid deep dream...
anyway, no, OP, the way you wrote it is pretty much fine for the particular case you are presenting

maybe there is a way to not be in the situation which produces a desire for that conditional in the first place, but if you need to perform that check then the code you wrote is fine

Dessert Rose
May 17, 2004

awoken in control of a lucid deep dream...
comedy

Swift code:
if newCost < (costSoFar[next] ?? Int32.Max) { ... }
i don't know if that compiles and you shouldn't do it if it does

Shaggar
Apr 26, 2006

Dessert Rose posted:

cute joke, but you made the same mistake fleshweasel did in comprehending what the code actually does

oh lol. yeah.

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



Oh i got it! this works:

if newCost < (costSoFar[next] ?? Int.max) {

e: I guess great minds &c

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



Dessert Rose posted:

comedy

Swift code:
if newCost < (costSoFar[next] ?? Int32.Max) { ... }
i don't know if that compiles and you shouldn't do it if it does

it compiles & works so im just gonna put a //lol and move on, maybe fix it later when i dont have time

Shaggar
Apr 26, 2006

Shaggar posted:

C# code:
double nextCost;
if(!costSoFar.TryGet(next,out nextCost) || newCost < nextCost )
{
	//stuff
}

there u go.

brap
Aug 23, 2004

Grimey Drawer
its me, im the terrible programmer

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
Im using Java and I just don't understand why any programmer would choose to program in an object oriented language without interfaces and generics

bobbilljim
May 29, 2013

this christmas feels like the very first christmas to me
:shittydog::shittydog::shittydog:

MALE SHOEGAZE posted:

Im using Java and I just don't understand why any programmer would choose to program in an object oriented language without interfaces and generics

I miss generics so much

jesus WEP
Oct 17, 2004


MALE SHOEGAZE posted:

Im using Java and I just don't understand why any programmer would choose to program in an object oriented language without interfaces and generics
interfaces arent pythonic

incidentally every time I read the word pythonic in context im more convinced its just a synonym for "stupid"

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

St Evan Echoes posted:

interfaces arent pythonic

incidentally every time I read the word pythonic in context im more convinced its just a synonym for "stupid"

Rubyist

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
What do you guys use to do like design diagrams / umls?? Like omni graffie??

Dessert Rose
May 17, 2004

awoken in control of a lucid deep dream...

St Evan Echoes posted:

interfaces arent pythonic

incidentally every time I read the word pythonic in context im more convinced its just a synonym for "stupid"

it's just a way of saying "i don't like that" but in a way more annoying manner

Deacon of Delicious
Aug 20, 2007

I bet the twist ending is Dracula's dick-babies
that is a good question I would also like to know the answer to

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

shards of glass, the blood of the fallen, tender naive flesh

Shaggar
Apr 26, 2006
python is pretty bad

Luigi Thirty
Apr 30, 2006

Emergency confection port.

how does one represent a monad in uml?

Shaggar
Apr 26, 2006
very carefully

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

Luigi Thirty posted:

how does one represent a monad in uml?

wget https://www.chipotle.com/public/hero.jpg

Valeyard
Mar 30, 2012


Grimey Drawer

MALE SHOEGAZE posted:

What do you guys use to do like design diagrams / umls?? Like omni graffie??

draw.io or visio

PleasureKevin
Jan 2, 2011

Shaggar posted:

google has never released a finished product and tying yourself to them is a disaster waiting to happen.

meanwhile asp.net is far and away the best web stack there is and Microsoft has a proven record of constant updates and improvements as well as long term support.

i want to agree but angular is pretty good

Dessert Rose
May 17, 2004

awoken in control of a lucid deep dream...

PleasureKevin posted:

i want to agree but angular is pretty good

which one? they've already rewritten it once.

bobbilljim
May 29, 2013

this christmas feels like the very first christmas to me
:shittydog::shittydog::shittydog:
gliffy is OK if your an atlassian shop

Shaggar
Apr 26, 2006

PleasureKevin posted:

i want to agree but angular is pretty good

angular is probably the exception but I think that was also a side project by some people who happened to work at google.

knockout is better tho

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

does Google use Angular (either version) for anything important?

Jabor
Jul 16, 2010

#1 Loser at SpaceChem
I would guess that most big projects that pre-date angular don't currently use it, because rewriting your application just because you can is basically never worth it no matter how much of an improvement the new hotness is. So I guess the answer to your question depends on whether you think any small applications that started development (or had a UI rewrite where it was worth switching toolkits) are actually "important".

(As an aside, this is the same reason Go uptake is slow. If your metric for success is " everyone immediately drops everything to rewrite their already-working code " then you really do belong in this thread.)

leftist heap
Feb 28, 2013

Fun Shoe
Angular isn't good tho. It's retarded and the upcoming rewrite - - while desperately needed - - just goes to show how asinine and obtuse it is.

if u wanna see angular's future just look at GWT it's a goddamn crystal ball.

Valeyard
Mar 30, 2012


Grimey Drawer
i watchjed the angular tutorial videos and liked the little jingle

SHAPING UP WITH AAAAAAAANGULAR

triple sulk
Sep 17, 2014



one of these places I've been talking to said they were rewriting their api from webapi to node and short of new(ish) hotness I have no idea why. also they described their culture (when I asked about how they work, generally speaking) as a "war room" which I assume means 80 hour work weeks

kitten emergency
Jan 13, 2008

get meow this wack-ass crystal prison
shags, whats your beef with EF anyway

more like dICK
Feb 15, 2010

This is inevitable.

VikingofRock posted:

I think the main problem people have with Go is the lack of generics. How much will that affect you? I've actually heard it's a decent language otherwise.

it's petty but I have a real visceral reaction to seeing "import github.com..." in code, so go is right out

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

Jabor posted:

I would guess that most big projects that pre-date angular don't currently use it, because rewriting your application just because you can is basically never worth it no matter how much of an improvement the new hotness is. So I guess the answer to your question depends on whether you think any small applications that started development (or had a UI rewrite where it was worth switching toolkits) are actually "important".

(As an aside, this is the same reason Go uptake is slow. If your metric for success is " everyone immediately drops everything to rewrite their already-working code " then you really do belong in this thread.)

it doesn't need to be big to be important. google has built plenty of things that are important to their business since angular was launched, I'm just not sure if any of them use angular. if you magically eradicate react from the world, Facebook is in trouble, and that trend is increasing.

Adbot
ADBOT LOVES YOU

leftist heap
Feb 28, 2013

Fun Shoe
google is the worst at dogfooding

  • Locked thread