As you can tell from the default values, it started out having 6 arguments. And it has things like this in it:
$mysql_the_rest = 'FROM
'.DBTP.'node n
LEFT JOIN
'.DBTP.'node n2
ON
n.tree_id = n2.id
AND
n2.perm_view & ' . A_PERMS . '
'.$mysql_join.'
WHERE
'.$mysql_where2.'
'.$mysql_where.'
n.perm_view & ' . A_PERMS . '
AND
n.site_id = ' . $site_id . '
';
$total_count = $A->db->fetch_one_column('c', ' SELECT COUNT(*) c '.$mysql_the_rest);
.. you know? The whole CMS is 20k lines of PHP, with HTML, PHP, and MySQL all happily living together in the same files (it's not that I don't have templates, I just have plenty HTML in the PHP, too)
Yet, it works like a charm, PHP updates made it faster even, and I can use it for everything I needed so far, and use its output in a variety of ways. I still want to rewrite it, but it seems a lot of work to just shave off a few ms and have nicer code, with the same result for the visitor, and also having to write something that migrates the content. I suspect with enough content, it will slow down, and then I'll think about the next iteration. But it's still a mixture of pride, plain being happy to have it, and groaning whenever I fix a bug or add a feature.
Because in the end, if your function is fast and working correctly, it's fine even though it's a little bit messy. The problem is more all the code calling this function and having to pass dozens of params in the right order, and then it's a pain to start adding/changing parameters. Also, when calling this function, you probably need a bunch of temporary variables to "build" all the params; all those temporary variables could instead live inside that builder object.
I think I'll just use arrays, one for the caller, and one globally that has the default values. Fortunately that function isn't called in that many places.
Making and then really using the CMS helped me with knowing what I would want in my next CMS, and just keeping the whole in mind from the start would probably make it a lot better by itself. My thinking is that the longer I put that off, the more languages improved and the more I hopefully learned in the meantime ^^
You're benefitting from an accurate mental model of this code (since you wrote it and work on it) and as soon as someone else has to work on this thing they are going to curse you.
So it might be job security but it's also vulnerable to the hit-by-a-bus problem
When I started out, I wanted to opensource it, it had an installer and everything.. but then I realized it's become kind of a little monster and wisely canceled that plan, I'm not that irresponsible or mean :)
The quotes in my bio are by people who thought things through, while the CMS exploded in scope while I made it, so I'm not quite sure what you mean. Can you elaborate?
Maybe, but at least it's more or less clear what I mean right away :P A million words conveying one unit of meaning are still more efficient than ten words conveying no meaning.
I just thought about that when I saw a youtube comment saying "stolen" in response to a funny joke. I wondered, do they mean they intend to "steal it" because it's a good joke, or did they mean the person who posted the joke stole it from somewhere? Nobody will ever know, at least I for one won't sign in just to ask.
I notice that since mobile devices, a lot of "communication" on the web these days is kinda like the "small talk" from Kevin from The Office US.
If I hadn't asked what you meant, I and anyone else who read your comment would have had their own interpretation of it. I see a lot of comments like that on HN, where you would have to ask "what do you mean?" because it's totally unclear. A variation is stating something that is factually true but doesn't really refute anything, but the commenter clearly seems to mean something by stating that triviality, but don't say what it is. It's like dog whistles, but not for others to hear, but only the posters themselves know what they mean. Count me out.
"Maybe, but at least it's more or less clear what I mean right away :P A million words conveying one unit of meaning are still more efficient than ten words conveying no meaning."
No need for 'atleast'. I'm not criticizing the length, its fun-ny because its another form of life and way of expression that others use, brings me joy when i see patterns in life, expressed in many forms, one being someone who is verbose writing a hilarious god function then inadvertently backs up that 'digital persona' posting with a god function-esque bio lol!
Yet, it works like a charm, PHP updates made it faster even, and I can use it for everything I needed so far, and use its output in a variety of ways. I still want to rewrite it, but it seems a lot of work to just shave off a few ms and have nicer code, with the same result for the visitor, and also having to write something that migrates the content. I suspect with enough content, it will slow down, and then I'll think about the next iteration. But it's still a mixture of pride, plain being happy to have it, and groaning whenever I fix a bug or add a feature.