Lecture 4 | Programming Paradigms (Stanford)
December 14th, 2011 by CGI & PHP.com
Lecture by Professor Jerry Cain for Programming Paradigms (CS107) in the Stanford University Computer Science department. In this lecture, Prof. Cain discusses C and C++ programming, including bit patterns, memory copy, and linear search. Programming Paradigms (CS107) introduces several programming languages, including C, Assembly, C++, Concurrent Programming, Scheme, and Python. The class aims to teach students how to write code for each of these individual languages and to understand the programming paradigms behind these languages. Complete Playlist for the Course: www.youtube.com CS 107 Course Website: www.CS107.stanford.edu Stanford University: www.stanford.edu Stanford University Channel on YouTube: www.youtube.com
Popularity: 1% [?]

Lecture 2 | Programming Paradigms (Stanford)
Lecture 6 | Programming Paradigms (Stanford)
Lecture 5 | Programming Paradigms (Stanford)
Lecture 3 | Programming Paradigms (Stanford)
Lecture 1 | Programming Paradigms (Stanford)
Lecture 2 | Programming Methodology (Stanford)





December 14th, 2011 at 7:12 am
More english!
December 14th, 2011 at 7:34 am
No one is using 16 bit systems. What is pertinent is that the long type is always the word size of the machine It is very common in contemporary compilers to have int and long be the same size. Check: This is why God invented the sizeof operator.
December 14th, 2011 at 8:11 am
@deathbyaccident
bytes, which is 2 bytes. Does that make sense to people? lol
There are eight bits in a byte; byte stands for By-Eight. So 16 bits is equal to 16/8 (16 by
December 14th, 2011 at 8:30 am
@deathbyaccident
> 16/8 == 4
False
December 14th, 2011 at 9:12 am
@tapajara haha you fail at acting smart 16 bits is 4 bytes
December 14th, 2011 at 9:42 am
You should point out that an "int" is only 16 bits in a 16-bit system. You should be using "long" instead of "int" in your examples.
December 14th, 2011 at 10:28 am
@dimipeli
yea i think this as well.. and being from stanford they wouldnt make as many mistakes as other "normal" univerisites? Maybe i am wrong? But i do like this teacher!
December 14th, 2011 at 11:27 am
At 43:30 he is using a "hack". He casts base to char* and he mentions that it is also possible to use an unsigned long* instead of char*. Why is it possible to use unsigned long*? Unsigned long is a 4 byte datatype, char 1 byte.
December 14th, 2011 at 12:21 pm
At 43:30 he is using "hack". He casts base to char* and he mentions that it is also possible to use an unsigned long* instead of char*. Why is it possible to use unsigned long*? Unsigned long is a 4 byte datatype, char 1 byte.
December 14th, 2011 at 12:37 pm
Oh now hes all pointers no longer busy and hes all slow..
December 14th, 2011 at 12:44 pm
Very clear and concise. I dare say he made sense. I much agree with the C comparison to a stick shift too. On the rare occasion of driving an automatic, I find my foot wandering off to some nonexistent clutch (or parking brake) when I come to a stop. One just gets used to the control after awhile and C/C++ offers that control.
December 14th, 2011 at 12:59 pm
@dimipeli Yeah, he does. But sometimes students' questions aren't well-formed and understandable, so as soon as the lecture is being filmed, he has no time for such things. Would you like to see how he tries to understand students' questions for 1 minute or so instead of telling new information? I wouldn't.
December 14th, 2011 at 1:39 pm
He makes some mistakes here and there, and misinterprets some of the students' questions, but he is still a good lecturer.
December 14th, 2011 at 2:15 pm
"Does it make sense?" "You got to nod" XD
Jerry lecture style is so Mr Mackey. He's very informative, really knows his stuff, but I'd be annoyed by his constant "Does it make sense?" if I was sitting there…
Bud I find myself nodding along.
December 14th, 2011 at 2:57 pm
huh?
December 14th, 2011 at 3:56 pm
@NameNotaNumber A good programmer knows at least one language from the different programming types.
December 14th, 2011 at 4:37 pm
good teaching.
December 14th, 2011 at 4:56 pm
great tutor
December 14th, 2011 at 5:37 pm
Thanks Jerry for the great lectures.
December 14th, 2011 at 6:32 pm
@3dfabio "After a long and arduous process, the standard was completed in 1989 and ratified as ANSI X3.159-1989 "Programming Language C." This version of the language is often referred to as "ANSI C", or sometimes "C89" (to distinguish it from C99)."
December 14th, 2011 at 6:35 pm
He's good. I actually kind of more appreciate C now for the raw power it puts in the hands of programmers through all the pure bit copying and comparison operations. He actually covers some hacks, like casting to char* to do pointer arithmetic on 1 byte memory space so that normal arithmetic can be done to calculate the correct address offset. The later parts on the Fred and Wilma strings are good as well, shows how C can be abused.
December 14th, 2011 at 6:36 pm
@tincho81 that style is legal in ANSI C99.
December 14th, 2011 at 7:08 pm
if thats the case you shouldn't be watching this, it's fairly advanced.
December 14th, 2011 at 7:09 pm
it should be for(int i = 0; i < n; i++) ..
and n should be declare before.. by something
December 14th, 2011 at 7:15 pm
I do not get programming at all.