Live data from Hacker News

Computer science courses that don't exist, but should (2015)

prog21.dadgum.com

241–250 of 308 posts

Re: Computer science courses that don't exist, but should (2015)

#241
post #159

Earlier quoted context omitted.

Usually it's because of an initiative by the Long Now Foundation that is supposed, among other things, to raise awareness about their 10,000 years clock and what it stands for. See https://longnow.org/ideas/long-now-years-five-digit-dates-an...

And I, semi seriously, say that it's only the "Medium Now", because they only prepend one zero. But I hate it. It makes most readers stumble over the dates, and it does so to grind an axe that is completely unrelated to the topic at hand.

Everyone hates it.

Re: Computer science courses that don't exist, but should (2015)

#242
post #11

"CSCI 4020: Writing Fast Code in Slow Languages" does exist, at least in the book form. Teach algorithmic complexity theory in slowest possible language like VB or Ruby. Then demonstrate how O(N) in Ruby trumps O(N^2) in C++.

I’ll take the fight on Algorithmic complexity any day.

There are many cases where O(n^2) will beat O(n).

Utilising the hardware can make a bigger difference than algorithmic complexity in many cases.

Vectorised code on linear memory vs unvectorised code on data scattered around the heap.

Re: Computer science courses that don't exist, but should (2015)

#243

Earlier quoted context omitted.

No

I want to believe you, but some of this verbage sounds very strange, as if you're don draper trying to sell me functional programming. There are a lot of stinks within those paragraphs. I have no proof that you did, but something about it feels off.

There’s no need to respond then. No point in this accusation either. You make an accusation, I deny it, life goes on and nothing is different except a little wasted effort. Save the effort.

Re: Computer science courses that don't exist, but should (2015)

#244
post #242
post #11

"CSCI 4020: Writing Fast Code in Slow Languages" does exist, at least in the book form. Teach algorithmic complexity theory in slowest possible language like VB or Ruby. Then demonstrate how O(N) in Ruby trumps O(N^2) in C++.

I’ll take the fight on Algorithmic complexity any day. There are many cases where O(n^2) will beat O(n). Utilising the hardware can make a bigger difference than algorithmic complexity in many cases. Vectorised code on linear memory vs unvectorised code on data scattered around the heap.

I sincerely hope you are joking...

Re: Computer science courses that don't exist, but should (2015)

#246
post #163

Earlier quoted context omitted.

The great achievement of OOP is that it inspires such passion. In essence OOP is just, "hey, if you have a struct and a bunch of operations that operate on that struct, let's put the name of the struct and a dot in front of the names of those operations and you don't need to pass the struct itself as an argument" It beats me how either the high priests or its detractors get so worked up about it, even with the add-on…

You’re missing the depth of the difference. It’s not just syntax sugar for calling object.method() instead of func(object). The key distinction is what happens when the method mutates the object. When state is mutable, every method that touches it becomes coupled to every other method that touches it. The object stops being a collection of independent behaviors and turns into a shared ecosystem of side effects. Once…

You can write these same methods in an OOP language like Java. You dont have to use classes for everything.

But alot of times, yes it makes sense to group a set of related methods and states.

You say this is not a natural way of thinking but I strongly disagree, it lines up perfectly with how I think. You are you, the car dealership is a dealership. You buy a car from the car dealership, the dealership gets money, you lose money, the dealership loses a car and you gain a car. I want these states reflected in the objects they belong and not passed around globally and tracked

Or if I am writing an API library, yes I very much want to 1. group all my calls together in a class, and 2. keep track of some state, like auth tokens, expirations, configuration for the http client, etc. So you can just do api.login, api.likeX, etc

Moreover, most methods youd write in a large project are so limited in scope to the type and purpose, this idea of some great modularity is nonsense. Its not as if you can have a single delete function that works on deleting users, images from your s3, etc. Youd end up writing bunch of functions like deleteUser(user), createUser(user), deleteImage(image), and wow wouldn't it be great if we could just group these functions together and just do user.delete, user.create? we could even define an interface like Crudable and implement it differently based on what we're deleting. wows

Re: Computer science courses that don't exist, but should (2015)

#247
post #179
post #152

Earlier quoted context omitted.

To be fair, the standard bubble sort algorithm isn't vectorized, and so can only use about 5% of the power of a Cray-1. Which is good for another factor of about 5 in the array size.

A Cray-1 was still fast at non-vector code when new.

