Live data from Hacker News

Computer Science from the Bottom Up (2013)

bottomupcs.com

31–40 of 161 posts

Re: Computer Science from the Bottom Up (2013)

#31
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…

Computer science is not about computers; where does stuff like algorithms fit into this? What is a "true scottsman" of CS? Low level programmers? What about people that have pioneered the theory of computer science? The likes of Karp, Valiant, Cook, Blum, Vazirani, Papdimitriou, Micali, Goldwasser, Goldreich, Shamir, Rivest and etc.? I doubt these people know the inner workings of computers, but they have revolutioni…

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 problem and on the other have reached a point where you see why the tool is used.

You can sit a person in front of a whiteboard all you want. Brainwash them about arrays, maps, matricies, trees and graphs and they have a high likely hood of coming out knowing nothing but verbatum what you have told them. Conversly you cannot sit a person in front of a computer, guide them through the exercises that I described, and expect the same as the student who once sat in front of the whiteboard.

Trees grow from seeds and the best way to plant these seeds are not with an expo marker but, in my opinion, by bringing the student to a crossroads where they need to discover a concept on their own. This is a common tactic in game design: allow the player to discover new rules after you've taught them the basic foundation.

After they understand the basic foundation of how they will be interacting with the machine I think that, with the guidance of the correct assignements in the notebook codesegment phase of the program, the student will be able to create these different routines and ideas on their own.

Some such examples I will provide below:

   - Make some way that will allow you to find a number between two possitions in memory
   - Make a wrapper for this routine that will operate from a starting possition and an offset of the size
   - Make a way to find the distance between two points on an X, Y plane
   - Find a way to apply the same transformation in every item between two points in memory
   - Find a way to implement a way of storing data about an X, Y plane. For instance where a dot is on a section of graph paper
   - Make a subroutine that will allow you to store potentially infinite items in a collection. There are many ways to approch this but the three main ones are to: use a section of memory that is preallocated and reallocated when it is filled, make some way to daisy chain items of the list together possibly by wrapping them in in more data that will serve to aid your program, do the same as the daisy chain but allow the chain to coninue in more then one direction. Hint: this will probably need an init_, add_, remove_, free_ 

This would take a long time but under the correct stimulating guidance the student will be able to seek out why they need these tools. These tasks should be presented after they've completed a project that someone in our position knows that the optimal way of solving the problem was not choosen and a more abstract and simple solution exists. These situations will present themselves often. I've possitioned myself to make these suggestions to my peers at my university who are having a very difficult time passing the classes we are in together. The people who need to see why AND how.

I'll look at their work and say "how about try using X method of solving the problem and show me what you come up with" and when they come up with a solution I say "now try and make it a library. Remove it from your current solution and allow yourself to use it for further work on other projects".

This changes the way they think about programing.

Re: Computer Science from the Bottom Up (2013)

#32
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…

If you have an audience that is even interested in C (they came specifically to learn about it) it is probably safe to assume that they are interested in lower levels of tech simply by the popular association between C and that.

People benefit from context. A "how stuff is made" tour might help. I would show the newbies all the steps: how we start with a piece of C source, and go to executable. Here is a simple program that adds two numbers. Okay, we pass it through this compiler and here it is in the processor-specific assembly language, which is quite different. The "plus" is being done by this ADD instruction here, which receives values from two internal data places in the processor called registers, which are a bit like the storage boxes in a pocket calculator. Then, assembly language is coded, nearly instruction by instruction, to machine code, which is these numbers here representing ones and zeros. This is a bit like sheet music for piano being translated to a punched paper piano roll, but even more direct.

Re: Computer Science from the Bottom Up (2013)

#33
post #28

Is this more about the science vs the trade? I do wonder if a practical foundation helps people understand and go deeper into the science. When I did a computer science degree from the University of Victoria, Canada, 1996+, it more started from the "bottom". Though if I remember assembler was being moved or removed from second second year. On the other hand before I finished for new students discrete mathematics, mat…

UVic has a helpful graph of their course requirements now: https://www.csc.uvic.ca/Program_Information/Undergraduate_St...

from https://www.csc.uvic.ca/Program_Information/Undergraduate_St...

For course details http://web.uvic.ca/calendar2016-09/CDs/CSC/CTs.html

http://web.uvic.ca/calendar2016-09/CDs/SENG/CTs.html

Re: Computer Science from the Bottom Up (2013)

#34
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…

