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
FlapYoJacks
Feb 12, 2009

leper khan posted:

Imagine not getting angry about programming languages

Programming is work, and IDGAF about work.

Adbot
ADBOT LOVES YOU

Zlodo
Nov 25, 2006
heres some fun friday evening anger about python, the conan package manager and the brain worms that make people go like "what if we developed a aaa game with the same kind of clownshoes approaches used in web development"

so we have this project where pulling and building all the required packages from internal repositories (mostly conan but there are also git repos and nuget packages and who knows what else nested in there) and then generating the visual studio solution takes literally hours from an empty cache, and a couple days ago they added an internal tool that serves as a front end for conan onto the pile (I dunno what for). that new thing have its own cache in the user directory and runs a "sandboxed" conan cache in there and long story short me and some other guy have slightly longer user names than most people so some path deep in the bowels of the process became longer than 260 characters and caused a build failure and we couldn't work all day

meanwhile the russians just put everything on perforce

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

Zlodo posted:

heres some fun friday evening anger about python, the conan package manager and the brain worms that make people go like "what if we developed a aaa game with the same kind of clownshoes approaches used in web development"

so we have this project where pulling and building all the required packages from internal repositories (mostly conan but there are also git repos and nuget packages and who knows what else nested in there) and then generating the visual studio solution takes literally hours from an empty cache, and a couple days ago they added an internal tool that serves as a front end for conan onto the pile (I dunno what for). that new thing have its own cache in the user directory and runs a "sandboxed" conan cache in there and long story short me and some other guy have slightly longer user names than most people so some path deep in the bowels of the process became longer than 260 characters and caused a build failure and we couldn't work all day

meanwhile the russians just put everything on perforce

Sounds like your studio has a team that's bigger than the necessary size to support their work, so they build things to fill the time. Resulting in productivity losses because people don't like doing nothing or telling people to do nothing. So instead you invent problems that don't need to be solved, and iterate on existing processes where problems are found instead of evaluating why those problems exist and resolving the root issues.

Unfortunately most organizations are like that.

If you find a scalable solution to that let me know, I'd love to deploy it.

raminasi
Jan 25, 2005

a last drink with no ice

toiletbrush posted:

I've just started working on a C# codebase that has nullability checking turned on, and it seems a bit...poo poo. Like, first off, it seems that 'null' for reference types vs 'null' for value types is handled completely differently by the language, which makes it impossible to return 'null' from a method generic in T, even if the T in the return type is optional, unless you constrain T to be either a struct or a class, which is obviously a bit of a dealbreaker if you want the class to be generic over any T. Otherwise you have to return 'default', which doesn't work if you want to tell the difference between, say, null and zero.

Also it seems like the '!' operator on nullable types doesn't mean 'unwrap and throw if null' like in many other languages, but just means 'ignore the warning', so dumb poo poo like this not only compiles, but *doesnt crash*:

code:
string? optional = null;
string notOptional = optional!;
Is there some shorthand for 'I expect this value to be non-null so pls unwrap it but throw an exception if it isnt'?

it is a bit poo poo, it's a set of compile-time guardrails bolted onto the language decades after the problem it's trying to fix was created. imo it does a good job balancing between making new programs better and not getting in the way of old ones but there are always going to be warts. as to your specific question, you might consider something like

C# code:
string? optional = null;
string notOptional = optional ?? throw new Exception("oops");

Shaggar posted:

! is a hack to work around the compiler not being able to understand certain null checks. Like imagine you have IEnumerable<Butt?> butts. If you try to iterate the content you're gonna have to null check everything, so a simple way to avoid nulls would be var nonNullButts = butts.Where(_=>_!=null). However, the compiler cant really understand that and will treat nonNullButts as still being IENumerable<Butt?>. As a workaround you can change it to butts.Where(_=>_!=null).Select(_=>_!) which will force the compiler to treat the output as IEnumerable<Butt>.

cool linq tip: in simple cases you can use OfType to avoid having to use !

12 rats tied together
Sep 7, 2006

i would simply create null objects that log a warning when actuated, and return them instead of an actual null

toiletbrush
May 17, 2010

Shaggar posted:

! is a hack to work around the compiler not being able to understand certain null checks. Like imagine you have IEnumerable<Butt?> butts. If you try to iterate the content you're gonna have to null check everything, so a simple way to avoid nulls would be var nonNullButts = butts.Where(_=>_!=null). However, the compiler cant really understand that and will treat nonNullButts as still being IENumerable<Butt?>. As a workaround you can change it to butts.Where(_=>_!=null).Select(_=>_!) which will force the compiler to treat the output as IEnumerable<Butt>.

