Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
ExcessBLarg!
Sep 1, 2001
Like the brainfuck examples, you can write "good" code, or at least, understandable-the-best-you-can code in assembler using the same approach.

But one of the main benefits of C over assembler is that the structure provided by the language itself goes a long way to making the code understandable without having to duplicate all the logic between generally-opaque instructions and the explanatory comments.

And basically every systems language since C has been designed to make it easier to write increasingly-complex applications that are both understandable and correct (or at least, with better fail-safes) than the last.

Adbot
ADBOT LOVES YOU

ExcessBLarg!
Sep 1, 2001

BigPaddy posted:

I looked into that abyss for but a week and came away scarred.
Yeah, Yacc is pretty weird.

ExcessBLarg!
Sep 1, 2001
Wonder what his interview was like.

ExcessBLarg!
Sep 1, 2001
He's definitely rogue. Look, I'm not a fan of nodejs either but I don't go around replacing production systems that are working just fine for the sake of it.

That said it's pretty strange he was hired with his particular skillset and then quickly given such level of access with little (official?) oversight.

ExcessBLarg!
Sep 1, 2001

Volmarias posted:

Depends on which judge you get too; the judge in the Oracle vs Google case about whether Java APIs can be protected IP, who actually took the time to learn enough programming to understand the concepts being argued, or... pretty much any other judge.
The thing about this case is that it was pretty clearly two juggernauts going in with complaints regarding major products and any ruling would have significant repercussions within the industry. As a judge, this is it--this is your superbowl. You'd think you want to be sufficiently versed in the situation to get it right.

And yet I totally agree that most judges wouldn't give two shits.

ExcessBLarg!
Sep 1, 2001

Dr. Arbitrary posted:

I feel like the curriculum for the Java class I'm taking might be a little out of date:
I'm pretty sure this is how all voting machines actually work.

ExcessBLarg!
Sep 1, 2001

duck monster posted:

This fucker codes on the production server.
Blow up production server. There's no backups (of course there's no backups), and rebuild from latest committed revision. Should undo everything he's done, right?

ExcessBLarg!
Sep 1, 2001
If the server timezone is anything but UTC then it's probably running Windows and PHP on Windows explains the rest of the horror.

ExcessBLarg!
Sep 1, 2001

Mellow_ posted:

I'm moving a Linux system still running on 2.2.14 (and the build scripts and such are basically untouched since 2002 or 2006 or whenever that kernel came out)
Debian Potato?

Mellow_ posted:

(Why use git branches and commits? Just comment everything out.)
To be fair, that machine predates git by about five years. People didn't use rcs quite as enthusiastically.

ExcessBLarg!
Sep 1, 2001

Volguus posted:

Now, as far as I can tell I have a few solutions to that:
Perhaps a simpler solution would be to run the IPTV software as a dedicated user and then set an ip rule on the uid to use the VPN interface.

You could also create a new network namespace and use nsenter when lauching the IPTV software to place it in the new namespace. This is closer to what the container solution does.

Also the container solution is fine, but if running it fully in a container presents other problems there's a few alternatives.

ExcessBLarg!
Sep 1, 2001

smackfu posted:

I worked on a product once where all the timestamps were stored in the database in local time.
You'd think that timestamps should always be stored in UTC and converted to localtime for presentation but sometimes there's strong reason to store them in local-to-particular-venue time regardless of a given machine's local zone, and future timestamps should follow DST policy for that venue that may not yet be defined.

ExcessBLarg!
Sep 1, 2001
Unity is why a 850 MB pixel art game takes up 7.1 GB on Nintendo Switch. Absolute weird bullshit engine.

ExcessBLarg! fucked around with this message at 18:31 on Sep 26, 2023

ExcessBLarg!
Sep 1, 2001

Volte posted:

I was very curious about this so I :ninja: obtained :ninja: a ROM of the Switch version and unpacked it.
I posted the details about this a while back, and I think your description is pretty accurate.

Volte posted:

Not sure why the Switch version is only 3.5GB instead of the 7+ reported elsewhere, unless that's just a 2x size buffer to account for patches or whatever.
The "ROM" consists of the original release of the game, while the size doubled in subsequent DLC updates.

My point though is that it's unfortunate that Unity's "default" (or at least, most straightforward) asset management approach is recognized as so woefully inefficient that it's not recommended for use, and that while better solutions exist you have to go out of your way to make use of them.

ExcessBLarg!
Sep 1, 2001
It's really a privilege to be able to "modern" code. There's so many times when you're stuck with ES5 or Java 8 or C89 even due to aging infrastructure and requirements. And being able to meet those requirements--even if they're ridiculous--is still important.

Also I wouldn't really evaluate a CS program based on their webdev course unless it's required form some reason.

ExcessBLarg!
Sep 1, 2001

Ihmemies posted:

