3 Replies - 255 Views - Last Post: 31 January 2018 - 06:32 PM Rate Topic: -----

#1 airwick93  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 28-January 18

need help with class

Posted 28 January 2018 - 08:17 PM

i have to make a pseudocode of something i plan on to do or something i did yesterday ive tryed to look up what pseudocode is but i don't really understand it could someone write a simaller code and enplane how it works this is going write over my head
Is This A Good Question/Topic? 0
  • +

Replies To: need help with class

#2 CTphpnwb  Icon User is online

  • D.I.C Lover
  • member icon

Reputation: 3732
  • View blog
  • Posts: 13,574
  • Joined: 08-August 08

Re: need help with class

Posted 28 January 2018 - 08:42 PM

https://en.wikipedia...wiki/Pseudocode
Attempt to do project
While project doesn't work {
    Post code on Dream in Code with description of problem
    Implement suggestions 
}

Was This Post Helpful? 0
  • +
  • -

#3 airwick93  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 28-January 18

Re: need help with class

Posted 28 January 2018 - 08:55 PM

im still not getting it i guess ill just have to take the 0 on it and try to get my teacher to explane it for me thank you for trying to help me though

coding is just not for me i guess
Was This Post Helpful? 0
  • +
  • -

#4 tony jay  Icon User is offline

  • New D.I.C Head

Reputation: 18
  • View blog
  • Posts: 46
  • Joined: 31-January 18

Re: need help with class

Posted 31 January 2018 - 06:32 PM

Why are you giving up so easily?
When you get it, it will be trivial from that point onward.

Pseudocode (and actual code for that matter)
is nothing more than very simple instructions written one after the other.

CTphpnwb gave you a small example of this...

Think about going to the toilet from the location where you are currently.
Perhaps you are thinking along the lines of: straight down the corridor, third on the left...
That sort of works for a human being because we don't often require to be told to make a detour around the table in the room, to open (and perhaps close) the door exiting the room, and how to actually get into the bathroom (most will have two doors).

Writing pseudocode means that one cannot make assumptions about ANYTHING.
The route to the bathroom is actually a complicated obstacle course that needs to be precisely negotiated!

What is the point of pseudocode?
Pseudocode is a very useful intermediate between thinking in one's native language (perhaps English in your case) and as a human being compared to thinking like a computer and coding in a language (once compiled or translated, of course) that the computer understands.

A computer is a complete moron. It may be able to complete instructions much faster than you, but a moron it remains.
It is so stupid, in fact, that it can only do exactly what it is told to do!
Pseudocode just prepares one to interact with a computer on its terms - and those terms are exceedingly simple in principle: a computer needs to be told exactly what to do without exception.

A modern computer language (they are all the same in this regard) is just a very small set of instructions that map to one or more machine level instructions that the computer directly understands.
That small set of instructions, each often very simple by themselves to understand, can be combined in infinite ways to produce the most complex computations known to man as well as computations yet to be attempted. In much the same way pseudocode just mimics how any computer language expresses its functionality. Pseudocode is, by definition, computer language agnostic, and any good pseudocode solution to any problem can be coded into any language.

The problem of getting to the toilet, as expressed in pseudocode, is just an exercise in breaking down the components of the problem into smaller and smaller, and hence simpler and simpler, parts until each component is of a granularity simple enough to be simply and precisely executed. If there are abstractions or assumptions left in the instructions then those need to be further simplified and detailed.
Think about opening the door: does the door have a handle or a knob, or does it require a keycard entry? Does the door open inwards or outwards? Does it open to the left or to the right, or both(if it is a double door)? Will it close automatically or does one need to push it closed?

Can you see that in order to think effectively as a programmer one needs to consider details at a level of precision (simplicity with lack of ambiguity) that human beings rarely bother with?
Yes, it is true that we often seek to put such details into small useful packets of code usually called functions or classes in order to free us up to think about the problem at a higher level of abstraction, but, every useful program has thousands to millions of lines of code that express functionality in terms of this simple, unambiguous, and literal approach.

Hopefully this little bit of insight will help put your current travails in perspective...

This post has been edited by Skydiver: 31 January 2018 - 07:32 PM
Reason for edit:: Removed unnecessary quote. No need to quote the post above yours.

Was This Post Helpful? 1
  • +
  • -

Page 1 of 1