• 0 Posts
  • 12 Comments
Joined 1 year ago
cake
Cake day: June 6th, 2023

help-circle

  • If you’re really interested…

    Let’s say you want to know how an ad has affected your sales since it was released 3 months ago.

    You could put every single sale as a dot on a graph, but it probably wouldn’t mean anything. Even if it showed the dots gradually getting higher on the chart. Was that caused by the ad or does it happen every year at the se time? What other factors could have caused this.

    So I’ll pause right there and say you will never know. You will never know all the forces that affect trends. You can get relatively close, but not. Does weather affect your sales? Delivery time? Internet sentiment?

    So that’s not very scientific, right? You need to know and control all variables to test an outcome.

    Anyway, so you have a graph with dots and it may or may not mean anything. You think, ok what was last year’s sales during these same 3 months?

    So you get last year’s data and plot the sales as dots in a different color. Now you have a graph with a ton of dots of two colors, and best case scenario: the dots for this year are higher than last year.

    Is it responsible to stop there? If it were me, and my money, I’d want to make sure. So then you’d compare data from two years ago. Now you have a chart with three colors of dots.

    Again, best case, this year is higher than that year too. However, as always is the case, the dots are getting difficult to understand, especially for people that don’t know anything about data. You need to make things simple to digest.

    So you say “I’ll make an average of each month” and that will show how the averages are getting bigger, compared to previous years. Great!

    So you average all the dots by month and plot them on a graph, and it looks great. But there are a few months that don’t prove what you saw in the raw data. For instance, one month, two years ago, you landed a big contract and sold an astronomical number of units. So that month is the biggest one of all.

    Ofuck.jpeg

    Ok, no problem, you’ll just remove those two data points, because they are skewing the day. Again, this is best case. Most of the time you will not be sure if these data points are errors in the data or Genuine sales. But anyway…

    Luckily there is a method for removing “outliers” it’s called standard deviation, and it’s basically an equation that figures out what is an acceptable outlier and what isn’t.

    Again, I’ll pause here to point out how unscientific this is. You are removing data because it doesn’t follow the trend you want to show. And this is a perfectly acceptable practice in data analytics. And I’ll point out something else, what was the affect of those contracts on your normal business sales? Did you make relatively less sales because of it? Is it responsible to completely remove those sales? Is it ethical?

    And this is all very minor stuff in analytics. The more detailed the question, the more the data is “cleansed” by equations that get progressively more complicated - the more ethically vague the data is.







  • erogenouswarzone@lemmy.mltoProgrammer Humor@lemmy.mlClassic John
    link
    fedilink
    English
    arrow-up
    0
    ·
    edit-2
    1 year ago

    Any mention of a server room reminds me of the fable of the guy, we’ll call him Mike, who unplugged the Internet.

    I can’t remember where I read it, I think it was greentext on Reddit years ago.

    So Mike is an intern, and due to some weird circumstances he becomes the only network admin in the building. Well, one day he doesn’t esnt feel like working, so on his way in, he stops by the server room and unplugs the internet.

    He then goes to his desk like a normal day. Then he starts getting phone calls. Everybody is freaking out because there is no Internet. So he begrudgingly descends into the server room and starts playing video games on his phone.

    Close to the end of the day, he plugs the Internet back in and ascends a hero to the employees because they think he’s been working hard all day to give them internet.


  • erogenouswarzone@lemmy.mltoProgrammer Humor@lemmy.mldo as i say...
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    1 year ago

    Does anyone have any good advice on variable naming? Here’s some of my rules I try to live by:

    • camelCase
    • use prefixes
    • prefixes should be one word followed by an underscore.
    • 10 character limit or 3 word limit, not counting the prefix
    • functions should be prefixed with the file in which they’re defined, ie utils_FooBar
    • file names should be one word
    • Start Bools with is
    • Don’t use not in bool names.
      • This has farther-reaching implications that will keep you from making confusing code most of the time (I’m sure this will be controversial, but it works no matter what they say)
    • start output with _
    • Globals should be g_VARIABLENAME
    • use the least amount of words possible
    • but being too verbose can draw attention - use this to aide in readability
      • calc_ImportantValueThatWillDecideTheUsersView is better than calc_SumYears if the variable is more important than the others.
    • Even the greatest variable names are not replacements for documentation
    • Even the most readable code is not replacement for documentation.
      • Force yourself to love documentation.

    Edit: I realize I was speaking about function-naming with the prefix stuff.

    For variables, I still use prefixes, but for variable type. Even if you define the variables as types, it’s still incredibly useful. For instance,

    a string is s_MyName,

    enumerable is e_MyType,

    A number is int or double or whatever i_MyAge or d_MyWeight

    This might be obvious for custom objects, but I’d still do it like this p_Person or per_Person.

    Seriously it does make a huge difference


  • Yes, but only because it gives you a link to where that was run. Click the link to the right with filename:lineNumber, and it will open the sources tab to that line. Set a breakpoint and rerun to pause there, then step through the code’s execution.

    Of course, if you’re using minified or processed code, this will be more difficult, in that case figure out how to do it in VS Code.