Can you use method of loci or wardrobe method to learn programming?

Can you use method of loci or wardrobe method to learn programming? I having a hard time trying to do this with php.

What are each loci like? Is it one loci for strings, a loci for variables function, or a loci for classes?

Please help. Thank you.

Type in programming into the search box on top of the page, there will be a bunch of posts on it. Here, here and here.

Other than that, how much do you know about mnemonics? Have you checked out the getting started guide?

You could also give some examples of things you wish to memorize, and we could help you out.

Bateman

Yes I know a few, I study loci method and created my 50 loci. I study about base and dobe and how we could use interaction and transform method to connect to connect the dobe( the item you want to remember) to base(loci). I read about using home and movies as memory palace. I read a lot and even on memory sport mnemonic webpage( that what I got the wardrobe method from). I could use my memory palace to remember shopping list and foreign language( maybe), but programming language seem like a different level.

I also check out the programming question in the search result tool. It didn’t do much, but this post help me out a little:

That it.

Alright. Good. Could you give some examples? As far as I’m aware, there are multiple types of programming languages.

Bateman

code example


print “what ever” = print on screen


;= use at the end of every code statement


<?php = open php statement _____________________________________________________________ ?> = close php statement

$var = integer variable


if ($var == “cat”) { =check whether statement true of not

echo (“milk”); = this will be the result whether it true or not

} = ending brackets of if statement


file_exists(“file name”) =“check if files exist”


phpinfo() = print the info of current php version


These are a few statement. I just started; I only know a few code.

First of all, there is a difference between learning something and memorzing its specifics.
Usually it is better to start learning something by actually doing it and then later memeorize specific things you

find difficult.

Use an online editor to play with a language and learn its specifics.
This will take care of things like using a ‘;’ at the end of every code statement

or that:

<?php = open php statement ?> = close php statement

Then look at php code samples and see if you can see what it does and what the specifics are.
For example here: http://php.net/manual/en/fdf.examples.php

There is no reason to waste a locus on remembering that ‘print’ is the function for printing and that file_exists does what it says it does.

Yeah I started to see that now. Thanks! But if you were to uses anything mnemonic for programming. What will it be? For example: Algorithm or specific common repetitive scripts. Thanks!

As Kinma said, things that you find difficult to remember normally. As in, you keep forgetting to do this one thing, or spell it wrong or something.

Bateman

I think the best way to learn programming is to build simple projects. I wouldn’t only use mnemonics.

Example: If you build one simple PHP website, you’ll easily absorb the basics like <?php echo 'Hello world'; ?>.

Working through a long tutorial or book will help teach proper coding techniques like separating the logic from the presentation.

After getting the basics down, check out Laravel. It’s a PHP framework that will help you adhere to good coding practices like keeping PHP logic out of your templates.