Ok we're at uni's datastructures & algos course.
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.

Also, I don't think an autograder running on a correct, but inefficient program should result in a failing grade unless the student has access to the autograder ahead of the assignment due date (it wasn't clear to me if this was the case here), and even then I'm not sure it should do that. Like, a student inefficiency using an O(n) search where a O(1) lookup is warranted is a common mistake to the point that the autograder should be aware of it.

ExcessBLarg!
Sep 1, 2001

senrath posted:

On the other hand, you have to set the autograder to time out eventually,
That's totally fine. The autograder should be able to recognize the result of the 10k test case and assign an appropriate grade when it hits the timeout.

ExcessBLarg!
Sep 1, 2001

senrath posted:

It really depends on what the grading criteria was.
Right, I'm saying a failing grade for this kind of assignment is bad criteria.

ExcessBLarg!
Sep 1, 2001

RPATDO_LAMD posted:

Also how would you teach stuff like trees and linked lists in a 'friendly' language without pointers like java or python?
Both Java and Python use object references when assigning non-primitives.

ExcessBLarg!
Sep 1, 2001

GABA ghoul posted:

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?
This is a problem that's faced by every dictionary/map API ever. The options are generally:
  • Return null when a key does not exist, which may create ambiguity with keys explicitly assigned null (if that's actually possible, and if the distinction is relevant).
  • Allow the code to supply a default value to return if the key is not present (usually as an argument) and return that value.
  • Return an optional type, if the language supports optional types and if they were supported at the time the map/dictionary API was drafted.
  • Throw an exception.
Of these, throwing an exception is my personal least favorite. I'm a believer that "exceptions should be used for exceptional situations" and a key-not-present condition is usually a frequent occurrence. In practice though, it depends on how exception handling is implemented in the runtime and if thrown exceptions aren't heavyweight in terms of performance cost, then whatever. Also, some languages like Python utilize exceptions as part of standard control flow (e.g., raising a StopIteration exception is expected as part of the iterator protocol).

ExcessBLarg!
Sep 1, 2001

leper khan posted:

"Return value will be indexed from the map. In the event the key is outside the map, the return value will be parsed from the memory immediately following the map"
And my favorite corollary: "key collisions are statistically unlikely".

ExcessBLarg!
Sep 1, 2001

leper khan posted:

Horror from the thread and all, but I never understood the appeal of option types. Doesn't give any more information than a pointer.
Null references subvert the type system, while option types enforce it.

leper khan posted:

Oh you have to check HasValue everywhere instead of != NULL. Wow great good job.
Usually those checks happen sooner though, close to where an unexpectedly-empty value enters the system, which makes them easier to debug.

ExcessBLarg!
Sep 1, 2001

leper khan posted:

If they happen sooner, you're converting from a nullable or reference type to a non-nullable value-type. Checking for a value has similar semantics and failing to do that in both cases throws an exception.
:shrug:
I'm not sure I was clear in my original statement. What I was trying to say is that checking if an option type has value tends to happen sooner, since it's required to convert to a non-nullable type. Since a failing check happens sooner, it makes an unexpected empty value easier to debug.

ExcessBLarg!
Sep 1, 2001

Athas posted:

Also, when you have code like that, it is usually because it is generated, and then it can be very annoying to run into those arbitrary restrictions.
I'm struggling to think of a good example of having 100+ "else if" blocks even for generated code. Surely it could be converted to some kind of dispatch mechanism, or at least convert the conditional tests into a tree form.

ExcessBLarg!
Sep 1, 2001

Volte posted:

if (opcode == FOO) { ... } else if (opcode == BAR) { ... } else if ...
This could trivially be written as switch/case even within a code generator.

Athas posted:

Yes, I would expect the compiler to compile it efficiently, based on its knowledge of the target architecture.
I suppose that a compiler that's smart enough to coalesce a bunch of if/else if conditionals into a dispatch table probably should also not have a hilariously low limit on the number of tests. At that point writing if/else if vs. switch/case is a stylistic detail that's irrelevant given that it's intermediate-language code not intended for human consumption.

ExcessBLarg!
Sep 1, 2001

Volte posted:

Nobody has argued that it's the only way to write it, just that it is a place where it could conceivably come up in a non-horror situation.
To refine my earlier point, I'm struggling to think of an example of needing 100+ "else if" blocks that couldn't be written in a better (whether stylistic or performant) way.

Which is to say that the limitation itself may be defensible.

ExcessBLarg!
Sep 1, 2001

Volmarias posted:

Write Four Billion Conditions
Again, this could be written perfectly performantly using switch/case and a 32 GB jump table.

Adbot
ADBOT LOVES YOU

ExcessBLarg!
Sep 1, 2001
I wrote a for-case loop the other day for a project. At first I felt pretty bad about it but it's way better than these case-for shenanigans.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply