|
We have a ton of these littered around our codebase:code:
|
# ? Dec 6, 2017 21:34 |
|
|
# ? May 30, 2024 17:11 |
|
I just sincerely wrote (in Go) the type map[string][]map[string]interface{}.
|
# ? Dec 6, 2017 21:37 |
TooMuchAbstraction posted:I just sincerely wrote (in Go) the type map[string][]map[string]interface{}. I've done it, too. Using the reflect package?
|
|
# ? Dec 6, 2017 21:57 |
|
Eela6 posted:I've done it, too. Using the reflect package? No, this was converting a JSON blob into something usable. That said, it's kind of shocking how your options for Go are either to tediously enumerate everything by hand, use a code generator, or leap off the deep end into reflection.
|
# ? Dec 6, 2017 22:01 |
|
I find this impressive, but also terrifying
|
# ? Dec 6, 2017 22:04 |
|
ChickenWing posted:in before "what tests?" It compiles, isn't that enough of a test?
|
# ? Dec 6, 2017 22:50 |
|
Suspicious Dish posted:We have a ton of these littered around our codebase: Seeing as you're admitting to it, there's going to be a good reason, so, you know, go on...
|
# ? Dec 6, 2017 22:52 |
|
Dirty Frank posted:Seeing as you're admitting to it, there's going to be a good reason, so, you know, go on... the conditional breakpoint gui in visual studio has been broken for like three releases now
|
# ? Dec 6, 2017 22:56 |
|
Suspicious Dish posted:the conditional breakpoint gui in visual studio has been broken for like three releases now ha! ok, don't check them in though, that is naughty! also for anyone using c# it works fine, this poor bastard is using c++ I'm guessing?
|
# ? Dec 6, 2017 23:00 |
|
uh yes our game engine is c++ like every other one in existence
|
# ? Dec 6, 2017 23:13 |
|
Suspicious Dish posted:uh yes our game engine is c++ like every other one in existence Have you heard of Unity, by any chance?
|
# ? Dec 6, 2017 23:49 |
|
duz posted:It compiles, isn't that enough of a test?
|
# ? Dec 6, 2017 23:51 |
|
TooMuchAbstraction posted:Have you heard of Unity, by any chance? The actual engine is written C++. Unity Website posted:Native C++ performance across platforms with Unity-developed back-end IL2CPP scripting That being said, there are game engines in every major language. And some that don't make sense. The Fool fucked around with this message at 00:05 on Dec 7, 2017 |
# ? Dec 7, 2017 00:02 |
|
The Fool posted:The actual engine is written C++. Ah, my mistake. Thanks for the correction.
|
# ? Dec 7, 2017 00:10 |
|
TooMuchAbstraction posted:No, this was converting a JSON blob into something usable. That said, it's kind of shocking how your options for Go are either to tediously enumerate everything by hand, use a code generator, or leap off the deep end into reflection. TooLittleAbstraction
|
# ? Dec 7, 2017 00:32 |
|
The Phlegmatist posted:These get posted every once in a while in this thread and I'm like 95% sure it's people who learned to program using Perl, since ca. Perl 5 and Perl Best Practices that was a common idiom to guarantee you returned a boolean value and not something else. Did you learn to program with Perl? There is no 'true', no 'false', and very explicit rules in the basic documentation. Likewise in perlintro, and the common idiom is to make use of undef==false in subroutine returns. Looks more like Python (and Ruby in the edit).
|
# ? Dec 7, 2017 02:01 |
|
TooMuchAbstraction posted:Have you heard of Unity, by any chance? yes. the core engine is in C++ but they added mono bindings and that's where they want you to program, but there is a large chunk of actual C++ engine. they sometimes compile your mono C# to C++ for platforms where they can't ship a JIT engine.
|
# ? Dec 7, 2017 02:35 |
|
PhantomOfTheCopier posted:Did you learn to program with Perl? There is no 'true', no 'false' sure there is! code:
|
# ? Dec 7, 2017 02:48 |
|
canis minor posted:I find this impressive, but also terrifying Hey, gently caress you, buddy. quote:Alice is a two-dimensional, stack-based, recreational programming language. It was designed as a feature-rich Fungeoid with many useful (and some not so useful) commands which make it comparably usable for a 2D language. To this end, depending on whether the instruction pointer moves orthogonally or diagonally, Alice operates either in an integer mode or in a string mode, which allows every operator to be overloaded with two different commands.
|
# ? Dec 7, 2017 04:34 |
|
canis minor posted:I find this impressive, but also terrifying This is so far beyond the realm of my understanding and comfort zone, that I'm only getting a somewhat eldritch vibe. Pretty much i_know_some_of_these_words.png
|
# ? Dec 7, 2017 09:47 |
|
Loezi posted:This is so far beyond the realm of my understanding and comfort zone, that I'm only getting a somewhat eldritch vibe. Pretty much i_know_some_of_these_words.png It's something where visual aids would go a long way, especially an animation of a program running. While it's pretty difficult to follow the description, the actual language is not very complex. Your program looks like a word search; a big grid of characters that's loaded into RAM. A cursor bounces around and every character it touches is an instruction to execute. It has math instructions, text instructions, goto instructions, everything you need to compute. Plus there's a couple stacks for temporary data storage.
|
# ? Dec 7, 2017 10:26 |
|
ratbert90 posted:
Athas posted:How does this work in C++? Is this some shenanigans with forward-declared classes that just end up not causing a linker/compiler error by chance (because of no data members?)? Was it CRTP? We had a bunch of code that used to use that because the devs on that team were scared of vtable lookup latency so all of their polymorphism was at compile time. Also they had their code set up as a chain of different stages, each stage templated with its input and output destinations, which if you think about it for a moment means that each stage had all of the others as a template argument. They would frequently have problems with hitting MSVC's template recursion depth limit and if they ever got a compile error... well, we don't talk about that in public.
|
# ? Dec 7, 2017 14:16 |
|
code:
|
# ? Dec 7, 2017 15:43 |
|
Pollyanna posted:
Go on...
|
# ? Dec 7, 2017 15:46 |
|
https://www.npmjs.com/package/bowser The code looks valid, but browser detection in general is its own horror...
|
# ? Dec 7, 2017 15:53 |
|
repiv posted:https://www.npmjs.com/package/bowser Haha gently caress, teaches me to assume something is a typo. I can imagine unaware devs “fixing” a codebase full of errors...
|
# ? Dec 7, 2017 16:01 |
|
repiv posted:https://www.npmjs.com/package/bowser And sometimes unavoidable when you're using newer APIs that don't behave consistently.
|
# ? Dec 7, 2017 16:02 |
|
One of our QA guys taught himself Python and made a whole Tk app with multithreading and serial communication and stuff, but he never learned about the "and" keyword Python code:
|
# ? Dec 7, 2017 19:37 |
Suggest that he pack the validation logic into a separate function with early return:Python code:
nielsm fucked around with this message at 19:47 on Dec 7, 2017 |
|
# ? Dec 7, 2017 19:45 |
|
boo_radley posted:Hey, gently caress you, buddy. I aim to please On the other hand Bob is more what I'm accustomed to.
|
# ? Dec 7, 2017 22:54 |
|
Reformed Pissboy posted:One of our QA guys taught himself Python and made a whole Tk app with multithreading and serial communication and stuff, but he never learned about the "and" keyword That’s super cool. Enjoy the look on QA guy's face when you show them and!
|
# ? Dec 8, 2017 00:09 |
|
PhantomOfTheCopier posted:Did you learn to program with Perl? There is no 'true', no 'false', and very explicit rules in the basic documentation. Likewise in perlintro, and the common idiom is to make use of undef==false in subroutine returns. Yeah, that was the way I was taught (I tried to generalize the examples a little bit since I don't maintain Perl anymore, just maintain code from ex-Perl programmers.) But we were taught that all functions need to have a single point of return and that if the function was meant to return a boolean, we needed to specifically return the result in a boolean context by returning a conditional. That's probably a paranoid level of defensive programming, but it was in vogue at the time.
|
# ? Dec 8, 2017 02:13 |
|
I am the coding horror. I made a function yesterday that takes a vector pair and can hack up a string several times based off of what was passed via the vector. std::string testString = "1:2:3 4:5:6,7,8"; std::vector<std::pair<std::string, int> > delimiters = {{" ", 1}, {":", -1}, {",", 1}}; std::vector<std::string> returnVector = multiSplit(testString, delimiters); This would return a vector of strings containing 4, 5, and 7. It's me, I am the coding horror. I could have used boost, but I didn't want to actually do any real work yesterday.
|
# ? Dec 8, 2017 12:55 |
|
code:
Never abbreviate that word!
|
# ? Dec 8, 2017 20:27 |
|
Yeah, it's dumb. And "meme" is only four letters anyway.
|
# ? Dec 8, 2017 20:43 |
|
Doc Hawkins posted:"meme" is only four letters anyway. Mean Al: *gets confused about the "Me Mean Al" class, files HR complaint with lots of bad grammar* CPColin fucked around with this message at 20:48 on Dec 8, 2017 |
# ? Dec 8, 2017 20:45 |
|
I just got handed a project that got the author a promotion. Of course after I get it, it starts to bog down the system. I find he was using 6 stored functions for each insert statement. Each function did aggregate functions that could have done with computed columns or subqueries. Each insert using the functions took 3 seconds. Given that I have over 50 iot devices polling ever minute. That leads to a big slow down.
|
# ? Dec 9, 2017 02:43 |
|
Turns out promoting people based on launching projects rather than sustaining a project's growth is the real coding horror.
|
# ? Dec 9, 2017 09:07 |
|
joebuddah posted:I just got handed a project that got the author a promotion. Of course after I get it, it starts to bog down the system. 50 iot devices per minute??? Better switch to Kafka/Spark because you have a case of the Big Data™
|
# ? Dec 9, 2017 09:40 |
|
|
# ? May 30, 2024 17:11 |
|
Suspicious Dish posted:50 iot devices per minute??? Better switch to Kafka/Spark because you have a case of the Big Data™ You misspelled MongoDB.
|
# ? Dec 9, 2017 11:50 |