Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Re^3: The error says the value is uninitialized, but it works anyway

by misc (Friar)
on Aug 22, 2019 at 11:57 UTC ( #11104852=note: print w/replies, xml ) Need Help??

in reply to Re^2: The error says the value is uninitialized, but it works anyway
in thread The error says the value is uninitialized, but it works anyway

One thing I learned (although in another area of studies): It's not important to know everything, but it's important to know where too look it up or ask.

As long, as you find a solution, noone will ask from where the solution came. Although it's common and helpful for everyone to point at your sources. The important thing is that you do have a solution.

Regarding you question about floats as input: I did a lot of programming, also in perl. Although I don't really know, how to do it; I have some starting points.

printf/scanf comes to my mind - So I'd look this up, firstly.

After this, I'd most probably lookup the problem in CPAN. User input is always a source of trouble. Not to say, users are the real source of all these troubles.. They always do things, you'd never expect. Instead of entering a number, putting a cat onto the keyboard. Or entering sql-injects. or whatever.

So, to handle border cases, different localizations, security flaws, ... ..., with some luck there's a package already there.

If there's a reason to implement the thing myself - maybe, cause it's homework, or cause there isn't a module - google is your friend.

Just don't do only Copy and Paste, copy only, what you did understand.

Which is the most important: I really don't want to know, how many things are just copy'd n pasted, without any understanding at all.

Having studied Philosophy, I had to learn, most people don't know at all, what they are talking about.

There's a big advantage in programming: There are valid and well defined citerias. Either this thing works, or it doesnt.

Sadly, most software works - but works only within defined criterias.

E.g. Most microsoft software works only for a limited time - I never managed to keep (years before) Windows XP running longer than, say, 24 hours.

Obviously someone did copy and paste the malloc routine into gwbasic ( suspecting Windows has been written in basic), but didn't UNDERSTAND, that he had to copy also the free routine.

When the error showed up, cause free wasn't defined, the debug team luckily found also the fix: Just define an empty free function, and everything is ok. Especially, since the release was overdue.

And, as always, me as the user did the unexpected: Why the heck keeps someone his pc running for 24 hours???


(Quoting Bill's famous idea, 640kB should be enough for everyone.....)

Anyways, seems to me you are well on the way.
  • Comment on Re^3: The error says the value is uninitialized, but it works anyway

Replies are listed 'Best First'.
Re^4: The error says the value is uninitialized, but it works anyway
by haukex (Bishop) on Aug 22, 2019 at 16:18 UTC
    As long, as you find a solution, noone will ask from where the solution came.

    Well I'd say not quite. It does matter when you're writing a closed-source product and incorporating open-source licensed components, for example. It also matters in academics. In one of the courses in college where I was a TA, the policy way "copying code from the Internet is ok, as long as it's not a significant portion of the assignment, you can explain how the code works, and you cite your sources", and people still forgot to cite their sources...

      You're completely right. That's why I tried to draw the line between copy'n paste and look it up, copy only what you understand.

      It's maybe also about the commonalities and differences of knowledge and programming.

      Which leads me to software / knowledge patents.

      We all have to "copy", starting with the (programming) language and words / commands, we use. Also we "copy" known concepts, e.g. object orientation.

      And we have to pragmatically take things as given, at some level. E.g. let the compiler decide, which optimizations are best. Or, what an "object" could mean at all (asked philosophical). Knowing these borders is also knowledge, I'd propose.

      But, at the level we operate, we should understand what we are doing - Otherwise, well....

      I did just put my few cents in, cause I somehow got the feeling, the OP was like - there's so much to know, how can I manage it. I mean, I did also study a lot of history at the university - and there would be many dates to know. But, the exact dates aren't important. Important is, what happened, and why it is important. As long, as I know where to look it up, It's ok.

      Anyways, despite the fact it's common sense, knowledge isn't patentable; software and algorithms are. Which might be a real problem, as soon, as you disclose knowledge, you're going to run into all sorts of trouble.

      Or, when we compare opensource and closed source software, I'd like to propose opensource is around 10 years in advantage. When did microsoft manage to switch to a real 32bit OS.. Although they are genius in marketing and business.

      And I can imagine students, asked to explain their code .. "Well, it's uhhm. working by uuuuuuh." rotfl.

        Btw. "The error says" ...

        An error cannot speak, there's a misconception...

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://11104852]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (3)
As of 2020-10-22 01:09 GMT
Find Nodes?
    Voting Booth?
    My favourite web site is:

    Results (225 votes). Check out past polls.