As far as im aware Nullable is enforced entirely at the compiler level for backwards compat. So string? optional and string notOptional in your example are both nullable strings under the hood and its the compiler slapping your hand when you try to mix the syntax.

In general though i've been loving nullable being turned on.
yeah that makes sense, and I've been loving it most of the time, still kinda a shame how easy it is to poke holes through though.

whats frustrating is I'm trying to find a way to tell if an optional property of a deserialised object is 'null' because it was explicitly set to null, or because it was missing. if it wasn't for the nullability of int? and string? being represented in a totally incompatible way, it would be pretty easy.

12 rats tied together
Sep 7, 2006

Zlodo posted:

some path deep in the bowels of the process became longer than 260 characters and caused a build failure and we couldn't work all day

meanwhile the russians just put everything on perforce

iirc this is a windows group policy thing that has nothing to do with python. i would probably use perforce though, agreed

champagne posting
Apr 5, 2006

YOU ARE A BRAIN
IN A BUNKER

raminasi posted:


cool linq tip: in simple cases you can use OfType to avoid having to use !

ah yes, OfType, anders hejlsbergs handmaid

Jabor
Jul 16, 2010

#1 Loser at SpaceChem

12 rats tied together posted:

i would simply create null objects that log a warning when actuated, and return them instead of an actual null

don't forget to overload the == operator to make them compare true when compared to an actual null

also make it really expensive for no good reason if you can

redleader
Aug 18, 2005

Engage according to operational parameters

12 rats tied together posted:

i would simply create null objects that log a warning when actuated, and return them instead of an actual null

nice, the worst of both worlds

Zlodo
Nov 25, 2006

12 rats tied together posted:

iirc this is a windows group policy thing that has nothing to do with python. i would probably use perforce though, agreed

Enabling long paths didn't fix it. I don't think python was the culprit though, it looked like the microsoft compiler itself not dealing with long file paths because Microsoft gonna microsoft

The_Franz
Aug 8, 2003

even when long paths are enabled at the os level, applications themselves still have to be long path aware either by prefixing paths with "\\?\" or opting in via the application manifest and explicitly using the 'W' suffix unicode functions. not surprising at all that there are applications that still don't do that.

explorer.exe of all things wasn't long path aware for the longest time. it was entirely possible to make a nested set of directories that couldn't be deleted without special tools

CarForumPoster
Jun 26, 2013

⚡POWER⚡

Corla Plankun posted:

do the stuff that changes the least (e.g. installing required packages) first in the docker file so it will be cached, and copy the code at the very end because it changes all the time and will usually not be cached when you build the docker image

shout out to you for this reminder, looked at a Dockerfile yesterday and realized it'd deploy much faster if I copy my requirement.txt in, pip install that, then copy the rest of the code.

blazing fast now

Corla Plankun
May 8, 2007

improve the lives of everyone
hell yeah, now you're thinking with docker

omeg
Sep 3, 2012

work group chat:
"hey, let me just paste this c++ error"
"wait, cannot send, message length limit exceeded"

Radia
Jul 14, 2021

And someday, together.. We'll shine.

omeg posted:

work group chat:
"hey, let me just paste this c++ error"
"wait, cannot send, message length limit exceeded"

i used to do this all the time with c++ lol

Powerful Two-Hander
Mar 10, 2004

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


Friday afternoon mood: just considered returning a tuple of thruples in a method

Armitag3
Mar 15, 2020

Forget it Jake, it's cybertown.


Powerful Two-Hander posted:

Friday afternoon mood: just considered returning a tuple of thruples in a method

define the struct like a civilised member of society

Powerful Two-Hander
Mar 10, 2004

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


Armitag3 posted:

define the struct like a civilised member of society

you can't make me!

cool av
Mar 2, 2013

Powerful Two-Hander posted:

Friday afternoon mood: just considered returning a tuple of thruples in a method

lol do it

ynohtna
Feb 16, 2007

backwoods compatible
Illegal Hen

Powerful Two-Hander posted:

Friday afternoon mood: just considered returning a tuple of thruples in a method

have you no scruples?

Powerful Two-Hander
Mar 10, 2004

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


I took the cowards way out and used getters on the object that the thruples are sourced from in the first place

