New around here? Register your SA Forums Account here!

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
TheFluff
Dec 13, 2006

FRIENDS, LISTEN TO ME
I AM A SEAGULL
OF WEALTH AND TASTE

Bloody posted:

equals behaves as expected (e.g. a != c in that example)

this is all extremely loving with my ability to property test some poo poo that uses strings a lot

wait what, i just found https://docs.microsoft.com/en-us/dotnet/standard/base-types/best-practices-strings?view=netframework-4.8#ordinal-string-operations which actually explicitly says

quote:

Strings in .NET can contain embedded null characters. One of the clearest differences between ordinal and culture-sensitive comparison (including comparisons that use the invariant culture) concerns the handling of embedded null characters in a string. These characters are ignored when you use the String.Compare and String.Equals methods to perform culture-sensitive comparisons (including comparisons that use the invariant culture). As a result, in culture-sensitive comparisons, strings that contain embedded null characters can be considered equal to strings that do not.

Important

Although string comparison methods disregard embedded null characters, string search methods such as String.Contains, String.EndsWith, String.IndexOf, String.LastIndexOf, and String.StartsWith do not.

Adbot
ADBOT LOVES YOU

Plank Walker
Aug 11, 2005

Bloody posted:

i used property-based testing this week and i found a bunch of weird edge cases in my own code i wasn't expecting and found weird behavior in the c# stdlib i definitely wasn't expecting and it was cool and good. thanks FsCheck

but really why are string comparers like this:


what ide/setting is displaying the parameter names there?

Sapozhnik
Jan 2, 2005

Nap Ghost
there really ought to be separate data types for "text for machine consumption" and "text for human consumption"

raminasi
Jan 25, 2005

a last drink with no ice

Bloody posted:

equals behaves as expected (e.g. a != c in that example)

this is all extremely loving with my ability to property test some poo poo that uses strings a lot

fscheck has a generator that produces strings without goofball control characters if you have the luxury of not needing to actually care about them in your application code

raminasi
Jan 25, 2005

a last drink with no ice
day 12 of new job: appear to have broken Jenkins for the whole org lol

TheFluff
Dec 13, 2006

FRIENDS, LISTEN TO ME
I AM A SEAGULL
OF WEALTH AND TASTE
i knocked out most of production for fifteen minutes today by increasing the log event quota on our Sentry error tracker subscription

Carthag Tuek
Oct 15, 2005

altid pamo når du går
veje du burd' kende
overleved' barneår
lig' til livets ende

Sapozhnik posted:

there really ought to be separate data types for "text for machine consumption" and "text for human consumption"

there are, its called a type system (or enum vs string if your type system sucks)

animist
Aug 28, 2018

Krankenstyle posted:

there are, its called a type system (or enum vs string if your type system sucks)

or bytes vs str in python, sorta. not really

the problem is that sometimes you want to put human data in your non-human data and then you're sad :/

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS

Arcsech posted:

you know what is 100% like smashing yourself in the face with a hammer tho? go's dependency "management" (prior to go dep or whatever the new poo poo is, i only know the version where it downloads github and sticks it in some path you're supposed to have all your go poo poo in)

100% agreed

it's really really bad and go modules is only marginally better in so far as that it's deterministic about which hash it checks out from github :awesome:

Xarn posted:

Blinkzorz is the "technical" manager who made his team use go because it is the new cool thing from Google :v:

i'm not and i didn't?

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS

TheFluff posted:

what is even with you, you've been super defensive about go for the last three pages

like, i was posting about a dumb and funny language feature in the terrible programming thread and you're like "it's dumb to point out dumb things in programming languages tho", as if all programming languages weren't terrible, and then you go off with some snippy poo poo about how everyone is dumb for being mean to your favorite language. calm the gently caress down.

this thread gets into dumb slapfights about which language or ecosystem or dependency management tool is better but it's all garbage and we should be talking about how we're doing our best to make our day-to-day lives better while we stack absurd amounts of paper

Carthag Tuek
Oct 15, 2005

altid pamo når du går
veje du burd' kende
overleved' barneår
lig' til livets ende

animist posted:

or bytes vs str in python, sorta. not really

the problem is that sometimes you want to put human data in your non-human data and then you're sad :/

either dont do that or make some sort of transformation that fixes the problem (lol)

animist
Aug 28, 2018

Krankenstyle posted:

either dont do that or make some sort of transformation that fixes the problem (lol)

lol

