My brother knows a programmer in state that gets cold. Not sure of his name, but for the sake of discussion, let's go with his name is Sackoh of Shittoh. My brother wanted me to talk with the guy on the phone so I find better ways of doing my job. S of S thought I should know that everyone programs with language invented by Facebook now and all other programming was either at its end or soon would be. He spouted a few more programming language names I had not heard of and said that "everyone" is programming with those languages now, in effect, and deliberately telling me I was out of the loop and nobody if I was not programming with those languages. One of them was called "React" invented at Facebook. I looked into it. React is an extension to PHP that helps Facebook standardize how programs for relatively large development projects are organized That is not going blast a programer into a new dimension of productivity. What it is to going to do, if they are lucky and good, is give them a better of shot of completing their projects with something better than a total loss. It can help them avoid pitfalls they had been encountering that is why they made it. It's not like they were racing along, all of them faster than programmers in the rest of the world, then they figured out "hey, we can four times faster if we React." It was more they they were experiencing perpetual and mounting agony and they saw that if they didn't do something about it they eventually would slow to a stop. React slowed the slowing down process. When I was on the phone with S of S, I was trying to keep an open mind and learn something, which he took as a queue to be all smart and instructive. After a few questions aimed at specifics of the things he was saying, he retreated on, "Well I am not really a programmer (he tells people who are not programmers that he is a programmer) because "I manage programmers," he said. I know that non programmers are just as important to programming as programmers, because knowing how to program is not the same as knowing what needs to be done and what tradeoffs should be made. He told me he has this genius working for him (have you noticed that people like the brag about the genius they have working for them)? So this guy's genius can program 5,000 lines of new programming code every day. WHAT? You mean how Bill Gates writes a million lines of code whenever a new copy of Windows is installed on a Dell computer? "No," he says the genius is using voice to text and (words became unintelligible). The number of decisions to make and problems to solve in 5,000 lines of code is more than anyone can do in a day. You can do it in a way, using something like one of your graphics tools or installing a plugin to WordPress, where lines of code are either produced or put to work in a system, but that is not the same as working through 5,000 lines of details like the ones I have been going through to fit headers into Holly's site. Here is some code I wrote for that PHP: <?// put menu options into an array in the order they are to appear// and with urls that applies to being logged in.$i=-1;$i++;$mainmenuitems[$i]['pagename']='home';$mainmenuitems[$i]['label']="HOME";$mainmenuitems[$i]['url']=$appBranchURL;if (isset($_SESSION['member'])): $i++; $mainmenuitems[$i]['pagename']='classes'; $mainmenuitems[$i]['label']="CLASSES"; $mainmenuitems[$i]['url']=$memberURL; $i++; $mainmenuitems[$i]['pagename']='blog'; $mainmenuitems[$i]['label']='BLOG; $mainmenuitems[$i]['url']=$blogURL; $i++; $mainmenuitems[$i]['pagename']='shop'; $mainmenuitems[$i]['label']='SHOP'; $mainmenuitems[$i]['url']=$shopURL; $i++; $mainmenuitems[$i]['pagename']='forum'; $mainmenuitems[$i]['label']='FORUM'; $mainmenuitems[$i]['url']=$GLOBALS['forumURL']; $i++; $mainmenuitems[$i]['pagename']='helpdesk'; $mainmenuitems[$i]['label']='HELP DESK'; $mainmenuitems[$i]['url']=$forumURL; $i++; $mainmenuitems[$i]['pagename']='logout'; $mainmenuitems[$i]['label']='LOGOUT'; $mainmenuitems[$i]['url']=$logoutURL;else:// put menu options into an array in the order they are to appear// and with urls that applies to being logged out $i++; $mainmenuitems[$i]['pagename']='classes'; $mainmenuitems[$i]['label']="CLASSES"; $mainmenuitems[$i]['url']=$loginURL; $i++; $mainmenuitems[$i]['pagename']='blog'; $mainmenuitems[$i]['label']='BLOG'; $mainmenuitems[$i]['url']=$blogURL; $i++; $mainmenuitems[$i]['pagename']='shop'; $mainmenuitems[$i]['label']='SHOP'; $mainmenuitems[$i]['url']=$shopURL; $i++; $mainmenuitems[$i]['pagename']='forum'; $mainmenuitems[$i]['label']='FORUM'; $mainmenuitems[$i]['url']=$loginURL; $i++; $mainmenuitems[$i]['pagename']='join'; $mainmenuitems[$i]['label']='JOIN'; $mainmenuitems[$i]['url']=$joinURL; $i++; $mainmenuitems[$i]['pagename']='helpdesk'; $mainmenuitems[$i]['label']='HELP DESK'; $mainmenuitems[$i]['url']=$GLOBALS['forumURL']; endif;// put the array though a loop to make the menu itemsforeach ($mainmenuitems as $item): if ($item['pagename']==$pagename_menu): $class="active_mainmenu disabled-link"; else: $class=""; endif; ?><li> <a href="<?= $item['url']?>" class="<?=$class?>"><?=$item['label']?></a></li><?endforeach; That code makes these words and links putting them into a certain order, choosing certain words to use or not use, and linking to one place or another depending on whether the person visiting the web page is logged in or not. How could the same result have been obtained with less programming? I don't know a way. Since the combination of those elements going together the way they do is unique, even though the principles guiding most of the decisions are established, means there isn't a faster way than going through all the combinations of words, links, and login status and saying, in this case, do this, this other case do that, and right on down the line like that and that is how the program is put together. I think it would be possible to make a faster way but I have not seen a faster way. Even though I like the results that can be obtained that way, I have learned, since meeting you, the incredible time required to go the custom route. I don't believe S of S's genius programmer gets though 5000 lines of programs at this level of granularity in a day.
Funny, I thought I saw somewhere (on Quora maybe, but I'm not totally sure) that React was slowly becoming obsolete. And meanwhile php is going strong. I was pretty excited to see that Code School had recently added php to their curriculum, and jumped right on it when they had a free weekend. Yikes, really? What is it about those languages that is superior to other languages? Wait, let me guess, his genius programmer would have to tell you that. And, why is there so much emphasis on quantity anyway? To me, getting something cool done with fewer lines of code in an elegant way would seem far more valuable than lots of convoluted lines. I noticed something about your php, when I wondered why some of the lines were red and some were blue: Adding that single quote for the BLOG button should work and make all the colors the same. (in this case, blue) PHP: <?// put menu options into an array in the order they are to appear// and with urls that applies to being logged in.$i=-1;$i++;$mainmenuitems[$i]['pagename']='home';$mainmenuitems[$i]['label']="HOME";$mainmenuitems[$i]['url']=$appBranchURL;if (isset($_SESSION['member'])): $i++; $mainmenuitems[$i]['pagename']='classes'; $mainmenuitems[$i]['label']="CLASSES"; $mainmenuitems[$i]['url']=$memberURL; $i++; $mainmenuitems[$i]['pagename']='blog'; $mainmenuitems[$i]['label']='BLOG'; // added single quote here $mainmenuitems[$i]['url']=$blogURL; $i++; $mainmenuitems[$i]['pagename']='shop'; $mainmenuitems[$i]['label']='SHOP'; $mainmenuitems[$i]['url']=$shopURL; $i++; $mainmenuitems[$i]['pagename']='forum'; $mainmenuitems[$i]['label']='FORUM'; $mainmenuitems[$i]['url']=$GLOBALS['forumURL']; $i++; $mainmenuitems[$i]['pagename']='helpdesk'; $mainmenuitems[$i]['label']='HELP DESK'; $mainmenuitems[$i]['url']=$forumURL; $i++; $mainmenuitems[$i]['pagename']='logout'; $mainmenuitems[$i]['label']='LOGOUT'; $mainmenuitems[$i]['url']=$logoutURL;else:// put menu options into an array in the order they are to appear// and with urls that applies to being logged out $i++; $mainmenuitems[$i]['pagename']='classes'; $mainmenuitems[$i]['label']="CLASSES"; $mainmenuitems[$i]['url']=$loginURL; $i++; $mainmenuitems[$i]['pagename']='blog'; $mainmenuitems[$i]['label']='BLOG'; $mainmenuitems[$i]['url']=$blogURL; $i++; $mainmenuitems[$i]['pagename']='shop'; $mainmenuitems[$i]['label']='SHOP'; $mainmenuitems[$i]['url']=$shopURL; $i++; $mainmenuitems[$i]['pagename']='forum'; $mainmenuitems[$i]['label']='FORUM'; $mainmenuitems[$i]['url']=$loginURL; $i++; $mainmenuitems[$i]['pagename']='join'; $mainmenuitems[$i]['label']='JOIN'; $mainmenuitems[$i]['url']=$joinURL; $i++; $mainmenuitems[$i]['pagename']='helpdesk'; $mainmenuitems[$i]['label']='HELP DESK'; $mainmenuitems[$i]['url']=$GLOBALS['forumURL']; endif;// put the array though a loop to make the menu itemsforeach ($mainmenuitems as $item): if ($item['pagename']==$pagename_menu): $class="active_mainmenu disabled-link"; else: $class=""; endif; ?><li> <a href="<?= $item['url']?>" class="<?=$class?>"><?=$item['label']?></a></li><?endforeach; There is something about custom work that I believe is more valuable though. Somehow, because every line of code has been analyzed and created from scratch, it seems the program would be at once more flexible but also better suited to its purpose. I'm not certain about this theory of mine yet, but it is something that is in the back of my mind as I learn more about how programming works. Me neither. Especially if he's working alone.
In a lot of ways, php and a lot of other programming languages are like our system for counting things. Maybe there is a better way to count things than the one we have. Maybe the nature of the human mind and our system for counting are in an equilibrium so that a better way of counting requires brains we do not have. I think that the equilibrium is where we are at in counting and in programming. I think that is why programming languages can't be made more productive. Maybe some programmers can make improvements that work for them, but the benefits cannot be realized by others because the brain required to see the advantage is an unusual one. I think there might be a way to make programming happen faster for a lot of people, by limiting what is possible with programming. I think that is a lot like what a lot of technology people do. They sell what they have instead of making what people want, tricking people in the process into believing that what they wanted is what the tech guy already had available.
Something weird happened. I was writing to you about this, to add to what I tried explaining before when you asked about the color coding of a program. What you spotted is exactly what I was writing to explain, how I don't have memorized what the colors mean, but the pattern of colors is very helpful finding errors like the one you found. The places where this code is running does not have that error. I copied one of the places it is running to this link, then substituted the working code with the code I posted. The result of the error is hard to miss. Compare to this link. It was just yesterday I was writing about this I guess I did not finish it. Nice catch!