17 votes

What are some of the "tricks of your trade"?

  • What are some of the clever, ingenious, or potentially even shameful shortcuts or workarounds that exist in your field (or that you know of from others)?

  • What problem or hassle do they alleviate/make easier?

  • Is the trick always worth it, or are there significant tradeoffs you have to take into account?

10 comments

  1. [4]
    skybrian
    Link
    Sometimes a good way to learn a song from sheet music is from back to front. Start by playing the last measure slowly, then gradually increase speed as long as you are still playing it right. Then...

    Sometimes a good way to learn a song from sheet music is from back to front. Start by playing the last measure slowly, then gradually increase speed as long as you are still playing it right. Then go back one measure and play from there (slowly at first). As a result, the first measure you play will be the hardest and after that it will get easier since you already learned it.

    Note that you do need to "look ahead" (that is, at the previous measure) to figure out which fingering you will want to learn, and use consistent fingering. Also, you should have the song "in your head" when you do this, by listening to it first.

    For really difficult parts, you can even break it down further, adding one note a time to the beginning.

    7 votes
    1. [2]
      Omnicrola
      Link Parent
      This is very interesting, especially as someone who is not musically... well anything. Now I'm going to ponder how I can adapt this to learning or building other things.

      This is very interesting, especially as someone who is not musically... well anything. Now I'm going to ponder how I can adapt this to learning or building other things.

      4 votes
      1. Weldawadyathink
        Link Parent
        I was in a choir for a bit. I never used this method, but it sounds good. A song is an expression of emotion, and the end is the final statement of that emotion. Thus, working from the end back is...

        I was in a choir for a bit. I never used this method, but it sounds good.

        A song is an expression of emotion, and the end is the final statement of that emotion. Thus, working from the end back is the same as working from a goal to get to your current location. The moral at the end of a fable must have the rest of the fable to support it. Without the story, the moral holds no weight. The same is true for (most) songs, and many other things in life. Find out what the goal is, and then find out what needs to happen to get there.

        3 votes
    2. rogue_cricket
      Link Parent
      My piano teacher taught me this trick ages ago! Sometimes when you're on a part that you're less confident with, a future bar that you have down pat is like an upcoming landing pad.

      My piano teacher taught me this trick ages ago! Sometimes when you're on a part that you're less confident with, a future bar that you have down pat is like an upcoming landing pad.

      3 votes
  2. [2]
    sigma
    Link
    Every trick of the trade you need in C++/Assembly for speed is covered by some random dude in Denmark for free, whose documentation on CPU architecture is allegedly better and more accurate than...

    Every trick of the trade you need in C++/Assembly for speed is covered by some random dude in Denmark for free, whose documentation on CPU architecture is allegedly better and more accurate than the internal docs at Intel

    7 votes
    1. [2]
      Comment deleted by author
      Link Parent
      1. sigma
        Link Parent
        Agner Fog's site. Everyone who does anything very high performance comes across it eventually. What every programmer should know about memory is also great, but out dated

        Agner Fog's site. Everyone who does anything very high performance comes across it eventually. What every programmer should know about memory is also great, but out dated

        5 votes
  3. monarda
    Link
    I've worked in the dirt most of my life, often without gloves so I can do more delicate work. I love showing people this trick: If you get snail slime on your fingers, make mud and wash your hands...

    I've worked in the dirt most of my life, often without gloves so I can do more delicate work. I love showing people this trick: If you get snail slime on your fingers, make mud and wash your hands in it (don't use soap, just the mud). The slug slime will come right off.

    7 votes
  4. vord
    Link
    I'm going to share with y'all the secrets to highly performant SQL queries. Self-taught wizardry from over a decade of fixing performance issues at 3 AM in production databases after developers go...

    I'm going to share with y'all the secrets to highly performant SQL queries. Self-taught wizardry from over a decade of fixing performance issues at 3 AM in production databases after developers go live with code without ever consulting a DBA. As such, this is coming off a bit rantier than I originally intended. SQL is comparable to regex in a lot of ways...it's a bit of a dark art if you're not doing it all the time.

    1. Know your data. The ways you join tables together matters a lot. Indexes are useful, but too many kills write performance, and if they're not well written, will use up disk space for no reason.
    2. Use full join syntax (left join, inner join, etc). It makes it easier to understand how your query is working and makes it easier to debug and optimize.
    3. Explain plans are your best friend. They can tell you exactly where your query is having issues, before you ever run it.
    4. Stop using dynamic SQL. It is hard to optimize, and often leads to SQL Injection vulnerabilities.
    5. Use bind variables, especially if your query runs more than 1 time a day. Avoid hard coding values into queries at all costs.
    6. Database links should be reserved for very special use cases and only with DBA involvement. If you don't know what those cases are, odds are your app isn't one of them. There are often far better methods.
    7. Cartesian merges are one of the worst things you can possibly do to a database. Most often they are a result of a logic bug in a query. If it is intentional, think long and hard about why and if you can fix your data model to avoid it.
    8. There is no silver bullet technique for writing SQL. SQL is a complex, nuanced language because it is data-driven. Techniques used for 1 query can and will yield tremendously different results for another. That said, the RANK function is super useful for a ton of use cases, and many people are unaware of it.

    I tried to think of two more offhand for a solid 'top ten' list, but I am tired. Go forth and query.

    6 votes
  5. [2]
    Icarus
    Link
    In Excel, if you have a column of numbers that are formatted as text, Excel will surely give you a prompt to convert this into numerical. Following this prompt can sometimes take a while to...

    In Excel, if you have a column of numbers that are formatted as text, Excel will surely give you a prompt to convert this into numerical. Following this prompt can sometimes take a while to convert each cell, one by one. Instead you can use text to columns. Highlight the column, select text to columns, then cancel, and presto your column is now instantly reformatted to numerical.

    4 votes
    1. sigma
      Link Parent
      If you need to do a convex optimization problem and need a proof of feasibility or just an idea of how your data works, Excel's built in conic solver is the single best engineered feature in all...

      If you need to do a convex optimization problem and need a proof of feasibility or just an idea of how your data works, Excel's built in conic solver is the single best engineered feature in all of Excel and it alone is worth the retail license for Excel

      3 votes