CodeSOD: Copied Homework

Nov. 24th, 2025 06:30 am
[syndicated profile] the_daily_wtf_feed

Posted by Remy Porter

Part of the "fun" of JavaScript is dealing with code which comes from before sensible features existed. For example, if you wanted to clone an object in JavaScript, circa 2013, that was a wheel you needed to invent for yourself, as this StackOverflow thread highlights.

There are now better options, and you'd think that people would use them. However, the only thing more "fun" than dealing with code that hasn't caught up with the times is dealing with developers who haven't, and still insist on writing their own versions of standard methods.

  const objectReplace = (oldObject, newObject) => {
    let keys = Object.keys(newObject)
    try {
      for (let key of keys) {
        oldObject[key] = newObject[key]
      }
    } catch (err) {
      console.log(err, oldObject)
    }     

    return oldObject
  }

It's worth noting that Object.entries returns an array containing both the keys and values, which would be a more sensible for this operation, but then again, if we're talking about using correct functions, Object.assign would replace this function.

There's no need to handle errors here, as nothing about this assignment should throw an exception.

The thing that really irks me about this though is that it pretends to be functional (in the programming idiom sense) by returning the newly modified value, but it's also just changing that value in place because it's a reference. So it has side effects, in a technical sense (changing the value of its input parameters) while pretending not to. Now, I probably shouldn't get too hung up on that, because that's also exactly how Object.assign behaves, but dammit, I'm going to be bothered by it anyway. If you're going to reinvent the wheel, either make one that's substantially worse, or fix the problems with the existing wheel.

In any case, the real WTF here is that this function is buried deep in a 15,000 line file, written by an offshore contract team, and there are at least 5 other versions of this function, all with slightly different names, but all basically doing the same thing, because everyone on the team is just copy/pasting until they get enough code to submit a pull request.

Our submitter wonders, "Is there a way to train an AI to not let people type this?"

No, there isn't. You can try rolling that boulder up a hill, but it'll always roll right back down. Always and forever, people are going to write bad code.

[Advertisement] Utilize BuildMaster to release your software with confidence, at the pace your business demands. Download today!
[syndicated profile] grrlpowercomic_feed

Posted by DaveB

Sometimes the page titles just come to me, and sometimes it takes me an hour to come up with something even the slightest bit relevant and is probably confusing. Guess how long this one took me. :/

Maxima could have disguised herself as a frumpy frump in a modest house coat, but she didn’t. Not assigning blame, just saying that getting hit on by a space-dragon-chef is not a completely un-predictable outcome.

The other reason Dabbler didn’t summon her vault of swords is simply there were too many to make it practical. The other page just showed the foyer. There are like 5oo melee weapons in that vault. Sure, she could have narrowed the selection to potential candidates, quite a few of them are, you know, starter weapons. If the real world had levels, they’d be the kind of stuff you’d get before level 10. Dabbler keeps them cause they’re still cool or unique or maybe have some very specific uses. There’d still be like 60 swords Max might want to give a test swing.

The background stuff in the first panel – the colored direction text says “Orgynasium,” Because, yes, this is Dabbler’s base, first and foremost. “Mass Fab 1-4,” “Petty Gold,” (like petty cash. They have a lot of gold laying around at this point, and if someone’s going to visit a planet that still uses precious metal for coins, they can stop by and grab a few bags.) Below that in yellow it says “Showers (Co-Ed)” There are non-coed showers for prudes on another floor. The next list says “Armory 6,” “Printers 13-24,” Arboretum 6,” and “Quarters 600-642.”

They’re on the 6th level, if you couldn’t tell. The symbol on the door is a Gold Molecule. That’s the Petty Gold vault. I say vault. It’s actually a closet with a lock. It’s usually not locked. There’s like 80 million in Earth bucks laying around in there. It’s alternatively sorted by material type and coin size in neat stacks, (they have some pre-minted coins for various destinations) and the other sorting option, big pile in the middle of the floor. Some people, possibly someone who might have a draconic bloodline, or maybe someone who just is a straight up dragon lurking around in a humanoid form, or maybe is a young dragon who hasn’t achieved his full feral form yet, and has a nigh-uncontrollable urge to roll around on a pile of gold and silver and platinum.

In case you were wondering, yes, Gaxgy’s head is modeled after the best Dragon Blooded head shape in Baldur’s Gate 3. I did that because I started freehanding a dragon head, then realized that the thing I drew wasn’t a shape that would… rotate correctly. It looked fine from the one angle, but it was probably a tiny bit non-euclidian. So I decided to switch to a model I could rotate for reference.

Let me tell you a little about my general design process. When I need a new design for the comic, like Maxima’s Stygan mask or whatever, I draw it for the first time on the page on which first appears, and… that’s my design process. I don’t really have a lot of time to sit and doodle. But for that reason, sometimes I discover that my initial design doesn’t quite work from every angle. So the design can sometimes drift over time as I draw them from different angles.


Kobold Sydney vote incentive! Is finally done!

So… you know, check it out. Oh, and as usual, Patreon has a scales only version.

 

 

 


Double res version will be posted over at Patreon. Feel free to contribute as much as you like.

Monday Update 11-24-25

Nov. 24th, 2025 02:16 am
ysabetwordsmith: Artwork of the wordsmith typing. (typing)
[personal profile] ysabetwordsmith
These are some posts from the later part of last week in case you missed them:
Poem: "A Sanctuary for the Homeless"
Poem: "Worthy of Love and Belonging"
Poem: "Indicative of the Extent"
Space Exploration
Birdfeeding
Bird Apocalypse
Birdfeeding
Philosophical Questions: Morals
Today's Smoothie
Science
Birdfeeding
Follow Friday 11-21-25: Knitting
Poem: "Trying to Be Better"
Poem: "Set on Continuous Improvement"
Science
Birdfeeding
Hobbies: Quilting
Self-Care
Today's Adventures
Birdfeeding
Good News

Trauma has 44 comments. Affordable Housing has 71 comments. Robotics has 99 comments.


"An Inkling of Things to Come" belongs to Polychrome: Shiv and needs $191 to be complete. Maiara and Arthur discuss taking notes.


The weather has been variable here. Seen at the birdfeeders this week: a large mixed flock of sparrows and house finches, at least 3 goldfinches, a male cardinal, and two fox squirrels.

Chapter 100: Page 55

Nov. 24th, 2025 12:00 am
[syndicated profile] gunnerkrigg_feed
Parley is NOT impressed.
-------------
Hey! The third Gunnerkrigg Court Omnibus from Dark Horse is here! As usual, there is a hardcover and a softcover available, and they are available pretty much wherever you can find them! Here's a link to a Dark Horse Page with links to retailers, and here is a link to my Topatoco store for pre-order there (it takes me a little longer to get copies sent over to them, that's all)! Anywhere you choose to buy them helps me and the comic greatly, and you know, Christmas is soon, so my recommendation is all three of the omnibus editions! I'm biased because I made them.
[syndicated profile] daily_illuminator_feed
The holidays are nearly upon us, and the offices and warehouse of Steve Jackson Games will be closed for several days around Thanksgiving, Christmas, and New Year's Day.
 
In November, we will be closed from November 27 through November 30. Shipping for orders placed on those dates will resume December 1.
 
In December and January, we will be closed December 24 through January 4. Shipping will start again on January 5.
 
For anyone who would like to place an order to be delivered in time for Christmas, we recommend ordering by midnight CST on December 18 for the best chance of on-time delivery.
 


Michelle Richardson

Warehouse 23 News: The City Never Sleeps Because Of All The Action

There are a million stories in the city, and they're all exciting! GURPS Action 9: The City shows how you can add GURPS City Stats to your GURPS Action campaigns. It also features six sample cities to use with your own action-packed adventures. Download it today from Warehouse 23!

Monday's Comic

Nov. 24th, 2025 12:16 am
marycatelli: (Default)
[personal profile] marycatelli posting in [community profile] girlgenius_lair
PROMISING

You worked for him, o Dreen. You should have taken advantage of the observation opportunities.

Poem: "A Sanctuary for the Homeless"

