The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.
I take a function-first approach. You won't be able to parse the JSON if it's not well formed, so I would do that check first. If performance is poor, then I'd do a trace to find the bottlenecks and address them if possible. I wouldn't want to spend my time unnecessarily tracking down import errors.
I look at it this way - and keep in mind this is purely hypothetical:
Let's say you're bulk uploading parts of some JSON out of a huge dataset. Almost always that JSON is machine generated because who writes huge JSON by hand? Scanning through it quickly is important. If at some point you get a bad data dump, might it be better to roll back that update and then run a validator over the bad document that one time out 1000 when it fails, rather than paying for that validation every other 999 times?
Case 1, input good, output good - answer faster,
Case 2, input bad, error message, but delayed ( is it clear )
Case 3, input bad, program sticks it's tongue out and dies
Case 4, input bad, quiet wrong result
so, who has to deal with 3, and can 4 happen? ( with malicious input ?)
The weekdays are a bit more chaotic, and coffee may not be had until about a half hour after getting to work
Make coffee at home and bring a travel mug?
All jokes aside, sipping my coffee while reading morning emails helps me settle my mind and prepare for the work day. For me there is a settling effect in sipping coffee, even during an ugly commute. I normally work early hours, so the commute isn't as ugly in the AM as the PM, and the folks in the office at my arrival time are doing the same as me, so there is not usually immediate chaos. [Anyone who arrives to immediate chaos appreciates this.]
However -- these days, going to work consists of getting up, starting a pot of coffee, and then logging in. My commute is 35 steps instead of 34 miles.
I tried to explain them to an IBM systems programmer but for some reason he would not accept the concept. Even though all the code he worked with (assembler) made use of base registers. His main beef was "C is a high level language so it shouldn't need them".
Except C is a "mid-level" language, and nobody considers it a high level language who has actually used "high-level" languages. It's funny when people form strong opinions around their misconceptions. Human beings in general are ridiculous creatures.
This site already has quite a few articles about pointers. I haven't read any of them, but some have been favorably received. Maybe looking at some of them would give you ideas as to what more you could say.
In a way, back to what you noted in your original post:
How different people just see and understand things differently.
Way back in elementary school (do they still have that?) I was exceptionally good in math, and by second grade, reading. Science was a joy. Handwriting, to this day, childlike. Also, despite being able to express myself bother verbally and in written prose with some eloquence (when the mood shines), when being taught grammar (as in parts-of-speech), the more they taught the less I knew. Associating names and faces, and pure memorization in general is a horror for me - but I know where things were in (for example) a 60,000 line application I wrote some many years ago.
I had no trouble with C pointers because I learned assembly, first. I've heard that normally it can be quite a thing to grasp for learning C for those who haven't been elsewhere introduced.
The point (ah yes, yet another pun) is that we all get dealt a hand and play those cards as best we can - at least for some of us.
So - and this works out well for us as we're a herd-species - we all have different expertise and shortcomings that, when melded within the group, form a gestalt.
...and that, right there, is pretty much all you need to know.
For some reason I was overthinking the whole thing when I started learning about them. And it's only like 2 years into college that I finally wrapped my head around the whole, basic, fundamental idea. Never had a problem with them since.
That being said, I haven't done anything pointer-related in over a decade...
I think that's a common trap. It doesn't help that misusing them causes faults because I think that makes them intimidating but all a fault is is an unhandled exception. Fear is a huge stumbling block to growth.
It doesn't help that I've seen lots of articles (not necessarily here) rag on pointers and state that they're scary in so many words, probably from authors that never got comfortable with them themselves.
A lot of times it's no different than accessing an array.
Real programmers use butterflies
Last Visit: 31-Dec-99 18:00 Last Update: 11-Aug-22 1:14