Where I think mnemonics are useful is in memorizing functions. You could make one memory palace for string functions like these:

  1. addcslashes - Quote string with slashes in a C style
  2. addslashes - Quote string with slashes
  3. bin2hex - Convert binary data into hexadecimal representation
  4. chop - Alias of rtrim
  5. chr - Return a specific character
  6. chunk_split - Split a string into smaller chunks
  7. convert_cyr_string - Convert from one Cyrillic character set to another
  8. convert_uudecode - Decode a uuencoded string
  9. convert_uuencode - Uuencode a string
  10. count_chars - Return information about characters used in a string
  11. crc32 - Calculates the crc32 polynomial of a string
  12. crypt - One-way string hashing
  13. echo - Output one or more strings
  14. explode - Split a string by string
  15. fprintf - Write a formatted string to a stream
  16. get_html_translation_table - Returns the translation table used by htmlspecialchars and htmlentities
  17. hebrev - Convert logical Hebrew text to visual text
  18. hebrevc - Convert logical Hebrew text to visual text with newline conversion
  19. hex2bin - Decodes a hexadecimally encoded binary string
  20. html_entity_decode - Convert all HTML entities to their applicable characters
  21. htmlentities - Convert all applicable characters to HTML entities
  22. htmlspecialchars_decode - Convert special HTML entities back to characters
  23. htmlspecialchars - Convert special characters to HTML entities
  24. implode - Join array elements with a string
  25. join - Alias of implode
  26. lcfirst - Make a string's first character lowercase
  27. levenshtein - Calculate Levenshtein distance between two strings
  28. localeconv - Get numeric formatting information
  29. ltrim - Strip whitespace (or other characters) from the beginning of a string
  30. md5_file - Calculates the md5 hash of a given file
  31. md5 - Calculate the md5 hash of a string
  32. metaphone - Calculate the metaphone key of a string
  33. money_format - Formats a number as a currency string
  34. nl_langinfo - Query language and locale information
  35. nl2br - Inserts HTML line breaks before all newlines in a string
  36. number_format - Format a number with grouped thousands
  37. ord - Return ASCII value of character
  38. parse_str - Parses the string into variables
  39. print - Output a string
  40. printf - Output a formatted string
  41. quoted_printable_decode - Convert a quoted-printable string to an 8 bit string
  42. quoted_printable_encode - Convert a 8 bit string to a quoted-printable string
  43. quotemeta - Quote meta characters
  44. rtrim - Strip whitespace (or other characters) from the end of a string
  45. setlocale - Set locale information
  46. sha1_file - Calculate the sha1 hash of a file
  47. sha1 - Calculate the sha1 hash of a string
  48. similar_text - Calculate the similarity between two strings
  49. soundex - Calculate the soundex key of a string
  50. sprintf - Return a formatted string
  51. sscanf - Parses input from a string according to a format
  52. str_getcsv - Parse a CSV string into an array
  53. str_ireplace - Case-insensitive version of str_replace.
  54. str_pad - Pad a string to a certain length with another string
  55. str_repeat - Repeat a string
  56. str_replace - Replace all occurrences of the search string with the replacement string
  57. str_rot13 - Perform the rot13 transform on a string
  58. str_shuffle - Randomly shuffles a string
  59. str_split - Convert a string to an array
  60. str_word_count - Return information about words used in a string
  61. strcasecmp - Binary safe case-insensitive string comparison
  62. strchr - Alias of strstr
  63. strcmp - Binary safe string comparison
  64. strcoll - Locale based string comparison
  65. strcspn - Find length of initial segment not matching mask
  66. strip_tags - Strip HTML and PHP tags from a string
  67. stripcslashes - Un-quote string quoted with addcslashes
  68. stripos - Find the position of the first occurrence of a case-insensitive substring in a string
  69. stripslashes - Un-quotes a quoted string
  70. stristr - Case-insensitive strstr
  71. strlen - Get string length
  72. strnatcasecmp - Case insensitive string comparisons using a "natural order" algorithm
  73. strnatcmp - String comparisons using a "natural order" algorithm
  74. strncasecmp - Binary safe case-insensitive string comparison of the first n characters
  75. strncmp - Binary safe string comparison of the first n characters
  76. strpbrk - Search a string for any of a set of characters
  77. strpos - Find the position of the first occurrence of a substring in a string
  78. strrchr - Find the last occurrence of a character in a string
  79. strrev - Reverse a string
  80. strripos - Find the position of the last occurrence of a case-insensitive substring in a string
  81. strrpos - Find the position of the last occurrence of a substring in a string
  82. strspn - Finds the length of the initial segment of a string consisting entirely of characters contained within a given mask.
  83. strstr - Find the first occurrence of a string
  84. strtok - Tokenize string
  85. strtolower - Make a string lowercase
  86. strtoupper - Make a string uppercase
  87. strtr - Translate characters or replace substrings
  88. substr_compare - Binary safe comparison of two strings from an offset, up to length characters
  89. substr_count - Count the number of substring occurrences
  90. substr_replace - Replace text within a portion of a string
  91. substr - Return part of a string
  92. trim - Strip whitespace (or other characters) from the beginning and end of a string
  93. ucfirst - Make a string's first character uppercase
  94. ucwords - Uppercase the first character of each word in a string
  95. vfprintf - Write a formatted string to a stream
  96. vprintf - Output a formatted string
  97. vsprintf - Return a formatted string
  98. wordwrap - Wraps a string to a given number of characters

In the beginning, I’d just memorize the function names and their basic meaning. After you have that memorized, work through one simple code example of using each of the functions. I like to save my code examples for reference later.

There will be some weird gotchas where mnemonics might help – like similar functions where the arguments are in opposite order:

// Both of these search in an array, but take arguments in opposite order
in_array($needle, $haystack)
strpos($haystack, $needle)

in_array could link with “needle in haystack”.
strpos could be a posse jumping into a haystack, reminding you that haystack comes first.

Then you could create memory palaces for array functions, class functions, and whatever else you want to become familiar with. The mnemonics alone won’t teach you how to program, but I think that they will prime the brain for absorbing things more rapidly. At least that was my experience with it. :slight_smile:

P.S., depending on your goals, you might be interested in Python. I think it’s a little nicer to work with than PHP. There are good introductory tutorials here and here. Ruby is another good language for web programming.

Thanks all you guys for your support :slight_smile: