8

Javascript's splice(). The definition of splice doesnt even relate to what the function does

Comments
  • 1
    Yeah that always bothered me.... maybe there's more of a CS kinda reason for that name? Or it's just plain dumb.
  • 1
    I have used splice before. Went to insert into an array. Couldn't remember the stupid name. Oh fuck! Its splice...
  • 5
    It's a strange conjugate of split and slice.
  • 6
    @SortOfTested I'll create a framework with a method addition() that returns the ADDress posITION
  • 2
    @shoogknight
    That's honestly not even the most offensive thing about js arrays 🤣
  • 2
    @SortOfTested I work with JS in apps that combines JS (front) and C++ (back). The more I work with JS the more I "Push that shit to the backend to do it right!"
  • 1
    @Demolishun
    The front end should only be concerned with presentation concerns and user interaction.

    The backend should only be concerned with business logic and security.

    Separate those concerns.
  • 1
    @SortOfTested I have. The problem is there are some front end tasks that get complicated enough that it is much better to manipulate on the C++ side. So I guess I was not clear. The JS calls functions that are purely front end related in C++. Our data models are separate from this.
  • 2
    @Demolishun
    Ah, cool. I've done similar with wasm and rust. I don't generally do disconnected applications anymore, so I don't have a lot of cases where the ideal location for that logic isn't an API. Were I producing that kind of application, I'd eschew JS altogether, it's kind of a shitshow.
  • 2
    @shoogknight

    Right up there with my toAllCaps() NPM package!
  • 2
    @Demolishun I actually really like javascript as a language
  • 0
    Don’t use splice
  • 1
    Hahah right!
  • 1
    It's about as weird as that Splice movie.
  • 1
    @shoogknight That was funny, must say
Add Comment