News for hackers. Stuff that matters.
Re:Ask HN: Why do many CS graduates lack foundational knowle... by dgb23 on Monday March 20, 2023 @03:26AM (#35228341)
Relational algebra is math. SQL is a practical application of relational bags.

There’s math and science behind concurrency and parallelism, and the coordination thereof.

Network programming is a practical application of several parts, each of having foundations in math and science. From coding/decoding, to state machines. Wires are all about math and physics too.

There’s more that is often left out. Specifically holistic systems and their research. Lisp, Smalltalk, Self etc. These systems reach into math, HCI, compilers, JITs…

Re:Ask HN: Why do many CS graduates lack foundational knowle... by thrown123098 on Monday March 20, 2023 @04:10AM (#35228597)
>SQL is a practical application of relational bags.

Apart from the fact it isn't; elements have specific order and that order matters.

SQL is SQL, it's not relational algebra or whatever bastardization of it you can think up. In fact when it comes to SQL the only use relational algebra has is to tell that you that anyone talking about it has never used SQL.

Re:Ask HN: Why do many CS graduates lack foundational knowle... by dgb23 on Monday March 20, 2023 @04:37AM (#35228782)
Your computer is also not a Turing Machine. The regex that you use is not really a regular language. Your functions and logic are not referentially transparent, because well, they have to run on a computer.

But it's useful to learn the foundational mathematics of these things as there is a direct relationship between them.

SQL has semantics that can be understood by relational algebra of relational bags. It's of course not a 1:1 translation, but the mathematical underpinnings are explained there. It's useful to learn the simpler, more abstract thinking tool in order to understand the concrete programming tool.

Re:Ask HN: Why do many CS graduates lack foundational knowle... by thrown123098 on Monday March 20, 2023 @05:01AM (#35228949)
My computer is very much a Turing machine since each time it runs out of disk space I can buy more disks. The fact you think a Turing machine has infinite memory rather than finite but arbitrarily large memory tells me all I need to know about the sorry state of your theoretical education.
Re:Ask HN: Why do many CS graduates lack foundational knowle... by dgb23 on Monday March 20, 2023 @05:04AM (#35228966)
How much does an infinite amount of disk space cost?
Re:Ask HN: Why do many CS graduates lack foundational knowle... by oriolid on Monday March 20, 2023 @05:30AM (#35229152)
Nothing, if it's your users who buy it instead of you.
Re:Ask HN: Why do many CS graduates lack foundational knowle... by thrown123098 on Monday March 20, 2023 @05:07AM (#35228986)
Re:Ask HN: Why do many CS graduates lack foundational knowle... by rrobukef on Monday March 20, 2023 @08:34AM (#35230589)
A Turing machine is a mathematical concept. It has, by definition, infinite memory. A computer is just a real machine that can do similar things as a Linear Bounded Automaton, a Turing machine's little brother who'll never do quite the same things.
Re:Ask HN: Why do many CS graduates lack foundational knowle... by thrown123098 on Monday March 20, 2023 @09:31AM (#35231230)
Re:Ask HN: Why do many CS graduates lack foundational knowle... by rrobukef on Monday March 20, 2023 @03:07PM (#35236941)
There is a physical limit to the number of disks you can add to your CPU. There is a physical limit to the memory you can address in your CPU (48-bits). It is not arbitrarily large.

Also wrong for Turing Machines, it really is infinite. That's a big difference to arbitrarily large. The halting problem is undecidable for TM's but not for arbitrarily large (you'll need precise definitions though).

Re:Ask HN: Why do many CS graduates lack foundational knowle... by thrown123098 on Monday March 20, 2023 @06:44PM (#35239906)
It is left as an exercise to the reader to find a natural number which isn't arbitrarily large but calculable.
Re:Ask HN: Why do many CS graduates lack foundational knowle... by rrobukef on Tuesday March 21, 2023 @03:08AM (#35243289)
The tape size needed for a Turing machine is incalculable. Here's a reference to a proof: https://scottaaronson.blog/?p=2725.

The machine with 7918-states, Z, stops (well, Z cannot be proven to run infinitly long) iff. ZFC is consistent. For this it needs a finite amount of space but we cannot calculate how much. If we could calculate an upper bound we've proven ZFC is consistent.

Re:Ask HN: Why do many CS graduates lack foundational knowle... by thrown123098 on Tuesday March 21, 2023 @08:23AM (#35245217)
Yes which is why the size if strictly finite but arbitrarily large.
Re:Ask HN: Why do many CS graduates lack foundational knowle... by bigbillheck on Monday March 20, 2023 @09:49AM (#35231453)
> each time it runs out of disk space I can buy more disks.

There's only so many that you can buy.

Re:Ask HN: Why do many CS graduates lack foundational knowle... by mabbo on Monday March 20, 2023 @08:10AM (#35230365)
The developers who don't understand the relationship between relational algebra and SQL are the ones who end up confused why their query browned out prod.

It's not exactly the same thing, but the underlying lessons and mental model matter.

Of course, the move back towards nonrelational data stores these days may make the point moot.

Re:Ask HN: Why do many CS graduates lack foundational knowle... by wankle on Monday March 20, 2023 @11:41AM (#35233241)
Three decades of programming in various languages and at various companies and today's discussion is the first time (after all those years writing SQL used by those applications) that I've seen the term "relational algebra". My queries run great in production at various companies right now, including many I guarantee are widely recognizable.
Re:Ask HN: Why do many CS graduates lack foundational knowle... by mabbo on Monday March 20, 2023 @02:14PM (#35236052)
Sounds like you're working hard to defend your ego rather than seeing the opportunity to learn and improve yourself.

You must be a delight to work with.

Re:Ask HN: Why do many CS graduates lack foundational knowle... by simplotek on Monday March 20, 2023 @04:47AM (#35228854)
> Relational algebra is math. SQL is a practical application of relational bags.

How many database programmers do you know who ever did anything involving relational algebra when creating or tuning up a database?

This point is specially pointless with the prevalence of ORM frameworks.

> There’s math and science behind concurrency and parallelism, and the coordination thereof.

Please find me the best example you can come up of what you see as math being put to practice in concurrent programming.

> Network programming is a practical application of several parts (...)

This is too much grasping at straws. Just show what you feel is the absolute best example.

> There’s more that is often left out.

There is nothing. You showed nothing as your best examples, and once you showed nothing you were left with nothing else to show.

Enough with this silly "but it is math" nonsense. You can come up with a math formalization of an egg but that does not mean a degree in math will help you boil one. Enough with this nonsense.

Re:Ask HN: Why do many CS graduates lack foundational knowle... by oriolid on Monday March 20, 2023 @05:29AM (#35229147)
> How many database programmers do you know who ever did anything involving relational algebra when creating or tuning up a database?

...and this explains why database designs are what they are. It's also why you don't learn SQL and if you do you never admit it: It condemns you to a lifetime of maintaining CRUDs written by people who don't understand relational algebra.

Re:Ask HN: Why do many CS graduates lack foundational knowle... by simplotek on Monday March 20, 2023 @05:42AM (#35229241)
> ...and this explains why database designs are what they are.

You mean good enough?

Re:Ask HN: Why do many CS graduates lack foundational knowle... by oriolid on Monday March 20, 2023 @07:35AM (#35230089)
Good enough as in constant burden but not bad enough to fail the whole project.
Re:Ask HN: Why do many CS graduates lack foundational knowle... by simplotek on Monday March 20, 2023 @08:11AM (#35230379)
> Good enough as in constant burden

Are they, though? Or are you just trying to put up a strawman?

Because I assure you plenty of highly reliable infrastructure is running 24-7 without the faintest concern over normalization.

Re:Ask HN: Why do many CS graduates lack foundational knowle... by oriolid on Monday March 20, 2023 @10:02AM (#35231629)
> Or are you just trying to put up a strawman?

Writing from personal experience. I can also assure you that a lot of this highly reliable infrastructure works only because a lot of tears and cursing that could have avoided if the designers had any idea what they were doing.

Re:Ask HN: Why do many CS graduates lack foundational knowle... by roenxi on Monday March 20, 2023 @06:50AM (#35229742)
> Enough with this silly "but it is math" nonsense. You can come up with a math formalization of an egg but that does not mean a degree in math will help you boil one. Enough with this nonsense.

Formalising 3rd normal form and giving it a rigorous definition so that we can test if data is properly normalised is a big deal. Ditto having algorithms in concurrent systems that we can guarantee don't have logic bugs in them.

If those things aren't math to you, then what are you willing to accept? Do you mean programmers have to sit down and draw an integral sign or it doesn't count? You're correct that doesn't happen, and you're probably setting yourself up to be steamrollered by someone who sees a well known pattern that the academics have been researching for years.

The typical corporate database has big tracts that have been "designed" by someone doesn't appear to have thought very much about how to store data in an organised fashion. It raises the question of what fuzzy thoughts go through their brain since they are only interacting with a database because they have a need to store data in an organised fashion. Hopefully their thoughtlessness doesn't matter, but doing better than that is a low bar.

Re:Ask HN: Why do many CS graduates lack foundational knowle... by simplotek on Monday March 20, 2023 @08:00AM (#35230296)
> Formalising 3rd normal form and giving it a rigorous definition so that we can test if data is properly normalised is a big deal.

It isn't. Half the world already relies on ORM frameworks that barely require any input from the developer to setup relational databases, let alone knowledge on how to normalize them.

On the rare occurrences a project feels that specialization on relational database design is relevant, more often than not it's far more useful to require expertise on specific RDBMS than trivia tricks.

> If those things aren't math to you (...)

You're missing the whole point. No one is arguing that you have math formalisms. The whole point is that those formalisms do not add any value at all. Don't you understand that?

I mean, I can whip out a web app with multiple services running in the backend and with datastore using both DynamoDB and S3, and build a business around it. We can do this without ever knowing who Jack or Joe or Jim or Jose Cobb was, let alone what he wrote. What does it tell you?

Re:Ask HN: Why do many CS graduates lack foundational knowle... by roenxi on Monday March 20, 2023 @08:28AM (#35230540)
> The whole point is that those formalisms do not add any value at all. Don't you understand that?

I'm going to go a bit further than just not understanding, I'm actively disagreeing with you. Based on your arguments here, in a workplace I would advocate not letting you make any decisions about database schema.

Sounds like the feeling might be mutual there though. Not saying you're bad at whatever it is you do; just I want to have to have schema designed by someone who has thought deeply about schema design. Databases usually outlive all the employees assembling it, can outlive an entire organisation and getting the design right can save days to months of work.

The academics have got entire classes of bugs that they can demonstrate don't exist in normalised data, there are benefits to everyone coordinating around a standard shared view on how to lay out data and usually drifting away from the standard it turns out not to lead to real benefits long term. You can believe that is valueless or isn't math or whatever, but there is no point aggressively introducing opportunities for bugs when there is no reason for it. And to avoid doing that, the person making the decisions needs to understand the theory.

Re:Ask HN: Why do many CS graduates lack foundational knowle... by _gabe_ on Monday March 20, 2023 @11:03AM (#35232526)
"Show me your flowchart and conceal your tables, and I shall continue to be mystified. Show me your tables, and I won't usually need your flowchart; it'll be obvious." -- Fred Brooks, The Mythical Man Month (1975)

It's unfortunate that most people these days prefer unstructured blobs of json to formal relational databases. It's impossible to get up to speed in these types of environments because every time you think you "understand" the data, you find out about a random property that gets set in rare occurrences that throws off the whole relational model you intuitively built in your mind.

Re:Ask HN: Why do many CS graduates lack foundational knowle... by wankle on Monday March 20, 2023 @11:34AM (#35233105)
People who excel at theory usually don't do well in most programming positions. Perfectly normalized schemas do not hold up well in an operations heavy environment.
Re:Ask HN: Why do many CS graduates lack foundational knowle... by _gabe_ on Monday March 20, 2023 @12:54PM (#35234578)
I'm not advocating for perfectly normalized schemas. There's a large gap from: perfectly normalized schema -> unstructured blob of json. I'm saying that most people nowadays prefer to not think at all about how their data looks and they'll add properties ad-hoc.

This also does not hold up well in an operations heavy environment. Like all things in programming, a well balanced approach is necessary. Some combination of formally structured data with some flexibility for future requirements is probably the best course of action here, but that's too much work for programmers these days.

Re:Ask HN: Why do many CS graduates lack foundational knowle... by seabird on Monday March 20, 2023 @02:28PM (#35236287)
If you think an ORM somehow saves you from knowing how to make a normalized DB schema (even by intuitive means instead of formal ones), you've lost your mind. For most 9-5 developers just earning their paycheck, this train of thought can lead to absolutely fucking insane DB thrashing and data consistency problems. You might be getting away with it intuitively, but a lot of people won't, so keep it to yourself for your own sake.
Re:Ask HN: Why do many CS graduates lack foundational knowle... by wankle on Monday March 20, 2023 @11:26AM (#35232946)
Agree, I've programmed in various languages at various companies for three decades, do not have a degree and yet every point you made is 100% accurate and precise.