|
Scaramouche posted:
code:
|
# ? Feb 15, 2019 22:50 |
|
|
# ? Jun 3, 2024 05:47 |
|
Scaramouche posted:
|
# ? Feb 15, 2019 23:35 |
|
Ola posted:
code:
|
# ? Feb 16, 2019 01:13 |
|
C++ code:
|
# ? Feb 16, 2019 01:50 |
|
Absurd Alhazred posted:
code:
|
# ? Feb 16, 2019 02:06 |
|
Ola posted:
|
# ? Feb 16, 2019 02:21 |
|
Lotta coding horrors on this page
|
# ? Feb 16, 2019 02:51 |
|
ObjectiveC. I recently had to read and fix an iOS ObjectiveC project. I have decades of experience, many languages and platforms. Yet, nothing has ever prepared me for ObjectiveC. WTF is wrong with that syntax? Do people get used to it? Assigning a value to an object member seems like insanity. Can't wait to try Swift, hopefully they made a reasonable enough language that mere mortals can read and write. gently caress, ObjectiveC is an horror in and of itself.
|
# ? Feb 16, 2019 03:00 |
|
Volguus posted:ObjectiveC. Yeah you get used to it. It's been a long time since I've messed with it but the bracket syntax is there to emphasize the idea that you're sending a message to a receiver. Swift syntax is just nice modern algol. No complaints. Could be more expression-y I guess but that's just my taste. Feels good on my eyes and my fingers. DONT THREAD ON ME fucked around with this message at 05:03 on Feb 16, 2019 |
# ? Feb 16, 2019 03:07 |
|
most modern languages seem to be converging on the one true syntax
|
# ? Feb 16, 2019 05:03 |
|
DONT THREAD ON ME posted:most modern languages seem to be converging on the one true syntax really? there's clojure I guess, which other examples are you thinking of?
|
# ? Feb 16, 2019 14:16 |
|
ML
|
# ? Feb 16, 2019 14:25 |
|
Volguus posted:ObjectiveC. It's really good in my opinion. Maybe a little verbose, but passing arguments in the middle of the name of a method, instead of after it, was a brilliant idea. Autorelease pools and ARC are things I would have killed for when I wrote COM code, and blocks really rounded out the language nicely. It has a really good object model, although maybe not very efficient. I really liked Objective C when I worked with it Swift, though, is so much better
|
# ? Feb 16, 2019 15:07 |
|
omeg posted:Exceptions were a mistake. Unironically this
|
# ? Feb 16, 2019 17:41 |
|
Soricidus posted:really? there's clojure I guess, which other examples are you thinking of? i was being facetious but look at like, swift, kotlin, rust, they're all basically algol but with some ML. the more ML the better imo.
|
# ? Feb 16, 2019 17:49 |
|
Volguus posted:ObjectiveC. It's literally just Smalltalk embedded into C, and quite cleverly done. But remember that you can be too clever for your own good...
|
# ? Feb 16, 2019 17:49 |
|
rt4 posted:ML I want an MLish shell to replace bash/coreutils. E: F# interpreter doesn't count. Some moons ago, there was a guy I worked with that annoyed me a lot. I would always change his shell to oddball poo poo when I had the chance. F# seemed to frustrate him the most. dougdrums fucked around with this message at 19:06 on Feb 16, 2019 |
# ? Feb 16, 2019 18:59 |
|
This isn't even a horror or all that bad. A new dev picked up a fairly simple ticket that involved adding two fields to an import and some logic in the backend. He talked about doing boolean algebra and even had an excel spreadsheet where he was doing truth tables. All for what basically could be written as: code:
code:
|
# ? Feb 16, 2019 19:04 |
|
Rubellavator posted:This isn't even a horror or all that bad. A new dev picked up a fairly simple ticket that involved adding two fields to an import and some logic in the backend. He talked about doing boolean algebra and even had an excel spreadsheet where he was doing truth tables. code:
|
# ? Feb 16, 2019 19:07 |
|
Bruegels Fuckbooks posted:Your examples are both gross. Cool you set optionField to "B" when option1 wasn't selected. Failed.
|
# ? Feb 16, 2019 19:09 |
|
in order for that to not suck your language needs if or match expressions. the ternary example is the right idea but needs a better language construct.
DONT THREAD ON ME fucked around with this message at 19:22 on Feb 16, 2019 |
# ? Feb 16, 2019 19:20 |
|
dougdrums posted:I want an MLish shell to replace bash/coreutils. "turtle is a reimplementation of the Unix command line environment in Haskell so that you can use Haskell as both a shell and a scripting language."
|
# ? Feb 16, 2019 19:20 |
|
Doc Hawkins posted:"turtle is a reimplementation of the Unix command line environment in Haskell so that you can use Haskell as both a shell and a scripting language." Just because you can doesn't mean you should.
|
# ? Feb 16, 2019 19:31 |
|
Bruegels Fuckbooks posted:Your examples are both gross. The code you've posted here is not equivalent to either of the two pieces of code Rubellavator posted.
|
# ? Feb 16, 2019 19:44 |
|
code:
|
# ? Feb 16, 2019 19:45 |
|
Doc Hawkins posted:"turtle is a reimplementation of the Unix command line environment in Haskell so that you can use Haskell as both a shell and a scripting language." All files are a-rwx.
|
# ? Feb 16, 2019 19:52 |
|
Rubellavator posted:This isn't even a horror or all that bad. A new dev picked up a fairly simple ticket that involved adding two fields to an import and some logic in the backend. He talked about doing boolean algebra and even had an excel spreadsheet where he was doing truth tables. But what if option2 == "A" but isNumber(value) == false? optionField correctly remains whatever it was before if (option1)? e: I should say I love cutting through complicated nesting with boolean algebra, but often it just turns a readable but inelegant 7-liner into a difficult to read, CS-professor nerdboner 6-liner.
|
# ? Feb 16, 2019 19:54 |
|
Ola posted:But what if option2 == "A" but isNumber(value) == false? optionField correctly remains whatever it was before if (option1)? It should stay null. optionField is something that was added in a later revision of the standard we use. We're offering them the ability to set that field during import if they're using a revision that predates it. Basically, 40 years ago some guy needed a new 3 character field to an 80 character width card, but he didn't have room, so he repurposed a related field and added a 1 character flag field so that you could know how the repurposed field was being used.
|
# ? Feb 16, 2019 21:16 |
|
Hammerite posted:The code you've posted here is not equivalent to either of the two pieces of code Rubellavator posted. Actually the right answer is to throw all that lovely code out and start again if it's not equivalent. If you have to draw truth tables to figure out how to check a field in a select box your design is hosed.
|
# ? Feb 16, 2019 21:20 |
|
Soricidus posted:really? there's clojure I guess, which other examples are you thinking of?
|
# ? Feb 16, 2019 21:52 |
|
Rubellavator posted:Basically, 40 years ago some guy needed a new 3 character field to an 80 character width card, but he didn't have room, so he repurposed a related field and added a 1 character flag field so that you could know how the repurposed field was being used. There's always a greater horror.
|
# ? Feb 17, 2019 04:39 |
|
Fatty Crabcakes posted:I'm willing to admit that lisps are slightly better than catching your weenis in a zipper, but clojure is just loving dogshit. What? Clojure is what convinced me to give in to the Lisps, who only ever loved me and wanted me to love them.
|
# ? Feb 17, 2019 07:16 |
|
https://twitter.com/chrisbranch/status/1094581030147768320
|
# ? Feb 17, 2019 08:26 |
|
Bruegels Fuckbooks posted:Actually the right answer is to throw all that lovely code out and start again if it's not equivalent. If you have to draw truth tables to figure out how to check a field in a select box your design is hosed. You don't have to draw truth tables, though. Rubellavator's co-worker was making a mountain out of a molehill, this individual piece of logic is not that complicated. Additionally, it sounds from Rubellavator's posts providing additional context as though this is a small part of a complex existing system that can't necessarily be simplified as you would like. The real answer is unit tests.
|
# ? Feb 17, 2019 13:26 |
|
code:
Funny part is that I think it found its way into the code because someone googled “null check unity” and got to MSDN for Microsoft’s DI container.
|
# ? Feb 17, 2019 14:09 |
|
leper khan posted:
I think this mindless bit of copypasta rises to the glorious level of "indistinguishable from intentional obfuscation". Incredible.
|
# ? Feb 17, 2019 16:35 |
|
pokeyman posted:I think this mindless bit of copypasta rises to the glorious level of "indistinguishable from intentional obfuscation". Incredible. Well I assume it’s for Unity3D which does questionable things with overriding.Equals for null checks that causes Elvis operator to work in the editor but fail on a device. They asked for a way to override ?. And were told to go gently caress themselves.
|
# ? Feb 17, 2019 21:23 |
|
I spent a day doing unity without a whole lot of game dev or c# experience and it was very clear to me that there are untold horrors hiding there.
|
# ? Feb 17, 2019 22:49 |
|
Beamed posted:What? Clojure is what convinced me to give in to the Lisps, who only ever loved me and wanted me to love them. While I love Clojure and had the same experience with it, it is never far from my mind that its error reporting sucks endless fields of rotting rear end, and that's the main thing that prevents me from wholeheartedly recommending it to everyone. A runtime error is just a plain old Java exception, so you get a gross mix of Clojure stack frames, Java stack frames in Java libraries you called deliberately, and Java stack frames in the internals of Clojure itself filling multiple pages of terminal. Coming from languages like Lua or Python (or even plain Java) where errors don't generally lay the guts of the interpreter out all over your terminal, this is pretty shocking. Compile-time errors are even worse, because they also use the Java exception mechanism, so you forget a ) somewhere and now you have an 80-line stack trace with the actual error buried somewhere at the top of it. If you're really unlucky, it can't even figure out what file the error is in; I think this has only happened to me once, but it should never happen. And if you're using something like core.typed it's great when it works, but when it goes wrong it goes vastly, incomprehensibly wrong. There are libraries that improve on this somewhat, like Pretty, but they're still generally not as good as what you get out of the box in other managed languages.
|
# ? Feb 17, 2019 22:51 |
|
|
# ? Jun 3, 2024 05:47 |
|
I will say this: if you need a dynamic language on the JVM, you could do a hell of a lot worse than Clojure. Groovy
|
# ? Feb 17, 2019 23:00 |