Computer science is not about computers; where does stuff like algorithms fit into this? What is a "true scottsman" of CS? Low level programmers? What about people that have pioneered the theory of computer science? The likes of Karp, Valiant, Cook, Blum, Vazirani, Papdimitriou, Micali, Goldwasser, Goldreich, Shamir, Rivest and etc.? I doubt these people know the inner workings of computers, but they have revolutioni…

> Increasingly today the underlying architecture, for most intents, is becoming irrelevant

... amidst cries from a handful of lunatics who insist we shouldn't be using linked lists any more because they don't use the L1 cache very well compared to arrays.

Re: Computer Science from the Bottom Up (2013)

#35

Earlier quoted context omitted.

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…

Algorithms and complexity theory are independent of any physical model of computation; they capture what it means to compute . The entire field of theoretical computer science stands as a counterexample to your comment. Computer science is not about software engineering.

An algorithm that is infinitly complex and takes infinite time is of no practical use in every day computation. Maybe in theory, in textbooks, in labcoats, but not in industry.

I don't know where an uncomputable algorithm would be useful.

I do know that you cannot possibly start a student out on a plane of the purely theoretical as they cannot see the value of what they are learning, they cannot understand the implications of the material, and frankly they won't remember it if they don't need it. To their minds, they don't need it if they haven't used it. It can be JFM (Just Fking Magic) to them if they haven't seen a case where it has improved their own algorithms. They will also not really understand how it works with no implementation. It is impractical to say the least.

Theoretical computation is a higher level topic then real computation topic. In the same sense that you start math with addition, subtraction, multiplication, and division you should start out computer science with implementation.

Re: Computer Science from the Bottom Up (2013)

#36
post #8

Based on the comments I see here (about how they wished to learn CS, or CS vs EE), I wish this book had a different title with more of an indication that this is a operating systems book (though not 100%). Computer Science is more than what is presented here. Big O Notation/Data Structures/Algorithms, ala Dr. Knuth Proof and theorems Computer architecture and design (NAND gates and the like) Language design, interpre…

I agree, the book isn't very "bottom-up" at all, perhaps with the exception of "Binary and Number Representation" being the second chapter; the rest of it looks like OS stuff. This is what I'd consider "bottom up": https://www.amazon.com/Code-Language-Computer-Hardware-Softw...

My choice for bottom-up book: The Elements of Computing Systems: Building a Modern Computer from First Principles https://www.amazon.com/Elements-Computing-Systems-Building-P...

Re: Computer Science from the Bottom Up (2013)

#37
post #9

Earlier quoted context omitted.

I remember trying do do that years ago, and getting hung up as a newbie on there being a million different LISP implementations. I think I tried to use Racket, if I remember correctly, but whatever I picked didn't support some of the book's LISP statements out of the box. Any recommendations for a more friction-free experience?

I remember trying to learn a garbage-collected language with curly braced blocks, functions and infix operators years ago, but was hung up on there being a million implementations. I think I tried to use Java, but was hung up on the book's C# statements that weren't supported out of the box. Any recommendations for a more-friction free experience? How about this recommendation: use the exact same language that your b…

I don't think this is a fair comparison to what the GP is saying. You can pick up pretty much any book on programming for the C-style and more then 90% of the information will transfer over. Classes may be omitted in some, reqired in others. The same may apply to types. But after they see a compiler warning you're likely to google it and figure out what's wrong very easily.

On the other hand most people, who are quite professional in our field I might add, don't even know the names of the most used LISP derivatives. Many also don't even realize they have one built into their browser that is perfectly adequate for satisfying the desires to explore functional programming and general computation principles.

This isn't a statement of malice or even a bad question from the GP. It is confusing and we only have ourselves to blame for this (ourselves being the world of people who want FP to become more mainstream in the SE world).

Look at the stark differences in these two websites:

   - http://racket-lang.org/
   - https://www.rust-lang.org/
What we need is this (with much less crap):

   - https://www.python.org/
And what we don't need is this (with all of this text and few examples of what you CAN do):

   - http://julialang.org/

Granted these are for different markets but the point still stands. If you want adoption by the general software development communities we must make a good case as to why this move should be made. Historically this required a few factors

   1. A better alternative to at least 1 problem *
   2. A simple unified way of introducing people to the change
   3. Simple support for the rollover. Or at least simple enough as to not overpower the benifits presented by switching over.
* = Something that has already been done by the FP community.