Nov. 23rd, 2025 10:58 pm
ysabetwordsmith: Damask smiling over their shoulder (polychrome)
[personal profile] ysabetwordsmith
This poem is spillover from the February 4, 2025 Poetry Fishbowl. It was inspired by prompts from [personal profile] dialecticdreamer, [personal profile] kellan_the_tabby, [personal profile] rix_scaedu, and [personal profile] alchemicink. It also fills the "changes over time" square in my 2-1-25 card for the Valentines Bingo fest. This poem has been sponsored by a pool with [personal profile] fuzzyred and [personal profile] librarygeek. It belongs to the Big One thread of the Polychrome Heroics series. It follows "When You're Lost, You Question Everything," so read that first or this won't make much sense.

Read more... )

Poem: "Worthy of Love and Belonging"

Nov. 23rd, 2025 09:02 pm
ysabetwordsmith: Damask smiling over their shoulder (polychrome)
[personal profile] ysabetwordsmith
This poem is spillover from the June 3, 2025 Poetry Fishbowl. It was inspired by a prompt from [personal profile] rix_scaedu. It also fills the "Belonging" square in my 6-2-25 card for the Pride Fest Bingo. This poem has been sponsored by a pool with [personal profile] fuzzyred and [personal profile] librarygeek. It belongs to the Big One thread of the Polychrome Heroics series.

Read more... )
dialecticdreamer: My work (Default)
[personal profile] dialecticdreamer
A Change of Plans
By Dialecticdreamer/Sarah Williams
Part 1 of 1, complete
Word count (story only): 1400


:: While getting ready for a much-anticipated dinner out with friends, Rosemary has to change plans due to a broken temporary crown. Instead of canceling, her friends adapt the evening. Original fiction, the story was written from a prompt by [personal profile] librarygeek, with my great thanks. ::




A sharp release of pressure in her mouth made Rosemary Landon freeze. “Sonofa--” she began, but the words were mumbled around the pieces of her temporary crown. As soon as she inhaled, the pain washed over her the inside of her mouth like a wave. She groaned as her watch chimed.

Spitting the two pieces of the temporary crown and the sliver of tooth from the trimmed edge into her palm, she checked the clock on the stove, then let out a deep sigh. Quickly, she scrolled through the contacts to call her dentist.
Read more... )

Poem: "Indicative of the Extent"

Nov. 23rd, 2025 07:49 pm
ysabetwordsmith: Damask smiling over their shoulder (polychrome)
[personal profile] ysabetwordsmith
This poem is spillover from the July 15, 2025 Poetry Fishbowl. It was inspired by a prompt from [personal profile] librarygeek. It also fills the "WILD CARD: Clean Up the Town" square in my 7-1-25 card for the Western Bingo fest. This poem has been sponsored by a pool with [personal profile] fuzzyred and [personal profile] librarygeek. It belongs to the Big One thread of the Polychrome Heroics series. It follows "The Choices Humans Make" so read that first or this won't make much sense.

Read more... )

Space Exploration

Nov. 23rd, 2025 07:48 pm
ysabetwordsmith: Cartoon of me in Wordsmith persona (Default)
[personal profile] ysabetwordsmith
Nearby super-Earth emerges as a top target in the search for life

Researchers found that the planet may have liquid water on its surface – a necessary ingredient for life.

Researchers have pinpointed a super-Earth in the habitable zone of a nearby M-dwarf star only 18 light-years away. Sophisticated instruments detected the planet’s gentle tug on its star, hinting at a rocky world that could hold liquid water. Future mega-telescopes may be able to directly image it—something impossible today
.


This is so awesome. :D

Birdfeeding

Nov. 23rd, 2025 02:47 pm
ysabetwordsmith: Cartoon of me in Wordsmith persona (Default)
[personal profile] ysabetwordsmith
Today is partly sunny and cool, a beautiful fall day.

I fed the birds.  I've seen several sparrows and house finches plus at least 3 goldfinches.

I put out water for the birds.

EDIT 11/23/25 -- We spent an exasperating amount of time trying to set up for chipping the brush pile from the parking lot.

EDIT 11/23/25 -- We spent a bunch more time hassling around with the chipper.  We did get it going!  It produces quite small shreds.  They land right under the chipper.  We figure that putting a tarp underneath will be the best way to move the chips to an actual pile.  Hopefully tomorrow the weather will be clement enough to do actual chipping.

I am done for the night.

November 2025

S M T W T F S
      1
23456 78
9101112131415
16171819202122
23242526272829
30      

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Nov. 24th, 2025 02:07 pm
Powered by Dreamwidth Studios