
{"id":633,"date":"2014-11-07T23:25:50","date_gmt":"2014-11-07T23:25:50","guid":{"rendered":"http:\/\/www.codergears.com\/Blog\/?p=633"},"modified":"2015-07-03T01:48:55","modified_gmt":"2015-07-03T01:48:55","slug":"how-it-was-the-c-source-code-25-years-ago","status":"publish","type":"post","link":"https:\/\/codergears.com\/Blog\/?p=633","title":{"rendered":"How it was the C source code 25 years ago"},"content":{"rendered":"<p>C is one of the most popular language around all the world, it was initially developed by Dennis Ritchie between 1969 and 1973 at AT&amp;T Bell Labs. Many thousands of projects was developed using C since then. It&#8217;s used for all kinds of needs, we can enumerate OS, embedded applications, gaming development, image processing, word processing and database engines.<\/p>\n<p><span style=\"color: #000000;\">It&#8217;s interesting to discover the evolution of a language, and how it evolved over years of feedbacks from developers and end users. We will go back 25 years ago to discover how some C projects was implemented.<\/span><!--more--><\/p>\n<p><strong>Back to 1990 the begining of Microsoft Word<\/strong><\/p>\n<p>The\u00a0developers\u00a0of\u00a0\u00a0these days\u00a0r<span style=\"color: #5b5b5b;\">emember\u00a0this was a time when a typical personal computer might have an 8 Mhz processor, 1 megabyte of memory, a 20 megabyte hard disk, and a floppy disk drive. It was a big challenge to develop a word processing application.<\/span><\/p>\n<p><span style=\"color: #5b5b5b;\">Microsoft released recently the &#8220;Microsoft Word 1.1&#8221; source code \u00a0in the \u00a0<a href=\"http:\/\/www.computerhistory.org\/atchm\/microsoft-word-for-windows-1-1a-source-code\/\">Copmuter History Museum.<\/a>\u00a0It is worth to take a look to its source code, even if it was implemented 25 years ago, we can learn very interesting techniques from it.<\/span><\/p>\n<p>Here&#8217;s a code snippet from its source code:<\/p>\n<p><a href=\"http:\/\/www.codergears.com\/Blog\/wp-content\/uploads\/c22.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-638\" src=\"http:\/\/www.codergears.com\/Blog\/wp-content\/uploads\/c22.png\" alt=\"c22\" width=\"770\" height=\"308\" \/><\/a><\/p>\n<p>As we can observe \u00a0the function was declared in K&amp;R style. \u00a0All the functions use the same style.<\/p>\n<p>When exploring many &#8220;Microsoft Word 1.1&#8221; source files\u00a0and analyzing many recently created C projects with <a href=\"http:\/\/www.cppdepend.com\">CppDepend<\/a>,\u00a0the interesting remark\u00a0is the fact that \u00a0the techniques used in \u00a0these projects not differ a lot from the &#8220;Microsoft Word 1.1&#8221; implementation ones.<\/p>\n<p>Let&#8217;s take as example\u00a0 the following source code:<\/p>\n<p><a href=\"http:\/\/www.codergears.com\/Blog\/wp-content\/uploads\/c11.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter  wp-image-637\" src=\"http:\/\/www.codergears.com\/Blog\/wp-content\/uploads\/c11.png\" alt=\"c1\" width=\"679\" height=\"422\" \/><\/a><\/p>\n<p>It seems that this code is from a C project created recently in GitHub. No sign that&#8217;s a code from 25 years ago.<\/p>\n<p><strong>1994 was the year of the first release version of Linux<\/strong><\/p>\n<p><span style=\"color: #252525;\">On 14 March 1994, Linux 1.0.0 was released, but the developement was \u00a0started\u00a0in 1991, thanks to Linus Trovalds and all the other contributors. The source code of this first version is available <a href=\"https:\/\/www.kernel.org\/pub\/linux\/kernel\/v1.0\/\">here<\/a>.<\/span><\/p>\n<p>Here&#8217;s a snippet code from the sched.c source file:<\/p>\n<p><a href=\"http:\/\/www.codergears.com\/Blog\/wp-content\/uploads\/c23.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter  wp-image-639\" src=\"http:\/\/www.codergears.com\/Blog\/wp-content\/uploads\/c23.png\" alt=\"c23\" width=\"705\" height=\"430\" \/><\/a><\/p>\n<p>When exploring the source files of Linux kernel version 1 and all the newest ones, the very surprising remark is the fact \u00a0they are very similar, no big changes in the style or the techniques used. From the beginning the code was simple, clean and basic.<\/p>\n<p><strong>Conclusion<\/strong><\/p>\n<p>After a brief trip in the past of some C source code projects, they are very few implementation techniques change \u00a0between them and the new C projects \u00a0ones.<\/p>\n<p>The power of C is its stability over years, it remains basic, no advanced mechanism was introduced\u00a0to the language, the code still simple to understand and maintain.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>C is one of the most popular language around all the world, it was initially developed by Dennis Ritchie between 1969 and 1973 at AT&amp;T Bell Labs. Many thousands of projects was developed using C since then. It&#8217;s used for all kinds of needs, we can enumerate OS, embedded applications, gaming development, image processing, word &hellip; <a href=\"https:\/\/codergears.com\/Blog\/?p=633\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;How it was the C source code 25 years ago&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-633","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/codergears.com\/Blog\/index.php?rest_route=\/wp\/v2\/posts\/633","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/codergears.com\/Blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/codergears.com\/Blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/codergears.com\/Blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/codergears.com\/Blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=633"}],"version-history":[{"count":10,"href":"https:\/\/codergears.com\/Blog\/index.php?rest_route=\/wp\/v2\/posts\/633\/revisions"}],"predecessor-version":[{"id":1809,"href":"https:\/\/codergears.com\/Blog\/index.php?rest_route=\/wp\/v2\/posts\/633\/revisions\/1809"}],"wp:attachment":[{"href":"https:\/\/codergears.com\/Blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=633"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/codergears.com\/Blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=633"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/codergears.com\/Blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=633"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}