You have to understand that peeople call it like they see it and when they see Lots of Insane and Silly Parrens they see LISP and no name change will disaccosiate Scheme, Racket, and LISP in the eyes of the average programmer. I've been using functional languages for a good part of my life as a programmer and I feel they ARE the same. The ideas are common even if their presentation isn't.

The only LISP-Like languages that have sucessfully hid from the tarnished name of LISP are JavaScript and Python and they've managed to develop their own bad raps for themselves in the eyes of some programmers.

No progress will be made by barrating people. Prucussive maintence works on tools and gear, not peers.

Re: Computer Science from the Bottom Up (2013)

#38
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 also advocate for starting with the low-level basics, although slightly lower - logic gates. Students should start off building circuits using 74-series ICs on a breadboard, while learning about Boolean logic. If the resources to work with actual hardware aren't available, a logic simulator should suffice. This is something that I think even young kids would be comfortable with doing: simple circuits to "compute" simple logic.

Then introduce binary maths and how that can also be computed using logic gates, and the concept of sequential circuits (flip-flops, latches, registers) --- allowing one to build a simple adding machine with memory. From there it's a short jump (no pun intended) to a basic CPU that interprets its data as instructions (critical concept!), and the rest follows naturally.

IMHO it's "interpretation of data" that is the key concept, regardless of whether you're working in high or low level, and that comes directly from understanding the basics.

Re: Computer Science from the Bottom Up (2013)

#39

Earlier quoted context omitted.

Computer science is not about computers; where does stuff like algorithms fit into this? What is a "true scottsman" of CS? Low level programmers? What about people that have pioneered the theory of computer science? The likes of Karp, Valiant, Cook, Blum, Vazirani, Papdimitriou, Micali, Goldwasser, Goldreich, Shamir, Rivest and etc.? I doubt these people know the inner workings of computers, but they have revolutioni…

> Increasingly today the underlying architecture, for most intents, is becoming irrelevant ... amidst cries from a handful of lunatics who insist we shouldn't be using linked lists any more because they don't use the L1 cache very well compared to arrays.

In some contexts this optimizations make no sense. In others you'd be laughed out of the office for suggesting that you should use a linked list. You'd be shitcanned before you got back to your office.

In the same sense if you're in a python shop doing web development and you say "EVERYONE we need to STOP using python and write ALL of our HTTP code in C! We'll be able to optimize the hell out of it and probably save 10K of memory per request! That's HUGE!" you would also in tern be shitcanned before you finished the sentence.

If you take that same exact mentality and bring it to a company that builds realtime systems that do DSP and maybe even handle some user interaction in an embeded form facter and you say "EVERYONE! I've found that if we replace our current memory allocator with a circular buffer and pre-allocate everything in an SRAM we can get power-off tolerance AND allow ourselves to make use of all of our memory while not even needing to WASTE the cyles on freeing our memory! We'll save on the oders of 1ms over 50actions! That's a HUGE boon for our batter life!" you'd walk out the head of the office. Saving 500ns, 100 bytes, or even improving something on that scale no matter what it is in contect is huge.

The problem boils down to one thing. For the embeded systems people saving 1MS may be on the oder of 20% of their runtime. For the python shop saving 10K of memory is probably on the oder of sub-00.001% of their memory usage.

It is all about context.

(Disclaimer: I have changed from LL to arrays in some applications because it made a measurable improvement to the speeds of my systems.)

Re: Computer Science from the Bottom Up (2013)

#40

Earlier quoted context omitted.

Computer science is not about computers; where does stuff like algorithms fit into this? What is a "true scottsman" of CS? Low level programmers? What about people that have pioneered the theory of computer science? The likes of Karp, Valiant, Cook, Blum, Vazirani, Papdimitriou, Micali, Goldwasser, Goldreich, Shamir, Rivest and etc.? I doubt these people know the inner workings of computers, but they have revolutioni…

> Increasingly today the underlying architecture, for most intents, is becoming irrelevant ... amidst cries from a handful of lunatics who insist we shouldn't be using linked lists any more because they don't use the L1 cache very well compared to arrays.

Software is an inverted pyramid, most programmers don't need to know the low-level bits. However if you don't have at least someone to hold up the lower layers of the pyramid then everything falls over.

Performance and memory is one of those weird things where it doesn't matter until it does, and then it really matters. I can't count the number of projects I've been on where there wasn't a way to "scale" out, we had fixed resources and the only path forward was deep low level optimizations.

Post reply on HN