Live data from Hacker News

Computer Science from the Bottom Up (2013)

bottomupcs.com

111–120 of 161 posts

Re: Computer Science from the Bottom Up (2013)

#111

But this isn't a comp sci book really since it doesn't actually cover any comp sci topics such as the analysis of computer programs, algorithms and data structures.

That's one portion of computer science. Computer science encompases, in my mind, the study, operation, maintnence, and information that is required to perform computing tasks of the modern era. It's no use to know about algorithms and complexity if you only know how to sort punch cards as that isn't a modern day computing task. A computer sceince background inherently implies software development background. This als…

> An algorithm that takes infinite time

Can you give an example of such an algorithm? My understanding of an algorithm is that it must terminate in a finite amount of time, but maybe you have a different definition of an algorithm

Re: Computer Science from the Bottom Up (2013)

#112

Earlier quoted context omitted.

Theory is useless without implementation and implementation is nothing without an understanding of theory. Implementation and theory are in lockstep but by learning theory you will not necessarily know how to implement, or even really understand, the topics you have memorized. On the other hand it is necessitated by the concept of implementation that you on one hand understand the tools you are using to solve this pr…

> Theory is useless without implementation and implementation is nothing without an understanding of theory. I feel that you greatly misunderstand why theory is important. It is not just something to be memorized to aid in implementation. It is useful and interesting in its own rite. CS Theory is Mathematics and like mathematics can be pursued simply with the goal of better understanding. An understanding of Turing M…

> feel that you greatly misunderstand why theory is important. It is not just something to be memorized to aid in implementation. It is useful and interesting in its own rite. CS Theory is Mathematics and like mathematics can be pursued simply with the goal of better understanding.

I don't think you understand what I mean. I don't mean the theory isn't important. Nor do I feel that the only thing important is the theory.

What I do feel is this: - If you're teaching someone something they don't care about yet and wont remember, it's useless - If you're learning theory before running into WHY you need that theory then you by definition don't care

Our field should be about hiding the unimportant abstraction for the time being and it shouldn't be able shoving it in your face and saying "you'll need this in 3 years when we get to graphs".

No one will remember that. I have a hard time remembering every single "important algorithm". Do you think I could write a radix sort off the top of my head with no prep time? What about something easier like a merge sort? No. I don't care because my job isn't writing sorts. Most of the time using the built in language sorting function is ok. If I need to write one I choose based on the language I'm using and task by sitting down, thinking through my past experiances and what I used them (like not using a radix for floats/strings and instead using a merged quicksort). After I find one that'll work like it has in the past I google for that and reimplement the algorithm.

There are hundreds and thousands of ideas that I need to keep in my head when programming of which sorting is one of the least important ones.

> The same could be said for teaching implementation. Thoughtless memorization is rarely useful in any field. You can instead have them discover the theory like they would discover an understanding of implementation you advise.

The entier point of my post is to say we shouldn't do that. We should give them a task that they will want to acomplish and like every good task you take one too many cakes from a stranger and fall into a rabit hole of other problems. You can go from

   - I need a script to manage this deamon
   - Now I want logs parsing and a way to run analytics on them
   - Ok now I want to run realtime events triggered by these log lines
   - One of those needs to be a SMS service, let me go write that
And that goes on and on and on and on until you run into every problem in the book a software developer runs into.

Feature creep, undocumented code, bad styles, slow performance due to features, breaking changes, why a dev enviroment is important.

Programming is a small part of being a programmer.

> Much of the theory of CS is not particularly hard to work out yourself if you are given the right hints

That's exactly how I feel.

> Personally, it was not a great start for me (I started with C; not exactly the lowest level, but lower than most CS courses nowadays).

C has many problems that are not present in far lower levels in the stack. In assembly you can do anything any way. You don't need to care. You have a magical way to save the contents of a register and get it bad, to go to a subroutine, and a massive set of "pre-defined functions" (instructions).

On older, simpler, systems this was even less of a problem. For instance a Z80 machine has huge advantages one such being the amazing instruction set and extremely simple features.

