Holy Crap. Am I in the Overlook Maze?

It’s been so long since I switched this project from Python to JavaScript, I’d forgotten why.

On Oct 24, 2016 — over three months ago — I gave up on doing it in Python because–wait for it–I couldn’t get the Track Popularity to work!

I wanted to … have a list of albums showing their popularity and the songs showing their popularity but, for some reason, I can’t get my Python code to get the track objects containing the track popularity. I can do it if that function is it’s own thing but as soon as I make it part of a loop it won’t work anymore.

The exact same problem, as it turns out, that I’m having with JavaScript!

That tells me something … and I wish I knew what that something was.

[insert vulgar exclamation here]

I thought what was an elusive bug in Python, because of my inexperience, would be obvious and easy in JavaScript.

Ugh! What am I missing?!

Maybe I should rethink how and why I’m doing this … is there an easier better way? Even if there is, I want to solve this problem! I have to. There has GOT to be a way to do this. I simply can’t believe that isn’t true.

Update: Okay, I’ve identified the actual last working script, which isn’t the one(s) I’ve been trying to “fix.” It wasn’t v4 or v5 of either … nevermind … it’s pseudo_10d (github). Maybe those others were based on it at some point — I honestly can’t remember.

But it only logs everything to the console. It works, but it’s just logs. My goal is to get it all into a neat little object. The reason for that is I think that’s the easiest and best way to then put all this data into my MySQL database. Is that the easiest and best way? Here’s the deal … here’s what I’m doing …

  1. Get json from Spotify
    • Artist Info
    • Artist’s Albums
    • Several Albums
    • Several Tracks
  2. Get data from those json requests and organize it in a javascript object that looks like the json spotify sends (but I have to make at least two “several album” requests and multiple “several tracks” requests to get each piece of data I want because some requests get small album or track objects which I then use to request large album or track objects … if spotify included popularity in the default small album and track objects NONE of this would be an issue and I’d have been done months ago).
  3. Put that data into a database

What I’m wondering is if I need to have three steps … maybe I don’t have to store and organize any of it in an object … maybe I can just shove it straight into the database. I’m sure that’s possible … certainly not elegant … and, after I initially build all the tables for artists, albums, and tracks, I don’t need to worry about it, but … dammit, I want this tiny little problem solved before I move forward with those other ideas.

TL;DR even if it is possible to do this more easily, I want to solve this problem.

Now I’m wrestling with … do I start trying to make 10d build the object? Or did I already do that and that’s how I made the messes I’ve been drowning in?

Wait, yeah … okay … here’s my hesitation … all along … and maybe it’s unfounded … I can only base decisions on what I know … perhaps I should have tried what I’m about to say a long time ago …

I keep being, I think, too judgmental and hard on myself about my code … it’s not elegant enough … other’s will say, “What the f**k did you do it THIS way for?” and then laugh me out of the building back into the newbie ghetto.

Screw it. I need it to work. I’m sure that’s what they at real jobs, right? I just have this idealized image of how people work and think at “real jobs.” I’m so used to working with lazy, apathetic … I don’t want to be seen like that … as someone who says/thinks “this is good enough” and doesn’t strive for excellence and awesomeness. When I finally get a coding interview, I want them to say, “Holy f**k! We’d better grab this guy before somebody else does!” instead of … making me feel stupid for even trying.


About jotascript

Aiming to please. Seeking to impress.
This entry was posted in Frustration, myProjects, Uncategorized. Bookmark the permalink.

One Response to Holy Crap. Am I in the Overlook Maze?

  1. codeinfig says:

    oh, youre using objects!

    id just use an array. i do everything in arrays. ive always used arrays. theres probably a better way, and if it works, thats good too 🙂

    im not entirely against objects. theyre overcomplicated, sometimes its like killing a fly by running it over with a truck, but hey it works. and when you need it– well, its there!

    except when the fly gets away… then i would say use a fly-swatter. but theyre not very stylish, i guess 😐

    Liked by 1 person

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s