Progressive JPEG
Feb 19, 2003

leper khan posted:

errno is thread local in modern versions of the spec, but originally it was a global var. of course when C was originally conceived multi core processors were somewhat rare.

that sounds like how when go was started hardly anybody used libraries so they didn't see any need to support them

and still don't

Carthag Tuek
Oct 15, 2005

altid pamo når du går
veje du burd' kende
overleved' barneår
lig' til livets ende

tbf multicores werent really a thing when C was invented

libraries very much were when go was "invented" (or regressed to, i guess)

FlapYoJacks
Feb 12, 2009

by vyelkin

Krankenstyle posted:

what about just having a global array and stuffing your poo poo in magically numbered & undocumented slots? you like?

Don't kink shame me.

Soricidus
Oct 20, 2010
freedom-hating statist shill

Blinkz0rz posted:

this thread gets into dumb slapfights about which language or ecosystem or dependency management tool is better but it's all garbage and we should be talking about how we're doing our best to make our day-to-day lives better while we stack absurd amounts of paper

ok

so one of the ways i'm making my day-to-day life better while i stack absurd amounts of paper is by not using the worst programming languages,

redleader
Aug 18, 2005

Engage according to operational parameters

hello what why what the gently caress

Fiedler
Jun 29, 2002

I, for one, welcome our new mouse overlords.
i bet you scrubs haven't even been normalizing your unicode strings before comparing them. shameful.

Progressive JPEG
Feb 19, 2003

Krankenstyle posted:

tbf multicores werent really a thing when C was invented

libraries very much were when go was "invented" (or regressed to, i guess)

:thejoke: tho I admit it wasnt a very good one

Carthag Tuek
Oct 15, 2005

altid pamo når du går
veje du burd' kende
overleved' barneår
lig' til livets ende

Progressive JPEG posted:

:thejoke: tho I admit it wasnt a very good one

no worries as long as it was terrible we're cool lmbo

Arcsech
Aug 5, 2008

Blinkz0rz posted:

this thread gets into dumb slapfights about which language or ecosystem or dependency management tool is better but it's all garbage and we should be talking about how we're doing our best to make our day-to-day lives better while we stack absurd amounts of paper

you're right, we have better things to do than get in dumb slapfights about which tech thing is better here in Your Operating System is a Piece Of poo poo

Shaggar
Apr 26, 2006

Blinkz0rz posted:

this thread gets into dumb slapfights about which language or ecosystem or dependency management tool is better but it's all garbage and we should be talking about how we're doing our best to make our day-to-day lives better while we stack absurd amounts of paper

a great way to make your life better is to not use bad languages, ecosystems, or dependency management tools

HoboMan
Nov 4, 2010

pl thread is for language slapfights, this therad is for commiserating and or panicking about the terrible code we are all making GBS threads out (which is all code)

that said, shaggar is still right

TerraGoetia
Feb 21, 2011

A cup of spiders.
I am meeting resistance encouraging my team to upgrade from C++98.

pseudorandom
Jun 16, 2010



Yam Slacker

Blinkz0rz posted:

this thread gets into dumb slapfights about which language or ecosystem or dependency management tool is better but it's all garbage and we should be talking about how we're doing our best to make our day-to-day lives better while we stack absurd amounts of paper


I think the problem here is the slap fights arise from trying to help someone by suggesting "better" day-to-day life tools, but then the person says "I can't" or "I have", and then everyone assumes they need to be institutionalized because they didn't immediately accept and adopt the one true language/package manager/build tool.


Rust and Cargo

Also

HoboMan posted:

pl thread is for language slapfights, this therad is for commiserating and or panicking about the terrible code we are all making GBS threads out (which is all code)

that said, shaggar is still right

eschaton
Mar 7, 2007
Probation
Can't post for 11 hours!

Private Speech posted:

The funny thing is that null pointer comparison actually does work in C (with a few small caveats).

try using C on a platform where NULL is not literally address zero and see how well that it really works…

(Zeta-C for LispM represented NULL as (nil . nil) and was ANSI-conforming)

gonadic io
Feb 16, 2011

>>=

pseudorandom posted:

I think the problem here is the slap fights arise from trying to help someone by suggesting "better" day-to-day life tools, but then the person says "I can't" or "I have", and then everyone assumes they need to be institutionalized because they didn't immediately accept and adopt the one true language/package manager/build tool.


Rust and Cargo

Also