why was I making GBS threads out separate tuple/thruple objects manually instead of doing this before? I guess because me 9 months ago was an idiot.

Carthag Tuek
Oct 15, 2005

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



imo use a fixed length list with magic indexes, it's more efficient

mystes
May 31, 2006

Powerful Two-Hander posted:

I took the cowards way out and used getters on the object that the thruples are sourced from in the first place

why was I making GBS threads out separate tuple/thruple objects manually instead of doing this before? I guess because me 9 months ago was an idiot.
Wait another five years and c# will probably probably have something like anonymous records* for this situation since it keeps becoming more like f#

*: Kind of like python named tuples or data classes that you can define ad hoc when you create them.

Powerful Two-Hander
Mar 10, 2004

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


Carthag Tuek posted:

imo use a fixed length list with magic indexes, it's more efficient

there is zero efficiency in this whole thing tbh because it's building a graph by querying related nodes and then stuffing the edge into a dictionary, but you've gotta check if the edge exists in there first because our data source lets you map poo poo up in illogical and duplicative ways!

so the thruple key on the dictionary is <relationshipTypeEnum, fromId, toId> :barf:

Powerful Two-Hander fucked around with this message at 19:44 on Jul 8, 2022

Carthag Tuek
Oct 15, 2005

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



i was just making a funy but i guess it sounded too real

Carthag Tuek
Oct 15, 2005

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



sorry

Powerful Two-Hander
Mar 10, 2004

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


Carthag Tuek posted:

i was just making a funy but i guess it sounded too real

with "modern" "programming" it is impossible to tell if something is a joke or not

Powerful Two-Hander
Mar 10, 2004

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



never apologise for posting

bob dobbs is dead
Oct 8, 2017

I love peeps
Nap Ghost
that sounds suspiciously semantic weblike

i have been telling you to run away for a whole year now, i think

Powerful Two-Hander
Mar 10, 2004

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


bob dobbs is dead posted:

that sounds suspiciously semantic weblike

i have been telling you to run away for a whole year now, i think

mark that in your diary lol

this is my own pet "spare time" project (which is why it's been 9 months since I last touched it), generating a DAG of our reference data structure(s) but ordering it into layers like a hierarchy for display using some handy libraries I found that integrate with d3.

at this point I mostly just need to put some decent SVG graphics onto it but :effort:

Corla Plankun
May 8, 2007

improve the lives of everyone

Powerful Two-Hander posted:

there is zero efficiency in this whole thing tbh because it's building a graph by querying related nodes and then stuffing the edge into a dictionary, but you've gotta check if the edge exists in there first because our data source lets you map poo poo up in illogical and duplicative ways!

so the thruple key on the dictionary is <relationshipTypeEnum, fromId, toId> :barf:

i hate it when work stuff gets like this

like, when my task is to drop in and make a system compatible with symmetricFartRelationshipType or whatever but then i get in there and discover something this nasty but don't have the time to deal with it, so i just have to debase myself and hustle through the poop

Corla Plankun
May 8, 2007

improve the lives of everyone
obviously no offense meant if you wrote the original or whatever, we've all written garbage and sometimes it unexpectedly becomes loadbearing

Carthag Tuek
Oct 15, 2005

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



Powerful Two-Hander posted:

never apologise for posting

🥰

Armitag3
Mar 15, 2020

Forget it Jake, it's cybertown.


Corla Plankun posted:

obviously no offense meant if you wrote the original or whatever, we've all written garbage and sometimes it unexpectedly becomes loadbearing

there’s nothing more permanent than a temporary solution. - oscar wilde

CarForumPoster
Jun 26, 2013

⚡POWER⚡
its 4:30 on friday and im pushin to prod

Captain Foo
May 11, 2004

we vibin'
we slidin'
we breathin'
we dyin'

CarForumPoster posted:

its 4:30 on friday and im pushin to prod

gently caress you lol

CPColin
Sep 9, 2003

Big ol' smile.
Hell yeah gently caress da police

DELETE CASCADE
Oct 25, 2017

i haven't washed my penis since i jerked it to a phtotograph of george w. bush in 2003
not only do we release on fridays, we only release on fridays

Adbot
ADBOT LOVES YOU

Carthag Tuek
Oct 15, 2005

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



every thurs/fri we're like oh we need to push the new feature but then we're like ehhh nah weekend is coming up let's do it next week and then we forget and the cycle repeats

no deployments = no new bugs :cool:

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