[C++] Tutorial in progress

Started by
24 comments, last by ToohrVyk 16 years, 9 months ago
Quote:Original post by _goat
If I may take the audacity to summarise several posts here: You assume too much that the reader knows the definitions of the terms you are using. For example, you don't even explain what "programming" is, and unless you're targeting these tutorials at people whom already know one or more languages, it's probably best you cover that, as even at that point there can be misconceptions. Other examples include (some taken from observation, and some raised in previous posts): "language", "source code", "execute", "header files", etc.


Added more explanations.

Advertisement
Hi, I think I've found a syntax fault in your stylesheet file while learning from your code.

"http://www.nicollet.net/style.css":
body{  margin:                     auto;  padding:                    auto;  font-family:                verdana;  font-size:                  10pt;  width:                      1000px;}a{  text-decoration:            none;}a:hover{  text-decoration:            underline;}p{  width:                      600px;}/* ======================================================================== */div.code{  border-top:                 solid 1px #888;  border-bottom:              solid 1px #888;  background-color:           #EEE;  padding:                    3px;}div.code pre{  margin:                     0px;}div.code span.keyword{  color:                      #00F;}div.code span.special{  color:                      #088;}div.code span.literal{  color:                      #B00;}div.code span.comment{  color:                      #0B0;}div.code span.operator{  color:                      #888;}/* ======================================================================== */div.error{  border:                     solid 1px red;  background-color:           #FCC;}/* ======================================================================== */div.header{  width:                      1000px;  border-bottom:              double #888 3px;  margin-bottom:              3px;  padding:                    0px;}div.header img.logo{  float:                      left;  width:                      96px;  height:                     96px;  border:                     solid 1px #888;  margin:                     3px;}div.header h1{  float:                      left;  width:                      890px;  height:                     74px;  margin:                     3px;  font-size:                  36px;  font-variant:               small-caps;}div.header div.above{  float:                      left;  margin:                     3px;  width:                      890px;  height:                     20px;  font-size:                  16px;  font-family:                verdana;}div.header div.above img{  float:                      left;  margin:                     1px;}div.header br{  clear:                      both;}/* ======================================================================== */div.navigation{  float:                      left;  width:                      198px;               margin:                     1px;  font-size:                  12px;}div.navigation ul{  margin-top:                 1px;  margin-left:                0px;  padding-left:               3px;}div.navigation li{  margin-left:                20px;  list-style:                 square;}div.navigation li.category{  margin-left:                0px;  font-weight:                bold;  list-style:                 none;}/* ======================================================================== */div.see{  border:                     1px solid #888;  background-color:           #DDD;  font-size:                  120%;  padding:                    3px;  width:                      600px;  margin:                     5px auto 5px auto;}div.see div.desc{  font-size:                  75%;  padding-left:               20px;}/* ======================================================================== */div.content{  border-left:                1px solid #888;  float:                      left;  width:                      790px;  margin:                     1px 1px 1px -17px;  padding:                    3px 3px 3px 20px;  min-height:                 400px;  text-align:                 justify;}div.content h2{  margin-left:                -17px;  font-variant:               small-caps;  text-decoration:            underline;  font-weight:                normal;}div.content h3{  margin-left:                -10px;  font-variant:               small-caps;  text-decoration:            underline;  font-weight:                normal;}div.content h4{  margin-left:                -5px;  font-variant:               small-caps;  text-decoration:            underline;  font-weight:                normal;}/* ======================================================================== */div.footer{  clear:                      both;  border-top:                 double #888 3px;  text-align:                 center;  color:                      #888;}============================= */div.footer{  clear:                      both;  border-top:                 double #888 3px;  text-align:                 center;  color:                      #888;}888;}


The last bit here:
div.footer{  clear:                      both;  border-top:                 double #888 3px;  text-align:                 center;  color:                      #888;}============================= */div.footer{  clear:                      both;  border-top:                 double #888 3px;  text-align:                 center;  color:                      #888;}888;}

I guess that the bold last section shouldn't be.
div.footer{  clear:                      both;  border-top:                 double #888 3px;  text-align:                 center;  color:                      #888;}============================= */div.footer{  clear:                      both;  border-top:                 double #888 3px;  text-align:                 center;  color:                      #888;}888;}


Or is it valid? If so I want know how that syntax is,
but it doesn't look like it is.

Good tutorial BTW!
Quote:Original post by programering
Or is it valid? If so I want know how that syntax is,
but it doesn't look like it is.


It isn't valid. It's actually the result of me being utterly r0xx0red by ncftp. I've re-uploaded the file, and all is well now. Thanks for mentioning it [wink]

Looks good, but I'd recommend changing "The C++ language is said to be strongly typed" to "The C++ language is said to be statically typed". Strongly typed, statically typed and typed are all often used to mean the same thing, but strongly typed and weakly typed are also often used to refer to sound vs unsound type systems. Under this terminology, C++ would be weakly typed and ML would be strongly typed. This might lead to confusion for the reader later. "Statically typed" is not ambiguous.
Quote:Original post by Rebooted
Strongly typed, statically typed and typed are all often used to mean the same thing, but strongly typed and weakly typed are also often used to refer to sound vs unsound type systems. Under this terminology, C++ would be weakly typed and ML would be strongly typed. This might lead to confusion for the reader later. "Statically typed" is not ambiguous.


I'd tend to consider that the C++ type system is sound, as long as the user doesn't take explicit steps to disable the type system (using one of the various cast operators)—and if the existence of explicit type-system-avoding cast operations had an impact on the strength of a type system, Obj.magic would be a nasty blow to the (O'Ca)ML type system [smile]

I certainly take that strongly typed statement as a contrast with C being weakly typed.
I rewrote the part on functions (chapter 2) in a clarification attempt.

This topic is closed to new replies.

Advertisement