Yes, as I understand it, its 80MHz clock gave it a 12.5ns memory access time, and I think it normally accessed memory four times per instruction, enabling it to do 20 MIPS (of 64-bit ALU ops). But the vector units could deliver 160 megaflops, and usually did. I think a TRS-80 could technically run about half a million instructions per second (depending on what they were) but only about 0.05 Dhrystone MIPS—see the Cromemco Z2 on https://netlib.org/performance/html/dhrystone.data.col0.html for a comparable machine.

So we can estimate the Cray's scalar performance at 400× the TRS-80's. On that assumption, Quicksort on the TRS-80 beats the Cray somewhere between 10000 items and 100_000 items. This probably falsifies the claim—10000 items only fits in the TRS-80's 48KiB maximum memory if the items are 4 bytes or less, and although external sorting is certainly a thing, Quicksort in particular is not well-suited to it.

But wait, BASIC on the TRS-80 was specified. I haven't benchmarked it, but I think that's about another factor of 40 performance loss. In that case the crossover isn't until between 100_000 and 1_000_000 items.

So the claim is probably wrong, but close to correct. It would be correct if you replaced the TRS-80 with a slightly faster microcomputer with more RAM, like the Apple iiGS, the Commodore 128, or the IBM PC-AT.

Re: Computer science courses that don't exist, but should (2015)

#248
post #156

Earlier quoted context omitted.

"Software engineering" is the political ideology that the study of management practices can enable you to deliver a successful software project without learning how to program. It is very popular in fields where a software project can be considered successful without ever delivering usable software, such as cost-plus defense contracting, management consulting, and enterprise software. If you want to know how to build…

> "Software engineering" is the political ideology that the study of management practices can enable you to deliver a successful software project without learning how to program. Software engineering is not an ideology, but the application of engineering practices to building computer programs, the same way civil engineering is the application of engineering practices to building bridges. Your statement is odd: softw…

Study the history; you'll see.

Or look at who's actually executing successfully on the practical aspect of building software. It isn't people who got a master's degree in IT risk assessment and business process modeling.

Re: Computer science courses that don't exist, but should (2015)

#249

Earlier quoted context omitted.

The history of art or philosophy spans millenia. The effective history of computing spans a lifetime or three. There's no sense comparing the two. In the year 2500 it might make sense to be disappointed that people don't compare current computational practices with things done in 2100 or even 1970, but right now, to call what we have "history" does a disservice to the broad meaning of that term. Another issue: art an…

If Alan Kay doesn't respond directly to this comment, what is Hacker News even for ? :) You're not wrong about history, but that only strengthens Kay's case. E.g., our gazillion-times better physical substrate should have led an array of hotshot devs to write web apps that run circles around GraIL[1] by 2025. (Note the modeless GUI interaction.) Well, guess what? Such a thing definitely doesn't exist. And that can on…

> Such a thing definitely doesn't exist

Isn't that pretty much how things like simulink and gnu radio flowgraphs work?

Re: Computer science courses that don't exist, but should (2015)

#250
post #11

"CSCI 4020: Writing Fast Code in Slow Languages" does exist, at least in the book form. Teach algorithmic complexity theory in slowest possible language like VB or Ruby. Then demonstrate how O(N) in Ruby trumps O(N^2) in C++.

I work with Python programmers (engineers/scientists who 'know' Python) daily. Having them understand why their slow code is slow would be amazing.

We are rebuilding a core infrastructure system from unmaintained python (it's from before our company was bought and everyone left) to java. It's nothing interesting, standard ML infrastructure fare. A straightforward, uncareful, like weekend implementation in java was over ten times faster.

The reason is very simple: Python takes longer for a few function calls than Java takes to do everything. There's nothing I can do to fix that.

I wrote a portion of code that just takes a list of 170ish simple functions and run them, and they are such that it should be parallelizable, but I was rushing and just slapped the boring serialized version into place to get things working. I'll fix it when we need to be faster I thought.

The entire thing runs in a couple nanoseconds.

So much of our industry is writing godawful interpreted code and then having to do crazy engineering to get stupid interpreted languages to do a little faster.

Oh, and this was before I fixed it so the code didn't rebuild a constant regex pattern 100k times per task.

But our computers are so stupidly fast. It's so refreshing to be able to just write code and it runs as fast as computers run. The naive, trivial to read and understand code just works. I don't need a PhD to write it, understand it, or come up with it.

Post reply on HN