On Tuesday, 15 December 2020 at 18:25:43 UTC+2,
spu...@isnotyourbuddy.co.uk wrote:
> On Tue, 15 Dec 2020 07:29:49 -0800 (PST)
> =?UTF-8?B?w5bDtiBUaWli?= <
oot...@hot.ee> wrote:
> >On Tuesday, 15 December 2020 at 16:11:46 UTC+2,
spu...@isnotyourbuddy.co.uk
> >wrote:
> >> >Totally different question is if need of type punning a pointer into
> >> >integral value and back is best uglifier factor but it works.=20
> >>
> >> Oh yeah, that would really make the code clearer.
> >
> >Yes, the unsafe stuff stands out so it is more clear that it is unsafe.
> Illogical reasoning. Any experience developer knows to be careful with
> pointers, they don't need it signposted.
I do not really care how well they know their own code. For me it is important
that they can be used to work with code of other people.
> >> I've found that people who have a problem with pointer arithmetic don't
> >> really understand it. Or pointers.
> >
> >That is unfortunately so with every rarely needed feature. People
> >can program years in C++ without doing any pointer arithmetic
> >ever and so quite many can make errors in it. It saves my time when
> >I find problematic places quicker.
> Sure, you can program in C++ without ever using pointers if you only ever
> program baby code.
That is for what is paid. It is tricky to find those rare customers who
let you waste $25K and whole month for writing a parser or video
codec or compression algorithm. Use best existing one. But interface
of such does not involve pointer arithmetic.
> But if you ever do for example any network packet processing
> or are writing a parser, using shared memory or to-the-metal you'll soon get
> sick of trying to do it all with std::string/array or some other higher level
> abstraction not to mention how slow they'd be. If you only want to use high
> level constructs perhaps you'd be better off with Java or Python.
Yes I'm quite bad with Python. In my company we have a little
homework assignment ... about processing text file. We sometimes
hire people whose C++ performs even weaker than my Python script
but we avoid those whose garbage works incorrectly.