Date: Thu, 4 Jun 2020 22:07:27 -0600 From: Brandon helsley <brandon.helsley@hotmail.com> To: freebsd-questions <freebsd-questions@freebsd.org>, Kurt Hackenberg <kh@panix.com> Subject: Re: Minimal skills Message-ID: <CY4PR19MB0104145694B8484F3AC9FB7EF9860@CY4PR19MB0104.namprd19.prod.outlook.com> In-Reply-To: <CY4PR19MB01041DACEFFEF08ADB096BC3F9890@CY4PR19MB0104.namprd19.prod.outlook.com> References: <CY4PR19MB01041DACEFFEF08ADB096BC3F9890@CY4PR19MB0104.namprd19.prod.outlook.com> <CY4PR19MB0104DC7541A2154B5C435EA7F9890@CY4PR19MB0104.namprd19.prod.outlook.com> <20200604074134.89eb6518.freebsd@edvax.de> <CY4PR19MB0104A2C03F4D66A1DA251A23F9880@CY4PR19MB0104.namprd19.prod.outlook.com> <20200604005859.ca438474.freebsd@edvax.de> <CY4PR19MB0104C290121BF756D57B2DDBF9880@CY4PR19MB0104.namprd19.prod.outlook.com> <20200604020051.0c02472d.freebsd@edvax.de> <CY4PR19MB0104DD86F8FE6446AD1BF327F9890@CY4PR19MB0104.namprd19.prod.outlook.com> <20200604074134.89eb6518.freebsd@edvax.de> <CY4PR19MB0104DC7541A2154B5C435EA7F9890@CY4PR19MB0104.namprd19.prod.outlook.com> <CY4PR19MB01041DACEFFEF08ADB096BC3F9890@CY4PR19MB0104.namprd19.prod.outlook.com>
next in thread | previous in thread | raw e-mail | index | archive | help
>Yes, that book is over 30 years old. C itself, and Unix, were invented together about 1970. (FreeBSD is a version of Unix; Linux is a different version of Unix.) >That is a classic book about C, and still valuable, but no longer complete. There were some additions to the language in 1999, and a couple smaller changes since. >C is useful to know around Unix systems, and there's a lot of existing software in the world written in C, but it's not used all that much for new projects. I say this even though I've used C and Unix for a long time. Then you are recommending new learning material for C? Is it C or C+ or C++ that I'm to be benefited to learn when working with freebsd? > > On Jun 4, 2020 at 9:00 PM, Kurt Hackenberg <kh@panix.com> wrote: > > > On 2020-06-04 17:02, Brandon helsley wrote: >> The canonical C book is: > > > > >https://www.pearson.com/us/higher-education/program/Kernighan-C-Programming-Language-2nd-Edition/PGM54487.html ...> The link you sent me for the c programming language is from 1988. Wouldn't it be better to use a newer study book? Should I look for something newer? Yes, that book is over 30 years old. C itself, and Unix, were invented together about 1970. (FreeBSD is a version of Unix; Linux is a different version of Unix.) That is a classic book about C, and still valuable, but no longer complete. There were some additions to the language in 1999, and a couple smaller changes since. C is useful to know around Unix systems, and there's a lot of existing software in the world written in C, but it's not used all that much for new projects. I say this even though I've used C and Unix for a long time. _______________________________________________ freebsd-questions@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org" > From owner-freebsd-questions@freebsd.org Fri Jun 5 04:23:55 2020 Return-Path: <owner-freebsd-questions@freebsd.org> Delivered-To: freebsd-questions@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 46FFA33E8DF for <freebsd-questions@mailman.nyi.freebsd.org>; Fri, 5 Jun 2020 04:23:55 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.17.10]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mout.kundenserver.de", Issuer "TeleSec ServerPass Class 2 CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49dTzt0MxFz3gnb for <freebsd-questions@freebsd.org>; Fri, 5 Jun 2020 04:23:53 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from r56.edvax.de ([178.8.33.179]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.183]) with ESMTPA (Nemesis) id 1MQvL7-1jMOTR0EPH-00O3VM; Fri, 05 Jun 2020 06:23:50 +0200 Date: Fri, 5 Jun 2020 06:23:49 +0200 From: Polytropon <freebsd@edvax.de> To: Brandon helsley <brandon.helsley@hotmail.com> Cc: freebsd-questions <freebsd-questions@freebsd.org> Subject: Re: Minimal skills Message-Id: <20200605062349.461e1e66.freebsd@edvax.de> In-Reply-To: <CY4PR19MB0104145694B8484F3AC9FB7EF9860@CY4PR19MB0104.namprd19.prod.outlook.com> References: <CY4PR19MB01041DACEFFEF08ADB096BC3F9890@CY4PR19MB0104.namprd19.prod.outlook.com> <CY4PR19MB0104DC7541A2154B5C435EA7F9890@CY4PR19MB0104.namprd19.prod.outlook.com> <20200604074134.89eb6518.freebsd@edvax.de> <CY4PR19MB0104A2C03F4D66A1DA251A23F9880@CY4PR19MB0104.namprd19.prod.outlook.com> <20200604005859.ca438474.freebsd@edvax.de> <CY4PR19MB0104C290121BF756D57B2DDBF9880@CY4PR19MB0104.namprd19.prod.outlook.com> <20200604020051.0c02472d.freebsd@edvax.de> <CY4PR19MB0104DD86F8FE6446AD1BF327F9890@CY4PR19MB0104.namprd19.prod.outlook.com> <20200604074134.89eb6518.freebsd@edvax.de> <CY4PR19MB0104DC7541A2154B5C435EA7F9890@CY4PR19MB0104.namprd19.prod.outlook.com> <CY4PR19MB01041DACEFFEF08ADB096BC3F9890@CY4PR19MB0104.namprd19.prod.outlook.com> <CY4PR19MB0104145694B8484F3AC9FB7EF9860@CY4PR19MB0104.namprd19.prod.outlook.com> Reply-To: Polytropon <freebsd@edvax.de> Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:GqHqSOWsmulWRNuGG5uzS11U5+2zm0LS795RkNL/vzgQxsdRufQ XB6z0gmcqOKKlJ1chM6XhUq2qZiIk+J2L+k8oSkKADSY1BHH5ZeanbfBZHx5g/rFWxHT6UN QlwaLBg6p4CewE7ojyzXOg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+ Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of freebsd@edvax.de has no SPF policy when checking 212.227.17.10) smtp.mailfrom=freebsd@edvax.de X-Spamd-Result: default: False [1.61 / 15.00]; HAS_REPLYTO(0.00)[freebsd@edvax.de]; RCVD_VIA_SMTP_AUTH(0.00)[]; MV_CASE(0.50)[]; HAS_ORG_HEADER(0.00)[]; TO_DN_ALL(0.00)[]; NEURAL_HAM_SHORT(-0.16)[-0.161]; RCPT_COUNT_TWO(0.00)[2]; FREEMAIL_TO(0.00)[hotmail.com]; RECEIVED_SPAMHAUS_PBL(0.00)[178.8.33.179:received]; RCVD_TLS_LAST(0.00)[]; R_DKIM_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:8560, ipnet:212.227.0.0/16, country:DE]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.73)[-0.730]; REPLYTO_EQ_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[edvax.de]; AUTH_NA(1.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_LONG(0.10)[0.099]; MID_CONTAINS_FROM(1.00)[]; RCVD_IN_DNSWL_NONE(0.00)[212.227.17.10:from]; R_SPF_NA(0.00)[no SPF record]; RWL_MAILSPIKE_POSSIBLE(0.00)[212.227.17.10:from]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: User questions <freebsd-questions.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/freebsd-questions>, <mailto:freebsd-questions-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/freebsd-questions/> List-Post: <mailto:freebsd-questions@freebsd.org> List-Help: <mailto:freebsd-questions-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/freebsd-questions>, <mailto:freebsd-questions-request@freebsd.org?subject=subscribe> X-List-Received-Date: Fri, 05 Jun 2020 04:23:55 -0000 On Thu, 4 Jun 2020 22:07:27 -0600, Brandon helsley wrote: > Then you are recommending new learning material for C? You don't do anything wrong by reading older C books like the original K&R, but don't assume that the language and its usage hasn't changed. Newer books will surely be written with ANSI C and newer standards in mind. Sometimes the older material can help you understand certain things better, maybe because newer material either assumes it as known, or simply doesn't mention it at all. It is never bad to know older versions of the C language because you will surely find code where you might be tempted to think: "Why did the programmer do it this way? C has a specific construct for that!" - except when the code was written, the C standard did _not_ have that specific construct, so the programmer had to invent it before its time. :-) Personally, I would say the best approach is to have an older and a newer book about C. The basic K&R material is _never_ wrong; add knowledge about the new standards, because you will also face code with those in mind. Here is something for illustration: https://olvemaudal.com/2011/10/10/deep-c/ Depending on what you want to deal with (in FreeBSD code), you'll need a certain level of understanding: not just the C language, but also the library functions used. Luckily all the sources are present in /usr/src, so when you encounter a bug, you can always find out _where_ it comes from, and therefore have a good starting point. Many years ago, I solved a data recovery problem by reading and modifying the code of the fsck program for the UFS filesystem, and reading the McKusick paper on UFS. Without understanding C, and without understanding how UFS works, I would not have been able to do so. > Is it C or C+ or C++ that I'm to be benefited to learn > when working with freebsd? FreeBSD (as the operating system) contains sources mostly in the form of C and assembly (here, primarily the drivers), but there's also C++, simply because there is no language that can be considered "one size fits all". You should probably know the fundamentals of C, so you recognize the typical elements of the language. From this foundation, you will be able to understand the purpose (!) of code, rather than just the components it is composed of. As FreeBSD consists of elements on different levels of complexity, such as boot code, standard libraries, user programs, filesystem code, device drivers, communication stacks, and so on, the means of implementation also differ. This is not a mistake - it's the logical conclusion. -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CY4PR19MB0104145694B8484F3AC9FB7EF9860>