let's not get ahead of ourselves here, cargo doesn't _really_ support private registries for example. I mean they technically did add support recently but nobody has actually build an open source one you can run yet.

eschaton
Mar 7, 2007
Probation
Can't post for 11 hours!

Sapozhnik posted:

there really ought to be separate data types for "text for machine consumption" and "text for human consumption"

we basically have this in ObjC when you enable the localizable string warnings in the static analyzer

gonadic io
Feb 16, 2011

>>=
Haskell kind of has this because if you recall the standard string type is horrific and it just so happens that the two replacements, ByteString and Text, happen to be more specialised for the different use cases.

animist
Aug 28, 2018
u ever just sit around n get mad at committees

currently im mad at the google fucks squatting on the webassembly governing board. they didn't feel like integrating 1 (1) algorithm into their Magic Special Javascript Runtime, so they're forcing everyone else to use a spec that's full of obnoxious misfeatures

and of course webassembly's gonna end up being the assembly format we're all stuck with forever, because we live in hell. and it's just 80% more obnoxious and generates significantly worse code than it might be able to, because 3 dudes wanted to force everyone else to do their work for them.

so, sorry, tps in the AI blockchain mines of the 23rd century. u might wonder why the universal assembly format that runs all your rusty slave-powered computers doesn't have basic blocks, and instead requires you to pretend to be compiling to a bizarre subset of javascript and turn your CFG into awful frankenstein duffs-device loops just to compile a switch statement. blame this guy

TheFluff
Dec 13, 2006

FRIENDS, LISTEN TO ME
I AM A SEAGULL
OF WEALTH AND TASTE

redleader posted:

hello what why what the gently caress

I'm not sure if there's something especially weird about nulls in c# - as I posted earlier I would expect p much all control chars including U+0000 to be ignored in a locale-aware string comparison:

TheFluff posted:

because they are compliant with Unicode® Technical Standard #10: Unicode Collation Algorithm

the .Compare() method is normally used for determining sort order, and basically all control chars plus some more or less obscure diacritics have a collation weight of zero which means they are completely ignored for the purposes of a collated comparison (see table 10).

try .Equals() instead, i actually don't know if that would return the same result :v:

string.localeCompare in js does the same thing - "\u0000" compares equal with an empty string

TheFluff fucked around with this message at 08:08 on May 18, 2019

Fiedler
Jun 29, 2002

I, for one, welcome our new mouse overlords.

animist posted:

and of course webassembly's gonna end up being the assembly format we're all stuck with forever

extremely unlikely. in a few years google will use their browser monopoly to introduce a new, completely incompatible technology that will somehow have the odd, completely unintended side-effect of making google more ad money.

gonadic io
Feb 16, 2011

>>=

Fiedler posted:

extremely unlikely. in a few years google will use their browser monopoly to introduce a new, completely incompatible technology that will somehow have the odd, completely unintended side-effect of making google more ad money.

And youtube will only work with said technology

TheFluff
Dec 13, 2006

FRIENDS, LISTEN TO ME
I AM A SEAGULL
OF WEALTH AND TASTE
a decent locale aware string comparer has a strength setting for tuning how aggressive it is, but I'd expect a compliant one to ignore control chars even at the most sensitive setting. if you want stricter equality than that, just use nfc normalization and simple byte equality

gonadic io
Feb 16, 2011

>>=
Locale sensitive string comparison is like crypto, or datetimes. Just refuse to touch the implementation code 100% of the time and leave it to weird genius loners. You will never ever get it right.

tef
May 30, 2004

-> some l-system crap ->

Krankenstyle posted:

what about just having a global array and stuffing your poo poo in magically numbered & undocumented slots? you like?

sounds like you have a whole heap of problems there

Carthag Tuek
Oct 15, 2005

altid pamo når du går
veje du burd' kende
overleved' barneår
lig' til livets ende

tef posted:

sounds like you have a whole heap of problems there

:wink:

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope

tef posted:

sounds like you have a whole heap of problems there

:hmmyes:

brap
Aug 23, 2004

Grimey Drawer

gonadic io posted:

Locale sensitive string comparison is like crypto, or datetimes. Just refuse to touch the implementation code 100% of the time and leave it to weird genius loners. You will never ever get it right.

you know the people who implement/maintain this stuff are still people

Adbot
ADBOT LOVES YOU

brap
Aug 23, 2004

Grimey Drawer
you're maybe not being 100% serious in the funy computer forum but i dont agree with the perception that you can only work on X computer thing if you're a Genius

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