> I would have preferred to learn more theory earlier in my learning, and that is not easy to do when you are focused only on the code and not on the ideas behind the code that are universal

The theory should come as you get stuck, not before. The act of getting stuck and then pulled out of the hole is what teaches you when something is meant to come in handy.

One such example is when your car battery dies. You probably don't have one of those self-jumping battery packs in your car but they come in handy. You only ever see why after your battery goes flat and you cant find anyone to give you a jump.

Re: Computer Science from the Bottom Up (2013)

#113
post #5

I've been rattling this idea around in my head and, although it may sound crazy, I think C is a little high level to start an adult out on. I know many people won't agree with this but all of the people I admire in the world of CS and everyone who is a true scottsman for all intents and purposes loves dipping down to a lower level once and a while. I think the best way to learn about computer science it to program fo…

> I think the best way to learn about computer science it to program for a machine so simple anyone can understand how every bit works. No magic.

We do this in my school, sort of. The 2nd year courses teach you to know how to write assembly in a fictional subset of MIPS (https://www.student.cs.uwaterloo.ca/~cs241/mips/mipsref.pdf). There is a course where we write a compiler that emits this fictional MIPS, and a course where we learn how to implement a CPU that can execute (an even smaller subset of) these instructions (starting from CMOS gates).

Re: Computer Science from the Bottom Up (2013)

#114
post #104

Thanks, I wrote this! It was a bit of a different time, when docbook was the way to publish, when Itanium was the 64-bit architecture, things like go and rust didn't exist and we used bitkeeper. But most of it is still relevant, and despite acquiring 2 kids since I started still have some ideas. Yes yes, it's not Alan Turing-esque computer science. I have taught algorithms and data structures courses as well as opera…

Just as idle inquiry about the "CS" term, do you think the name "Computer science" would still apply (and did it always apply) to things such as CPU and OS architectures, the toolchain, etc - basically the subject of your e-book? I am under the impression that there's a distinction between "Computer Science", which is algorithm and data structure design and analysis, and "Computer Engineering" which is basically ever…

Not the OP, but from skimming the ToC, about 90% of the topics covered are taught in undegrad courses required for graduation for my CS degree.

> Because my friends who do "real CS" at various universities generally avoid anything which has to do with hardware and practical operating systems, and are basically mathematicians working on problems relatable to computers

Are they in grad school / doing research? Maybe they're just specializing in those areas (I think it's called theoretical CS).

Re: Computer Science from the Bottom Up (2013)

#115
post #113
post #5

I've been rattling this idea around in my head and, although it may sound crazy, I think C is a little high level to start an adult out on. I know many people won't agree with this but all of the people I admire in the world of CS and everyone who is a true scottsman for all intents and purposes loves dipping down to a lower level once and a while. I think the best way to learn about computer science it to program fo…

