• 12 Posts
  • 60 Comments
Joined 1 year ago
cake
Cake day: July 19th, 2023

help-circle








  • I am curious if it is viable to do it just pure JS or if I really need to learn some popular frameworks/libraries. I have no idea where this resistance comes from, guessing it’s perhaps because “oh wow a whole framework” seems more intimidating than “learn to fix your code in a language you already know a little bit”, as someone unfamiliar with frameworks. I should probably learn them anyways.

    I do have some of the code commented but I also recently found according to https://refactoring.guru that this is bad?

    Final thing: most resources I am aware of are for cleaning up object-oriented stuff. Wondering about resources for cleaning up non-object-oriented stuff and when I should and should not be doing object-oriented stuff, seeing as I did not write this raw JS object-oriented. (Yes, I know you can still kind of imitate some of the design patterns anyways, just curious.)

    Also need to find out if if’s okay to have the same thing appear twice in the HTML and how to put that in a constant if not, or if it would be better to programmatically generate it because a lot of it is pretty repetitive and the same string everywhere (except for the name attribute sometimes).

    Again, thank you so much for your advice! I’ll definitely be checking these resources.



  • It is JavaScript!

    I wanted to say just thank you so much for your feedback and help, I really appreciate it. I’ll probably try to handle it as an array until final display to the user (tbh probably just me), where the commas and spaces will be used because that’s how English works and seeing an output of stringOne,stringTwo,stringThree without the space would just irritate me a lot.

    I am aware of unit testing and know I should use it. I also didn’t use any frameworks and I’m not sure what I should use to test it when I didn’t use Node.js or React or anything like that (not sure if “framework” is the right word). My only knowledge of them is that sometimes when I fork other peoples’ projects I have to do stuff like npm install and npm run build and I have a vague overview idea of what those commands do (install dependencies, compile the stuff and run it). What I actually did to test things was just using the website. I let it go because it is small, under 200 lines of code, and probably will not expand very much.

    Specifically the actual JS never has the string written down! I grab it from the HTML. Where it does show up several times: the element’s name, ID (wonder if I can just wipe it out of the name), often its value, and in the element’s label in the for attribute. Not sure what best practice is here.


  • I actually wrote it just once. It acquired the space like this:

    I concatenate a bunch of strings together, and add a comma and space between them so I could get stringOne, stringTwo, stringThree etc. I later need to decompose that. I remembered I separated stuff with a comma, but forgot about the space following the comma and that is how I ended up having to deal with " NameHere" vs “NameHere” without having actually written NameHere several times in my code. Is there a better way to go about this?

    I have also just read my post again and it explicitly contradicts “I actually wrote it just once”. Not sure if I did write it multiple times and merely forgot as I typed this comment and claimed to write it just once, or if I just pretended I wrote it multiple times when it was only once so I could simplify explaining my problem. For the purpose of my question though, let us pretend I did write it once. I promise I am aware that strings that are frequently used should be made constant, although I could use more specifics on what “frequently used” is (more than once?) and I’m wondering if you actually should not really use strings at all and always go for constants.





  • However, as I discovered to my cost, TiddlyWiki has never had a strong “start here,” because it is not tailored to one specific task. Obsidian, by comparison, has the advantage of a clear vision of what it does. TiddlyWiki bewilders you with options at first because it hasn’t been designed to be sold. The community focus is on adapting it to different use cases.

    So I’m going to take the advice in this explainer and use TiddlyDesktop while mentioning that there are plenty of other arrangements. It is, after all, just HTML and JavaScript. Let’s get started…

    You wrote this part twice in your post.

    Cool tool though!


  • Name would not be enough to stop me from using it but TiddlyWiki absolutely sounds stupid. It’s probably a play off “tiddlywinks” but that also sounds stupid. It’s something I’d cringe saying. I might unabashedly type out my recommendation with the name to a friend or send a link to it, but would try to dodge saying the name in an in-person conversation.

    This hurts spread. One of the primary ways I find new software is by word of mouth from friends in-person (somehow I have an easier time ignoring or brushing off suggestions that are texted to me, and I take ones made in-person more seriously. I have no idea why), and I usually end up sticking with whatever they recommended.





  • The trouble with this is where do you draw the line? What you say is totally true and makes sense sometimes. The question is when is it actually that situation? I can imagine two situations:

    • one where the disliked opinion is “the Nazis were right”, and where the kicked person will probably argue back with

    opposite of their own CoC terms such as tactful, respectful, safe and inclusive. Instead the opinions they don’t like are weaponized using the other negative terms they list such as anti-social, unhelpful, trolling, controversial etc.

    as a way to try to legitimize their position, express their negative feelings at being excluded (because even if you’re a bad person, being excluded feels bad), and make the ban look to others like “oh, just a power-trip by bad management” and totally unjustified. Note that they might legitimately believe it is unjustified, that they probably are not twirling a mustache thinking in strategic terms of “how can I legitimize my position” and are just expressing their hurt feelings—but those are the things that happen when you make that argument.

    • one where the disliked opinion is “I don’t like dogs”, which absolutely does not warrant a kick except maybe in a panel of judges of a dog competition or something, where the part I quoted is a good representation of the situation—people are being intolerant when they should not be, the kicked person’s grievance is legitimate, and there might be a case of just personal dislike or power-tripping affecting the decision. When they argue with

    opposite of their own CoC terms such as tactful, respectful, safe and inclusive. Instead the opinions they don’t like are weaponized using the other negative terms they list such as anti-social, unhelpful, trolling, controversial etc.

    it is actually probably valid.

    There are some actions/opinions where the view on whether it is the former situation or the latter situation is… controversial/unclear. I always wonder what happens when it is that kind of situation and how to deal with it.