|
senrath posted:As long as they knew ahead of time that they'd be graded on speed I don't think it is. If the assignment explicitly said it needed to run quickly then an inefficient implementation doesn't meet what was required. Nah, a zero for the code being too slow is just bad pedagogy. This is an academic exercise, not a programming competition. Relying 100% on the autograder (and then farming out giving feedback on the actual code to the other students in the course instead of giving it yourself) sounds like a incredibly lazy prof.
|
# ? Dec 9, 2023 23:33 |
|
|
# ? Jun 8, 2024 06:20 |
|
ExcessBLarg! posted:As the rest of the thread is kind of beating around, it's interesting to me that this course uses C++ as the language of instruction. Most schools switched to Java or C# some 20 years ago, because even back then C++ was a language with a lot of legacy and baggage, and the nuances of C++ aren't easy for a novice to decipher and, simultaneously, distract from the actual learning of data structures and algorithms. Back then, I think that made sense. But today it feels like Java has just as much baggage as C++ did back then. If you're going to choose a compiled language for course instruction I think C++ would be the better choice today
|
# ? Dec 9, 2023 23:34 |
|
Teach 101 using Motorola 68000 assembly, imo
|
# ? Dec 10, 2023 00:27 |
|
If you're not learning assembly then why even bother learning anything at all? /s
|
# ? Dec 10, 2023 00:51 |
|
Hammerite posted:could this fellow student have gone to the professor or to teaching assistants to get feedback and help on why their code ran so slow? the op refers to "peer feedback". That's all very well, but shouldn't the student be able to get help from the people actually teaching the course? Something seems a bit lacking, but it's possible I misunderstand (perhaps for example it is a case where they can't provide specific help on the exercise until after the deadline for submission, because it's part of the assessment for the course) Actually no. ”does this make sense” or “what would be a good choice when implementing X” are very forbidden questions. “Why is this so slow”.. haha, they always say you have to figure it out yourself. If something literally doesn’t work they might give some advice, after a while. Never got any answers from course personnel, I have tried. They’re all like “we have taught the theory, now it is your task to apply it in practice”. So if you did not understand something, too bad! Peer review is feedback we have I give to other students after the project deadline has passed. That plus automated testers save course personnel’s time.
|
# ? Dec 10, 2023 02:47 |
|
First you should learn goto statements, then you should learn why you should never use goto statements
|
# ? Dec 10, 2023 02:47 |
|
ExcessBLarg! posted:As the rest of the thread is kind of beating around, it's interesting to me that this course uses C++ as the language of instruction. Most schools switched to Java or C# some 20 years ago, because even back then C++ was a language with a lot of legacy and baggage, and the nuances of C++ aren't easy for a novice to decipher and, simultaneously, distract from the actual learning of data structures and algorithms. It's a data structures and algorithms course. Understanding the difference between a linear scan and a hashmap/etc lookup and when you'd use one over the other is precisely what they're being graded on. That's probably the best subject matter to have runtime-based tests for since if someone's time complexity is higher than it ought to be it's easy to blow it up. Also how would you teach stuff like trees and linked lists in a 'friendly' language without pointers like java or python? Ihmemies posted:Actually no. ”does this make sense” or “what would be a good choice when implementing X” are very forbidden questions. “Why is this so slow”.. haha, they always say you have to figure it out yourself. If something literally doesn’t work they might give some advice, after a while. This part really sucks though. I understand not giving students the answers but they should point em to profiling tools or something RPATDO_LAMD fucked around with this message at 03:21 on Dec 10, 2023 |
# ? Dec 10, 2023 03:17 |
|
ultrafilter posted:This doesn't seem to be a particularly well-designed course. Jabor posted:Nah, a zero for the code being too slow is just bad pedagogy. This is an academic exercise, not a programming competition. Yes, he did say that it was a university course. This sounds about right for that. The professor would never lower themselves to actually look at any student classwork, that's what they have TAs and grad students for.
|
# ? Dec 10, 2023 03:27 |
|
I took an algorithms and data structures course with an assignment pretty similar to that one (maybe the same school as OP? I'm not sure but probably not ). While we were only operating on relatively bite-sized blobs of data (say, a spellchecker program), I don't think my professor would have failed us for slow code. The point was more to understand how to use the map interface and iterators than getting the perfect O(n log n) runtime. My school also used C++ for CS courses and only touched fairly briefly on Java. A friend who was pursuing a graduate degree in CS in another school thought that was odd, since C++ is relatively 'old hat' these days (now Java is relatively 'old hat' in comparison to Python).
|
# ? Dec 10, 2023 03:35 |
|
RPATDO_LAMD posted:Also how would you teach stuff like trees and linked lists in a 'friendly' language without pointers like java or python? code:
|
# ? Dec 10, 2023 04:28 |
|
F_Shit_Fitzgerald posted:I took an algorithms and data structures course with an assignment pretty similar to that one (maybe the same school as OP? I'm not sure but probably not ). While we were only operating on relatively bite-sized blobs of data (say, a spellchecker program), I don't think my professor would have failed us for slow code. The point was more to understand how to use the map interface and iterators than getting the perfect O(n log n) runtime. If every assignment in an algorithms course can be completed by just writing the dumbest slowest poo poo then what's the point in taking an algorithms course
|
# ? Dec 10, 2023 04:33 |
|
CPColin posted:Teach 101 using Motorola 68000 assembly, imo Z80 IMO, but yeah
|
# ? Dec 10, 2023 05:39 |
|
RPATDO_LAMD posted:Also how would you teach stuff like trees and linked lists in a 'friendly' language without pointers like java or python?
|
# ? Dec 10, 2023 06:19 |
|
ExcessBLarg! posted:Both Java and Python use object references when assigning non-primitives.
|
# ? Dec 10, 2023 07:21 |
|
Foxfire_ posted:Which are just pointers with better branding and syntax that removes a few footguns ok?
|
# ? Dec 10, 2023 07:38 |
|
The syntax is a lot worse when it doesn't differentiate between reference and value types like that imo. But C++ has the same sin with its own references.
|
# ? Dec 10, 2023 07:40 |
|
Why would you need to distinguish when literally everything is a reference? Take your criticism to C# where it's actually warranted.
|
# ? Dec 10, 2023 08:29 |
|
Or use Rust, like pro’s do. There it is clear if variables are mutable or immutable, variable lifetimes, cloning, references, borrowing etc… with some other languages all that is just a big mystery.
|
# ? Dec 10, 2023 09:52 |
|
Plorkyeran posted:I think Stepanov's decision to make iterators the primitive data structure instead of ranges has proven to be the biggest mistake. You don't lose any generality with ranges and it makes many things infinitely less clunky. Dunno, I have been using v3 ranges for a while and I am not particularly impressed. Yes, it is harder to misuse them (for some cases, in other cases we get views::filter), but the compile times are awful and the resulting codegen is often not great.
|
# ? Dec 10, 2023 12:07 |
|
Re performance testing: I think that's perfectly fine for some courses. You probably don't want to do it in "how to program 101", but when you are doing algo course and are talking about hashing, why shouldn't you fail students who are doing linear scan of the hash maps?
|
# ? Dec 10, 2023 12:09 |
|
Ihmemies posted:Actually no. ”does this make sense” or “what would be a good choice when implementing X” are very forbidden questions. “Why is this so slow”.. haha, they always say you have to figure it out yourself. If something literally doesn’t work they might give some advice, after a while. What the hell? this sounds like a terrible way to teach anything at all. is this sort of approach common on computer science/software courses? (I work as a professional software developer but my degree is in maths and stats)
|
# ? Dec 10, 2023 12:48 |
|
RPATDO_LAMD posted:Also how would you teach stuff like trees and linked lists in a 'friendly' language without pointers like java or python? Possibly java.util.LinkedList and java.util.TreeMap might contain some hints
|
# ? Dec 10, 2023 12:57 |
|
QuarkJets posted:If every assignment in an algorithms course can be completed by just writing the dumbest slowest poo poo then what's the point in taking an algorithms course True.
|
# ? Dec 10, 2023 13:50 |
|
GABA ghoul posted:I'm not a coding horror perpetrator, BUT ... I just looked this up because I was curious and it was introduced in .NET Framework 2.0, which was 2005.
|
# ? Dec 10, 2023 15:36 |
|
Xarn posted:Dunno, I have been using v3 ranges for a while and I am not particularly impressed. Yes, it is harder to misuse them (for some cases, in other cases we get views::filter), but the compile times are awful and the resulting codegen is often not great. If you use Ranges v3 exactly like you use the standard library's iterator-based functionality you get identical codegen and the only compile-time hit is from the concepts checking. The view adaptors have proven to be too complicated for compilers to handle reasonable, but that's something which people basically gave up on doing with iterators.
|
# ? Dec 10, 2023 17:55 |
|
Hammerite posted:What the hell? this sounds like a terrible way to teach anything at all. is this sort of approach common on computer science/software courses? I was just a master's student and occasional TA but it's not how I'd describe any of the courses I took or had any sort of finger in teaching. Then again this was in Sweden; my understanding is we do grading very differently from a lot of US colleges. Anyhow, for my experience: hand-in exercises were pass/fail with a lot of hand-holding, chance for revisions and answering any questions no matter how banal. Hand-ins may have required passing some automated tests which may include performance, said tests were included in code given to students. Grade was 100% determined by final written exam (which was anonymous, I never had any idea which student wrote anything I explicitly graded). I'm sure this varies wildly between different countries, universities, etc. There was one course I took in parallel functional programming were they had explicit rankings for speed on the two hand-ins, in addition to pretty strict work-those-cores pass requirements on performance. This still didn't impact grade in any way, but the fastest solution for each did get a bottle of champagne.
|
# ? Dec 10, 2023 18:13 |
|
Xerophyte posted:answering any questions no matter how banal The most wtf question I ever got during an exam was "what is a leap year?". I needed a few moments to keep my poker face, but I did answer
|
# ? Dec 10, 2023 18:37 |
|
Xerophyte posted:There was one course I took in parallel functional programming were they had explicit rankings for speed on the two hand-ins, in addition to pretty strict work-those-cores pass requirements on performance. This still didn't impact grade in any way, but the fastest solution for each did get a bottle of champagne. This sounds fun. Which university was this?
|
# ? Dec 10, 2023 20:05 |
|
I guess teaching methods vary greatly. Usually at least half of the automated tests are also “private”, so they will only say if you passed, or failed. No extra feedback. Would love to do a Swedish parallel processing course. Or any good course on the subject which awards ECTS. I began doing another algorithm course, where we have to implement 100 different algorithms, and get 10 ECTS. Course is offered free by University of Helsinki. [url] https://cses.fi/alon/list/[/url] Ihmemies fucked around with this message at 20:35 on Dec 10, 2023 |
# ? Dec 10, 2023 20:30 |
|
My required undergrad software training was computational physics. It was taught in C, and this was in the 2000s when the entire compsci department had already moved over to Java. The professor was apparently a comp-phys wizard but refused to teach anyone how to code so it was up to the few students who already understood the basics of how to write and compile software to teach everyone else how to do this poo poo after class. I had taken the EE department's intro to C course as an elective, because writing software was a complete mystery to me and I wanted to learn something about it. So it was like me and 1 other guy, both novices but armed with one semester of knowledge, helping the rest of the class figure out how to write a Hello World program for the first time (the first assignment was not "write a hello world program", it was "use software to find the thermal equilibrium state of this situation, here is the equation you should be iteratively solving"). This was a big weed-out class for the major, it was such bullshit and for no reason. Later I learned that most scientists are largely self-taught when it comes to coding, including the group that basically invented CUDA, and that's when things began to click - that professor believed that not knowing anything about the tools is required, because that's what he went through. And then in grad school the same thing happened, but this time the professor didn't give a poo poo what language you used and merely encouraged C. He didn't care what language you chose because he wasn't going to teach you how to write code, the purpose of the course was to solve specific physics problems with software. Most of the students had either never written code or hadn't written code since their 1 semester of undergrad comp-physics and had mentally blocked the experience, so it again fell to the students with any amount of experience to teach the others basic things like writing their first hello world application.
|
# ? Dec 10, 2023 20:39 |
|
The (American) college I was a TA in required various levels of intro CS classes for various kinds of engineering majors, with some majors encouraged to take the MatLab versions if they just wanted to do some computation stuff. I don't know how often people who studied physics or the like took advantage of that.
|
# ? Dec 10, 2023 20:50 |
|
I took an elective "number theory and cryptography" course where the professor was in that same "I don't care about what language you use just get the math parts right" stance. We had to implement a bunch of things in software like various prime factorization algorithms, and eventually asymmetric key encryption. However at my school it listed a CS course as a prerequisite. I feel like I was the only one there using Python (it has native arbitrary-precision integers! so nice for this.) while everyone else was struggling with some third party C++ BigInt library since the prereq class taught C++.
|
# ? Dec 10, 2023 21:13 |
|
C# code:
.net came up with a superior solution, which is to make this depend on the machine's time zone. result is true if the machine is running in UTC+10, otherwise false sure, the code does look suspicious when laid out like this. but life is life, and the situation i ran into this in wasn't as straightforward. instead of ==, it was <, and so tests failed in CI (UTC) while passing on my machine (UTC+13). the cherry on top is that i'd have found this locally if i'd done the work 3 months earlier! my test data included UTC+13 cases, and 3 months ago i'd have been in UTC+12. i love time and time zones and daylight saving time
|
# ? Dec 10, 2023 21:52 |
|
Gonna remember that one the next time someone asks me why my code is the way it is. "life is life"
|
# ? Dec 10, 2023 21:56 |
Keep in mind that a .NET DateTime value can be either "Local", "UTC", or "Unspecified". If you have a Local and call ToUniversalTime() on it, it will adjust the time offset and give you the DateTime for that time given in UTC. If you have a UTC and call ToLocalTime() on it, ditto. If you have an Unspecified and call either on it, it will just assume the time-part is already whatever you asked for and do no conversion, only setting the Kind property.
|
|
# ? Dec 10, 2023 22:07 |
|
redleader posted:
well, could be worse. you could have not had the tests to tell you it was wrong.
|
# ? Dec 10, 2023 22:09 |
|
Athas posted:This sounds fun. Which university was this? Chalmers University of Technology. It would've been more fun if someone who actually drinks won* the bottles, but at least my mom was very appreciative. I have no idea if they ever did it again, it's the sort of fun thing a prof might get politely told not to repeat. * I think I came in 1st and 2nd, but the #1 was a postdoc who was just sitting in and decided to disqualify himself. Also thinking back I think only one was ranked on perf, the other winner-gets-a-bottle assignment was writing a sample application and tutorial for one of the Haskell parallelism libraries.
|
# ? Dec 10, 2023 22:56 |
|
nielsm posted:Keep in mind that a .NET DateTime value can be either "Local", "UTC", or "Unspecified". agreed, the .net date/time APIs are dogshit
|
# ? Dec 10, 2023 23:14 |
|
raminasi posted:I just looked this up because I was curious and it was introduced in .NET Framework 2.0, which was 2005. That's when they introduced generics, so I guess it has always been there. Now that I think about it, their approach to throwing an exception in case of a missing keys actually makes a lot of sense. For value types anything a GetKey method could return for a missing key could be confused for an actual value, i.e. am I getting back a 0 because the inventory for this productID is 0 or because the productID is not in the hashmap at all?
|
# ? Dec 11, 2023 02:22 |
|
|
# ? Jun 8, 2024 06:20 |
|
GABA ghoul posted:That's when they introduced generics, so I guess it has always been there. golangers will tell you that this isn't actually a problem
|
# ? Dec 11, 2023 03:11 |