Forums
May 14, 2024, 07:30 AM

Author Topic: web development / code challenge  (Read 1905 times)

0 Members and 1 Guest are viewing this topic.

Offline Abnaxus

Re: web development / code challenge
« Reply #15 on: July 26, 2012, 09:20 AM »
At your place MI, I'd do a class with everything you need, and so if I need to change something on an object, I'd just make/call a method. :p

This way, you can generate your page through objects.
And so if they change, the page will also change.

I'm a bit rusty with PHP, but I think it's kinda easy to do so.
Watashi wa, jinmei ni iku sa reru ka o kakunin surunoni nagai jikan o matteita.
Shikashi, tada nariyuki o mimamoru.
Jikan dake to iudarou gen'in to naru.

May the force be with you.

Offline THeDoGG

Re: web development / code challenge
« Reply #16 on: July 26, 2012, 04:37 PM »
THeDoGG, my advise is that do not try to make a function to generate unique description. Such things are not flexible and will cause even more trouble. For example:

1. What if you need to specifically change a description for whatever reason in the future?
2. What if you need to search within your nonsense description for whatever reason?
3. What if a description is really really crappy and you want to refresh it?

If it was me, I would create a totally random generating function and insert the output in the database. That way everything would be in my control.

Well, what you suggest is what I already done actually, generating description and writting them in the DB !
But now I have to do it again for new items ! Which is a pain, I need to get sure to not override existing ones. Maybe I should get better in SQL scripts skills tho :)

About the points you mentionned, I will not have to change a spefiic description!
Im treating millions of items, I can't take care of them individually.
And most of the result are actually giving "senseful" descriptions :D Thats magic !

@Abnaxus:
Lets talk in french when we meet in #AG, gonna be easier ;)
Btw its not PHP but Ruby !


@Impossible
Seems like a good function! But didnt find it for ruby :(