2
yabbat
6y

At the beginning of a master course at my university the students need to do a little task to ensure they know fundamentals about programming. 70% fails the test. They had no Internet access but a reference card for c, c++, Java & python. Is this really that hard?

Comments
  • 0
    Masters as in you need your BSC to even attempt to enroll? If so then no.
  • 4
    @schug
    Students be like:
    My first day at a desk of a huge badass company.
    *sweats*
    Oh boii. Shit got real.
    Ok.... H e l l o W o r l d...
    Compiles......
    Compiler ERROR!

    Oh. Ok. I'm out.
    Time to get a fancy coffee and impress ppl with high end study talking, even I don't understand anymore.

    Hopefully, the boss sticks me under his sweaty armpits and take me to the magic heights where you open up your arms and catch the money flying from the ceiling which is soaked with the tears of employees with their broken dreams of private property!

    There is a lotta sweat going on.

    xD
  • 0
    @forE Master of communication and networks and yes you need your bachelor to enroll. Seems that having a bachelor in some MINT related topic is enough to enroll.
  • 0
    Well, considering that this task requires a program capable of outputting irrational and transcendental numbers, I would say not only that it's hard: it's impossible
  • 1
    That's actually a nice test. While it's trivial to implement what's demanded, it has the potential to even trip up more experienced developers with regard to the loop with the 0.01 increment.
  • 0
    @Fast-Nop yeah, 0.01: a number that cannot be even represented as a floating point number with a finite number of binary digits

    The professors who thought of such an exercise clearly have no idea what they're teaching.
  • 0
    @stacked or they have, and they want to test whether the students avoid choosing a floating point type as loop variable.
  • 0
    @Fast-Nop whether you choose 0.01 as a step or choose to do the division later, it doesn't matter: sin(2πft) is irrational, except for when 2ft=1/6, 1/2, 1, ...

    Sorry if I put too much energy into this, but in my experience I've seen too many people failing to understand the concept of approximation. I've been in too many situation where error propagation screwed up results and certain programmers were even surprised about that! Now I know why: fucking universities.
  • 0
    @stacked It does matter because with a float as loop variable, the error is in every single addition of the loop variable, and it becomes already interesting with the loop termination condition.
  • 0
    @Fast-Nop man, it's impossible to solve this exercise without errors
  • 0
    @stacked I know. But numerics not about having errors or not having errors, it's about minimising errors. In this case, using an integer loop variable, casting it to floating point and dividing by 100.0 is a better solution that using a floating point loop variable and incrementing by 0.01.
  • 0
    @Fast-Nop you touched exactly the problem that I keep encountering with certain engineers: "better" and "worse" are meaningless words. Saying that a bridge that can hold 2kg is better than one that can hold 1kg doesn't mean anything if you want to make cars pass through it: it will still collapse.

    What matters is to *evaluate* the error: saying that a formula has a worst-case error of 5% does have some meaning, because this information can be used to decide whether the solution is acceptable or not.

    Also, doing many small improvements is often useless and a complete waste of time. Different approaches are needed instead. In this particular case, Taylor sums might do the job. Or a truncated continued fraction. Or maybe, depending on the context, a Fourier tranform could be the perfect fit.

    Point is: people should think about the problem they're dealing with and understand it throughly. It's a shame that a university deals with such common misconceptions so lightly.
  • 0
    @Fast-Nop it's pretty much the same with performance of programs: you can do many small improvements to make your program faster, but in many cases those improvements won't get you anywhere. You need to change your algorithm (insertion sort vs quicksort), or change architecture (centralized vs distributed), or change hardware (cpu vs gpu), or rethink and change approach completely (specialized system vs machine learning).

    And here, like before, "better" and "worse" don't have meaning. You need timings and notations like big-O.
  • 0
    @stacked considering the time I'd need to evaluate the additional error induced by 0.01 increments, I'd be much faster just using a solution that doesn't have that issue. Time is money.

    MISRA-C has rule 13.4 to make sure that people either don't do that or are forced to invest more time to prove that it's not an issue. SEI CERT-C has that also, that's rule FLP30-C. Means, this issue is wide-spread enough that it's a known anti-pattern.

    Also, it's a test, and someone just implementing it with 0.01 increments shows no consideration of the underlying issue. Which means, depending on the level of experience expected, the result could be "test failed".
  • 0
    Exactly the same thing happened at my university. Simply, many students are not really prepared. My friend https://mobygames.com/user/sheet/... told me that at his college it was the same. Many guys copied the code templates and that’s it, they didn't have any skills. And he always did all the essays and assignments himself.
  • 0
Add Comment