> I think the best way to learn about computer science it to program for a machine so simple anyone can understand how every bit works. No magic. We do this in my school, sort of. The 2nd year courses teach you to know how to write assembly in a fictional subset of MIPS ( https://www.student.cs.uwaterloo.ca/~cs241/mips/mipsref.pdf ). There is a course where we write a compiler that emits this fictional MIPS, and a co…

Want to trade? You can come to NJIT: the land of physics, math, and more math. Oh and 4 "inter-disaplinary" corses (read wastes of time).

Re: Computer Science from the Bottom Up (2013)

#117

Earlier quoted context omitted.

It's not only that, but doing something like writing your own assembler probably isn't going to be terribly relevant to someone creating a web app or making a game in Unity - particularly so 5, 10, or 20 years later. Heck, I'm not even sure that working on an assembler is going to be terribly useful to most people who will be writing in assembly. Students who aren't interested in a particular requirement will complet…

All software is related in some degree. You will find that people who come from a background of compilers will do well in developing certian portions of games. In a sense most games are a compiler. You feed it in source (images, dialog, models, textures, etc) and it spits out an interactivly compiled narrative. Websites are also compilers. They just operate on a higher level of abstraction then the simple toy compile…

Even most people I know who have written compilers haven't written assemblers; neither have most people I know who have written (real, not toy) programs in assembly. The argument isn't that it would be useless, but rather that it's an extremely inefficient use of one's time and money if the goal is higher level development - or even, I'd argue, if one was aiming for a proficiency writing programs in assembly.

Again, I'd argue that focusing on being proficient at the level someone is interested in is much, much more useful than focusing on making a lot of different toys at a bunch of different levels and in a bunch of different languages. You are going to learn something either way, but jumping around with a bunch of small projects all over the place probably means that you aren't going to retain much and you're not going to have any particular strength at the end.

Conversely, if you focus you're going to retain a lot more, since you can incorporate a lot more of your previous knowledge as you get more knowledge - in fact, if you work on a real project instead of a toy, you're probably going to be seeking out a lot more knowledge on your own as issues come up. In the end you're going to be able to say your proficient in your chosen area, and you'll probably be in a good place to expand to other areas (and you'll have a good sense of where you should expand to).

Re: Computer Science from the Bottom Up (2013)

#118

Thanks, I wrote this! It was a bit of a different time, when docbook was the way to publish, when Itanium was the 64-bit architecture, things like go and rust didn't exist and we used bitkeeper. But most of it is still relevant, and despite acquiring 2 kids since I started still have some ideas. Yes yes, it's not Alan Turing-esque computer science. I have taught algorithms and data structures courses as well as opera…

I've been looking for something like this for awhile now. I'm a very 'bottom-up' learner. Thank you.

Re: Computer Science from the Bottom Up (2013)

#119

Earlier quoted context omitted.

>When I see a compiler I just think "pfft, tokenizer, lexer, tree". When they see a compiler they think "I could never understand this in my life". To be fair, they're probably more correct in this context. Even if you understand the basics of compilation (and by the way, if you're reading this comment and you don't have a basic understanding of how compilation works, you should go learn that. Like, right now, if you…

The exercise isn't to put you ahead of everyone else. It is to get you to see where everyone else came from. I could try and run a marathon but I'm very out of shape. One of my friends can try and run a marathon who isn't out of shape and while they won't win they can still do it and learn from the experiance. The goal isn't to win, it's to learn in this case.

That wasn't my point. My point is, even if you know the theory behind compilers, and maybe have written a few yourself, you probably will have difficulty understanding GCC, Clang, or another production compiler unless you've done work with such a compiler before.

That is, your friends' awe of the compiler is not only justified given their skill level, it's also likely justified at your skill level as well (although as I don't know you personally, I can't say for sure).

Re: Computer Science from the Bottom Up (2013)

#120
post #103

Earlier quoted context omitted.

Of course. But OTOH, we shouldn't immidiately discount LLs when writing code, just because the perf isn't optimal. >but hardly means that we should be against writing fast software. On the contrary. Lisp is slow. Python is slow. Ruby is slow. Smalltalk is slow. What do these languages have in common? Dynamism. They trade speed for other that were, in the language designer's opinion, equally or more important than bei…

I wouldn't say it is the dynamism as much as the lack of control. Specifically, if you write your code non idiomatically and control all allocations, the languages probably gain a lot on speed. Unless you need inline assembly. Some lisps allow this. I find that taking these lessons to database access patterns helps a lot. Know your data access, and the data structure design has meaningful discourse. Don't know your a…

>Know your data access, and the data structure design has meaningful discourse. Don't know your access patterns? You are unable to pick the best one. Period.

Pretty much: if you don't know the access patterns, draw up a naive implementation so you can figure them out.

This is actually connected to one of the disadvantages of Lisp: because Lisp makes it so easy to draw up a naive datastructure based on LLs, it can take some effort to rip all that out and make something actually fast in its place.

>I wouldn't say it is the dynamism as much as the lack of control.

Don't undereatimate the cost of runtime dynamism. Lisp compilers have gotten pretty good at avoiding implementing it when possible, but there are pretty tight limits on how far you can go with that sort of optimization.

Essentially, every time you call a CLOS method, or you use eval, or you in any way introspect on your runtime state, or create the possibility for your code to do so at runtime, the code you are writing becomes more costly to run.

Post reply on HN