|
Bloody posted:equals behaves as expected (e.g. a != c in that example) 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.
|
![]() |
|
![]()
|
# ? Feb 9, 2025 15:07 |
|
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 what ide/setting is displaying the parameter names there?
|
![]() |
|
there really ought to be separate data types for "text for machine consumption" and "text for human consumption"
|
![]() |
|
Bloody posted:equals behaves as expected (e.g. a != c in that example) 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
|
![]() |
|
day 12 of new job: appear to have broken Jenkins for the whole org lol
|
![]() |
|
i knocked out most of production for fifteen minutes today by increasing the log event quota on our Sentry error tracker subscription
|
![]() |
|
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)
|
![]() |
|
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 :/
|
![]() |
|
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 ![]() Xarn posted:Blinkzorz is the "technical" manager who made his team use go because it is the new cool thing from Google i'm not and i didn't?
|
![]() |
|
TheFluff posted:what is even with you, you've been super defensive about go for the last three pages 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
|
![]() |
|
animist posted:or bytes vs str in python, sorta. not really either dont do that or make some sort of transformation that fixes the problem (lol)
|
![]() |
|
Krankenstyle posted:either dont do that or make some sort of transformation that fixes the problem (lol) lol
|
![]() |
|
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
|
![]() |
|
tbf multicores werent really a thing when C was invented libraries very much were when go was "invented" (or regressed to, i guess)
|
![]() |
|
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.
|
![]() |
|
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,
|
![]() |
|
TheFluff posted: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 hello what why what the gently caress
|
![]() |
|
i bet you scrubs haven't even been normalizing your unicode strings before comparing them. shameful.
|
![]() |
|
Krankenstyle posted:tbf multicores werent really a thing when C was invented ![]()
|
![]() |
|
Progressive JPEG posted:
no worries as long as it was terrible we're cool lmbo
|
![]() |
|
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
|
![]() |
|
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
|
![]() |
|
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
|
![]() |
|
I am meeting resistance encouraging my team to upgrade from C++98.
|
![]() |
|
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)
|
![]() |
|
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)
|
![]() |
|
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. 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.
|
![]() |
|
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
|
![]() |
|
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.
|
![]() |
|
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
|
![]() |
|
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 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 |
![]() |
|
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.
|
![]() |
|
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
|
![]() |
|
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
|
![]() |
|
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.
|
![]() |
|
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
|
![]() |
|
tef posted:sounds like you have a whole heap of problems there ![]()
|
![]() |
|
tef posted:sounds like you have a whole heap of problems there ![]()
|
![]() |
|
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
|
![]() |
|
![]()
|
# ? Feb 9, 2025 15:07 |
|
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
|
![]() |