• 9 Posts
  • 58 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.








  • I think that would be a great situation to be in.

    You have created a cool thing a lot of people use, by being good at something. You’ve done something.

    Also, people have no idea who you are. Nobody is digging through your trash, harassing the people you love, taking pictures of you wherever you go including on your bad hair days, etc. You’re just some guy.





  • This is a very good comment for me because I usually hate tutorial videos with a passion. It’s better with transcripts now, but it’s still harder to CTRL+F a video for what I want. And like most human beings, I read faster than people talk in videos. I definitely have already been convinced as to how unsuitable videos are for me personally. I am glad they exist for people who can learn better that way, knowledge transmission is knowledge transmission, it’s good that the creators made them to help people learn! But I’ll spend an hour searching for articles and failing to find any before I give in and turn to the video that was the first result.

    Do you have any book recommendations?



  • Privacy paranoia, after seeing someone get doxxed and part of the process was “hmm, these accounts all express interest in the same specific things”. If two accounts express interest in programming, they are probably not owned by the same person. Programming and swimming, still probably not be the same. Programming and swimming and winemaking and [insert 7 more hobbies here]? A lot more likely to be owned by the same person.

    Yes, I am a little nobody. Unfortunately, some nobodies have had people stalk their comment history during a disagreement and send harassing messages, or have had to get a restraining order against a crazy ex—does not take being a celebrity to want to be careful and wall off information about me and what I’m doing in case I get one of those types in the future trying to find me. And it makes me feel safer and doesn’t add much extra friction to my life.

    I have expressed this sentiment before which I worry could be identifying (really, I should worry more about what else I’m leaking: smart enough to not say “Jane Smith from 842 Street” but reading my comment history might still give away more than I want) and I regret the fact human courtesy and a niggling worry you are judging me (come on, you’re an online stranger, I should not even care) is convincing me to reply, especially since I am worried you’ll just say my worries are unfounded and my reason is stupid and bad, but in a more polite manner. I tend towards wanting to explain the why of why I do things but purposely left out the explanation this time for that reason, until you specifically asked for it.

    I could maybe understand someone arguing "I don’t want to be connected with only one instance, to avoid putting all my social presence in one basket, but then this is still not about identity anymore, because we could do that by using different “generic” instances.

    Is it about keeping different personas? Having different styles of writing and interacting with others based on the audience? I could understand that, but it feels a bit weird, as if we are not allowed to be ourselves.

    I don’t want to be myself, Jane Smith from 842 Street, age 32, with a specific social presence and identity online. I want to be another anonymous person in the void. Of course, I do realize I do technically have a presence, my username and post and comment history, I am not fully anonymous. I guess I want to be closer to anonymous than a specific person with a specific social presence, or at least I want to have my social presence segregated from Jane Smith. I don’t mind if people notice I tend to contribute to X community or make Y kind of comment, if they recognize my username. I do mind if people go explicitly digging to try to figure out that I am Jane Smith. Some people might and this is part of how I try to deal with it.