• 5 Posts
  • 73 Comments
Joined 1 year ago
cake
Cake day: June 1st, 2023

help-circle


  • I didn't graduate from university.

    In order to get some more money, I decided to take a TA-position at the school.

    For context, I live in Sweden - university costs nothing to attend here, and you get access to a mix of governmental assistance and near-zero interest loans (at about 1/3 assistance 2/3 loans) to finance your living costs while attending university. To get this money you are required to get passing grades in a certain percentage of the courses you take, around 75% is required). If you do not meet these requirements, you lose your benefits, and quickly risk not being able to afford food and rent.

    This TA-position however took up more time than I thought it would, and as such, I didn't manage to pass the courses I was taking. Since I no longer met the passing grades requirement, I could no longer get student loans and assistance, meaning that I had to keep working TA gigs to stay afloat. This finally became untenable, and I decided to drop out and move to another city and look for work.

    So far, it's worked out extremely well. I've been ridiculously lucky.

















  • A few things come to mind:

    1. The array is probably fine. It's not going to be particularly large and lookups are O(1)
    2. It's a bit weird to me that you're using the char pointers as indices. I would probably use actual indices and spend the miniscule amount of additional stack data to improve the clarity of the code
    3. You could save on some indentation by returning early instead of nesting the for-loop inside the first if-statement
    4. Is the call to the lookup-table really safe? Maybe checking that the token from RNA is within the bounds is the way to go?
    5. The only thing I would even remotely care about with regards to performance is the malloc, and that's not that big of a deal anyway unless the length of dna is really large. Streaming the result or overwriting the presumably already malloc'd input would be the only thing I would touch, and only if I could prove that it improves performance in practice.
    6. (added in edit): if you can guarantee that the input is well formed, you can omit the bounds check and save some effort there.