Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.arch.embedded > #27264
| From | David Brown <david.brown@hesbynett.no> |
|---|---|
| Newsgroups | comp.arch.embedded |
| Subject | Re: Embedded platforms for beginners? |
| Date | 2017-09-06 09:57 +0200 |
| Organization | A noiseless patient Spider |
| Message-ID | <ooo9p5$unn$1@dont-email.me> (permalink) |
| References | (10 earlier) <2i5rB.35182$OC1.2645@fx06.iad> <87o9qrm3xw.fsf@nightsong.com> <CV5rB.34451$WI2.28011@fx38.iad> <oom4gs$57r$1@dont-email.me> <b0jtqctem62cf5ue86k91n6pii7she0atb@4ax.com> |
On 05/09/17 18:35, George Neuner wrote: > On Tue, 05 Sep 2017 14:15:23 +0200, David Brown > <david.brown@hesbynett.no> wrote: > >> On 04/09/17 07:55, Clifford Heath wrote: >> >>> Please, why don't you copy/paste all the content from >>> http://www.memorymanagement.org/ >>> There might be some people here who have not read it all yet. >>> Sigh... Yes, there is a whole domain of science here. >>> Far, far more than you have reminded us of yet. >> >> I had a little look at that site. It had some useful explanations, but >> is /seriously/ biased. It gives the impression that the only reason you >> would /not/ want garbage collection is if you want your program to be >> bloated, slow, inefficient, waste memory - and leak resources, have >> buffer overflows and other nasal daemons. > > Unfortunately, the pro-GC bias is one that is firmly rooted in > reality. > Garbage collection certainly has its advantages - but equally it is not a magic wand that solves all memory problems, nor is it the right tool in all situations. > In this forum we get a distorted view because the general skill level > of embedded developers is relatively high. > True. And we also tend to avoid dynamic memory as much as possible! > In the broader programming world, the average skill level is just > slightly above "script kiddy". The headlong march to "managed" > languages such as Java, C#, Python, etc. is industry acknowledging > that the average programmer simply can't write a complex program > without hand-holding. On PC's, I usually write in Python - and the automatic memory management is one of the nice things about the language. In that context, I absolutely agree that automatic memory management and garbage collection is the right way to go. My point is just that there are other situations, other types of programming - and other solutions. The website there was written like a marketing campaign rather than an unbiased reference. As well as dismissing C-style memory management out of hand, it described C++'s methods as "even harder" with no basis whatsoever (RAII and synchronous destructors makes memory management far easier) and pretty much ignored smart pointers altogether. It also ignores the problems of garbage collection. In particular, it is very easy to get circular references in complex structures, and it is easy to get memory leaks in garbage collected systems. Garbage collection makes the issues of memory management different - it is not a magic fix-all solution. It lets you avoid the micro-managing and write simpler code, but it does not fix everything. It just teaches a generation of programmers that it does not matter if your Python program leaks 100K memory an hour - that's only a GB a year, and everyone has gigabytes to spare. > > And it isn't just memory management ... the runtimes of these > languages also - in whole or in part - manage files, network > connections, threads, synchronize object access, etc. They do indeed - but that is a process that is mostly independent of garbage collection. The only direct connection is that by making your clean-up happen asynchronously and behind the scenes, you have lost control of where your tidy-up is done. With C++, your file will be closed by the file object's destructor. That means your code that /uses/ the file object does not need to have the close file logic, but you know the file will be properly closed when the using function exits by return or exception. With a garbage collected language, you have the choice of manually putting in the "close" call in your using function, carefully catering for try/except/finally blocks to make sure it is handled in exceptions, or you put it in the object's finaliser to be run eventually, at an unknown time in an unknown order. For Python (as the gc'ed language I use most), you just assume it will all be tidied up sooner or later. It works because garbage collection runs regularly so it won't be /too/ long before the destructor is called. > > C isn't even being taught in a lot of schools now, so even those who > have a (relatively) recent CS/IS degree may have no experience of > programming that requires manual resource management. > > > All in all, general software development is a sorry state of affairs > that is getting worse with every passing year. I have stated in the > past my belief that the majority of software "developers" would be > doing the world a favor by finding another occupation. > I certainly think that most people who program in C, should be using other languages. And most programs that are written in C, would be better written in other languages. (Embedded development is major exception, though even here there are alternatives.) And the memory management in C is a big reason for that opinion. But telling people that garbage collection is always the best choice and that it solves all memory and resource problems, is not the answer. It's like saying if you buy a car with automatic gears, collision detection with automatic breaking, etc., then you don't need to learn to drive properly.
Back to comp.arch.embedded | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Embedded platforms for beginners? Elof Huang <elof.huang@runbox.com> - 2017-09-01 14:07 +0800
Re: Embedded platforms for beginners? Jack <jack4747@gmail.com> - 2017-08-31 23:22 -0700
Re: Embedded platforms for beginners? rickman <gnuarm@gmail.com> - 2017-09-01 04:10 -0400
Re: Embedded platforms for beginners? Clifford Heath <no.spam@please.net> - 2017-09-01 21:49 +1000
Re: Embedded platforms for beginners? Elof Huang <elof.huang@runbox.com> - 2017-09-02 11:57 +0800
Re: Embedded platforms for beginners? Clifford Heath <no.spam@please.net> - 2017-09-02 18:25 +1000
Re: Embedded platforms for beginners? Elof Huang <elof.huang@runbox.com> - 2017-09-03 15:37 +0800
Re: Embedded platforms for beginners? Clifford Heath <no.spam@please.net> - 2017-09-03 17:54 +1000
Re: Embedded platforms for beginners? rickman <gnuarm@gmail.com> - 2017-09-03 13:49 -0400
Re: Embedded platforms for beginners? Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> - 2017-09-02 11:41 -0400
Re: Embedded platforms for beginners? Clifford Heath <no.spam@please.net> - 2017-09-03 09:44 +1000
Re: Embedded platforms for beginners? Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> - 2017-09-02 20:39 -0400
Re: Embedded platforms for beginners? Clifford Heath <no.spam@please.net> - 2017-09-03 11:16 +1000
Re: Embedded platforms for beginners? Paul Rubin <no.email@nospam.invalid> - 2017-09-02 18:21 -0700
Re: Embedded platforms for beginners? Clifford Heath <no.spam@please.net> - 2017-09-03 14:26 +1000
Re: Embedded platforms for beginners? rickman <gnuarm@gmail.com> - 2017-09-03 02:14 -0400
Re: Embedded platforms for beginners? Clifford Heath <no.spam@please.net> - 2017-09-03 17:52 +1000
Re: Embedded platforms for beginners? rickman <gnuarm@gmail.com> - 2017-09-03 13:50 -0400
Re: Embedded platforms for beginners? Paul Rubin <no.email@nospam.invalid> - 2017-09-03 22:20 -0700
Re: Embedded platforms for beginners? rickman <gnuarm@gmail.com> - 2017-09-05 22:06 -0400
Re: Embedded platforms for beginners? Clifford Heath <no.spam@please.net> - 2017-09-06 12:21 +1000
Re: Embedded platforms for beginners? rickman <gnuarm@gmail.com> - 2017-09-05 22:42 -0400
Re: Embedded platforms for beginners? Clifford Heath <no.spam@please.net> - 2017-09-06 14:26 +1000
Re: Embedded platforms for beginners? rickman <gnuarm@gmail.com> - 2017-09-06 01:20 -0400
Re: Embedded platforms for beginners? George Neuner <gneuner2@comcast.net> - 2017-09-03 15:58 -0400
Re: Embedded platforms for beginners? Clifford Heath <no.spam@please.net> - 2017-09-04 08:00 +1000
Re: Embedded platforms for beginners? Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> - 2017-09-03 19:13 -0400
Re: Embedded platforms for beginners? Clifford Heath <no.spam@please.net> - 2017-09-04 09:58 +1000
Re: Embedded platforms for beginners? Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> - 2017-09-03 20:16 -0400
Re: Embedded platforms for beginners? Clifford Heath <no.spam@please.net> - 2017-09-04 15:13 +1000
Re: Embedded platforms for beginners? Paul Rubin <no.email@nospam.invalid> - 2017-09-03 22:24 -0700
Re: Embedded platforms for beginners? Clifford Heath <no.spam@please.net> - 2017-09-04 15:55 +1000
Re: Embedded platforms for beginners? David Brown <david.brown@hesbynett.no> - 2017-09-05 14:15 +0200
Re: Embedded platforms for beginners? George Neuner <gneuner2@comcast.net> - 2017-09-05 12:35 -0400
Re: Embedded platforms for beginners? Rob Gaddi <rgaddi@highlandtechnology.invalid> - 2017-09-05 10:02 -0700
Re: Embedded platforms for beginners? Tom Gardner <spamjunk@blueyonder.co.uk> - 2017-09-05 18:13 +0100
Re: Embedded platforms for beginners? David Brown <david.brown@hesbynett.no> - 2017-09-06 10:24 +0200
Re: Embedded platforms for beginners? Paul Rubin <no.email@nospam.invalid> - 2017-09-05 17:10 -0700
Re: Embedded platforms for beginners? David Brown <david.brown@hesbynett.no> - 2017-09-06 09:57 +0200
Re: Embedded platforms for beginners? Paul Rubin <no.email@nospam.invalid> - 2017-09-05 16:57 -0700
Re: Embedded platforms for beginners? Paul Rubin <no.email@nospam.invalid> - 2017-09-05 16:54 -0700
Re: Embedded platforms for beginners? Clifford Heath <no.spam@please.net> - 2017-09-06 12:31 +1000
Re: Embedded platforms for beginners? Paul Rubin <no.email@nospam.invalid> - 2017-09-05 19:42 -0700
Re: Embedded platforms for beginners? David Brown <david.brown@hesbynett.no> - 2017-09-05 10:16 +0200
Re: Embedded platforms for beginners? Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> - 2017-09-05 16:56 -0400
Re: Embedded platforms for beginners? Tom Gardner <spamjunk@blueyonder.co.uk> - 2017-09-04 10:46 +0100
Re: Embedded platforms for beginners? Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> - 2017-09-05 17:09 -0400
Re: Embedded platforms for beginners? Paul Rubin <no.email@nospam.invalid> - 2017-09-05 19:35 -0700
Re: Embedded platforms for beginners? Clifford Heath <no.spam@please.net> - 2017-09-06 12:40 +1000
Re: Embedded platforms for beginners? Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> - 2017-09-06 00:42 -0400
Re: Embedded platforms for beginners? Tom Gardner <spamjunk@blueyonder.co.uk> - 2017-09-06 08:55 +0100
Re: Embedded platforms for beginners? Tom Gardner <spamjunk@blueyonder.co.uk> - 2017-09-06 08:45 +0100
Re: Embedded platforms for beginners? Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> - 2017-09-07 20:23 -0400
Re: Embedded platforms for beginners? Tom Gardner <spamjunk@blueyonder.co.uk> - 2017-09-08 08:42 +0100
Re: Embedded platforms for beginners? David Brown <david.brown@hesbynett.no> - 2017-09-08 12:07 +0200
Re: Embedded platforms for beginners? Tom Gardner <spamjunk@blueyonder.co.uk> - 2017-09-08 11:40 +0100
Re: Embedded platforms for beginners? David Brown <david.brown@hesbynett.no> - 2017-09-08 13:24 +0200
Re: Embedded platforms for beginners? Tom Gardner <spamjunk@blueyonder.co.uk> - 2017-09-08 13:36 +0100
Re: Embedded platforms for beginners? Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> - 2017-09-09 13:16 -0400
Re: Embedded platforms for beginners? Les Cargill <lcargill99@comcast.com> - 2017-09-10 08:53 -0500
Re: Embedded platforms for beginners? Dimiter_Popoff <dp@tgi-sci.com> - 2017-09-10 20:18 +0300
Re: Embedded platforms for beginners? Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> - 2017-09-11 21:24 -0400
Re: Embedded platforms for beginners? Les Cargill <lcargill99@comcast.com> - 2017-09-15 22:22 -0500
Re: Embedded platforms for beginners? Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> - 2017-09-18 11:26 -0400
Re: Embedded platforms for beginners? Tom Gardner <spamjunk@blueyonder.co.uk> - 2017-09-18 18:26 +0100
Re: Embedded platforms for beginners? Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> - 2017-09-19 14:27 -0400
Re: Embedded platforms for beginners? Tom Gardner <spamjunk@blueyonder.co.uk> - 2017-09-18 18:24 +0100
Re: Embedded platforms for beginners? Paul Rubin <no.email@nospam.invalid> - 2017-09-03 22:30 -0700
Re: Embedded platforms for beginners? Clifford Heath <no.spam@please.net> - 2017-09-04 15:51 +1000
Re: Embedded platforms for beginners? Paul Rubin <no.email@nospam.invalid> - 2017-09-03 22:04 -0700
Re: Embedded platforms for beginners? kristoff <kristoff@skypro.be> - 2017-09-05 17:56 +0200
Re: Embedded platforms for beginners? Luke A. Guest <laguest@archeia.com> - 2017-09-10 17:10 +0100
Re: Embedded platforms for beginners? tarjei99@gmail.com - 2017-09-10 05:49 -0700
Re: Embedded platforms for beginners? Les Cargill <lcargill99@comcast.com> - 2017-09-10 09:03 -0500
csiph-web