Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Generic User Avatar

a boost with universal programming concepts


  • Please log in to reply
6 replies to this topic

#1 ajetrumpet

ajetrumpet

  •  Avatar image
  • Banned Spammer
  • Member rank image
  • 625 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:03:44 PM

Posted 23 February 2021 - 02:02 PM

hey you guys,

 

can someone point me to internet resources that explain the following concepts like a human would talk, and not like a tech elitist that has lost their mind?  I know most of these, but I just want to make sure I'm not missing anything:

 

=> recursion

=> polymorphism

=> encapsulation

=> abstraction

 

the one thing I want to know specifically is, how I can think of recursion in very simple terms.  as in, are any of the following concepts relevant when a function calls itself?

 

=> bit/byte shifting

=> sorting (I know this is obviously part of it, but am missing a small piece of the puzzle)

=> what goes on in the mem slots when the self-calling goes on.

 

here's an example of a function, written in an extremely old language, that calls itself and puts vals into a collection object:

Private Function FillDir(colDirList As Collection, ByVal strFolder As String, strFileSpec As String, _
    bIncludeSubfolders As Boolean)
    'Build up a list of files, and then add add to this list, any additional folders
    Dim strTemp As String
    Dim colFolders As New Collection
    Dim vFolderName As Variant

    'Add the files to the folder.
    strFolder = TrailingSlash(strFolder)
    strTemp = Dir(strFolder & strFileSpec)
    Do While strTemp <> vbNullString
        colDirList.Add strFolder & strTemp
        strTemp = Dir
    Loop

    If bIncludeSubfolders Then
        'Build collection of additional subfolders.
        strTemp = Dir(strFolder, vbDirectory)
        Do While strTemp <> vbNullString
            If (strTemp <> ".") And (strTemp <> "..") Then
                If (GetAttr(strFolder & strTemp) And vbDirectory) <> 0& Then
                    colFolders.Add strTemp
                End If
            End If
            strTemp = Dir
        Loop
        'Call function recursively for each subfolder.
        For Each vFolderName In colFolders
            Call FillDir(colDirList, strFolder & TrailingSlash(vFolderName), strFileSpec, True)
        Next vFolderName
    End If
End Function

thanks.


Edited by ajetrumpet, 23 February 2021 - 02:04 PM.


BC AdBot (Login to Remove)

 


#2 Jo*

Jo*

  •  Avatar image
  • Malware Response Team
  • 4,033 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Germany
  • Local time:09:44 PM

Posted 23 February 2021 - 07:33 PM

wiki would be a good starting point...

Object-oriented programming - Wikipedia


Graduate of the WTT Classroom
Cheers,
Jo
If I have been helping you, and I have not replied to your latest post in 36 hours please send me a PM.

#3 ajetrumpet

ajetrumpet
  • Topic Starter

  •  Avatar image
  • Banned Spammer
  • Member rank image
  • 625 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:03:44 PM

Posted 23 February 2021 - 09:19 PM

I have searched many places, my friend.  OOP is not tough.  I'm asking about *specifics*.  I want a VIEWpoint.  from you, or another human.  not a webpage.  and on a side note, OOP has absolutely *nothing* to do with a concept like recursion.  OOP is an architecture.  recursion is a technique that's part of a large, large whole.


Edited by ajetrumpet, 23 February 2021 - 09:20 PM.


#4 TazzyOpz

TazzyOpz

  •  Avatar image
  • Members
  • 107 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:03:44 PM

Posted 23 February 2021 - 10:31 PM

I have searched many places, my friend.  OOP is not tough.  I'm asking about *specifics*.  I want a VIEWpoint.  from you, or another human.  not a webpage.  and on a side note, OOP has absolutely *nothing* to do with a concept like recursion.  OOP is an architecture.  recursion is a technique that's part of a large, large whole.

 

It's getting pretty late so sorry if I'm not understanding this correctly but let me start with one thing at a time and since you've mentioned Recursion quite a bit. Are you trying to perform a function within VB (Looks like the code above) that iterates until it solves or returns all possible values within it's self?

 

For example iterating through every folder within a folder and obtaining each file within said folders until the value is null or non existent would be a type of recursion. Other properties/rules can be put into place while iterating through something like this as well. 


I.T Systems Administrator
C#, .Net, and Python.
Head Developer of NoBot est. 2015


#5 ajetrumpet

ajetrumpet
  • Topic Starter

  •  Avatar image
  • Banned Spammer
  • Member rank image
  • 625 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:03:44 PM

Posted 23 February 2021 - 11:46 PM

thanks tazzy.  but iterations don't havve anything to do with recursion.  really what I'm looking for is why and how recursion is used.  specifically, the technique of a function calling itself.  when that happens, the output is always sorted automatically.  and yes, the example I posted is VBA from 30 years ago.  it's not my example.  it's an australian's.  here's the page:  http://allenbrowne.com/ser-59.html

 

by the way, is this you?  https://www.nobot.org/



#6 TazzyOpz

TazzyOpz

  •  Avatar image
  • Members
  • 107 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:03:44 PM

Posted 24 February 2021 - 10:57 AM

thanks tazzy.  but iterations don't havve anything to do with recursion.  really what I'm looking for is why and how recursion is used.  specifically, the technique of a function calling itself.  when that happens, the output is always sorted automatically.  and yes, the example I posted is VBA from 30 years ago.  it's not my example.  it's an australian's.  here's the page:  http://allenbrowne.com/ser-59.html

 

by the way, is this you?  https://www.nobot.org/

 

No that is not me lol. NoBot is an Anti-Malware software a few friends and I started developing back in 2015. 

 

But sorry I wasn't understanding your main question then. 

"The Recursion and Iteration both repeatedly execute the set of instructions. Recursion is when a statement in a function calls itself repeatedly. The iteration is when a loop repeatedly executes until the controlling condition becomes false."

I've used iteration in programming quite a bit, I don't know how you'd go about Recursion. They seem similar in ways but I can't think of a way I'd want to use it or I'd try writing something myself? A little stumped as far as that goes.

 


I.T Systems Administrator
C#, .Net, and Python.
Head Developer of NoBot est. 2015


#7 ajetrumpet

ajetrumpet
  • Topic Starter

  •  Avatar image
  • Banned Spammer
  • Member rank image
  • 625 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:03:44 PM

Posted 24 February 2021 - 01:46 PM

well tazzy!  you just said the same things I told you are irrelevant, a post ago.  =)  I already KNOW that recursion is a function that calls itself, silly.  LOL.  what I want is an EXPLANATION from a human as to what goes on in the MEMORY area of the computer when that happens.  understand?  you can always say ""a function calls itself"", but that doesn't tell you much of anything in terms of understanding the common sense of what goes on inside the actual computer and STACKS.  you know what I mean by STACKS don't you?  that's exactly the concept that created the website called ""stack overflow""!  =)






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users