No. Not at all.
If you're going to do it. Do it right, do it effectively, don't cut corners.

No. Not at all.
If you're going to do it. Do it right, do it effectively, don't cut corners.
As I said, there's no point spending too much time on something which isn't important. I spend a lot of time doing commissioned work properly, but I assume this isn't commissioned as he has to ask how to use explode, so there's no point spending a lot of time on it. Time management is an important part of being a successful developer and this situation certainly isn't one I would delegate a lot of time to.
we're smiling but we're close to tears, even after all these years
I can guarantee for a well-skilled developer, doing regex over explode in this situation would be the same amount of time - if not quicker.
Your point of "this isn't commissioned as he has to ask how to use explode, so there's no point spending a lot of time on it.", holds no backing in my opinion. Explode would get the job done, but as he is clearly learning it would be better in the long run if he learns it (regex) now. Albeit not the best example.
He doesn't have to use it, but the option is there if he wants to.
Last edited by Source; 03-06-2010 at 06:33 PM.
I think efficiency is the most important. If you're working for Google, Facebook or Youtube who get thousands of connections every second, they want what's best for both the server and the client.
It's like Object-oriented PHP, it takes a while to learn but the output is a lot better.
Writing the regular expression over explode? Explode would be much faster.I can guarantee for a well-skilled developer, doing regex over explode in this situation would be the same amount of time - if not quicker.
Your point of "this isn't commissioned as he has to ask how to use explode, so there's no point spending a lot of time on it.", holds no backing in my opinion. Explode would get the job done, but as he is clearly learning it would be better in the long run if he learns it (regex) now. Albeit not the best example.
He doesn't have to use it, but the option is there if he wants to.
It holds in my opinion. If I was developing something for my own personal use, efficiency wouldn't be a paramount concern for me, simply getting the code done would be much more important. Fair enough, if he wants to learn about it, using regex would be a good idea. However, personally, I would use explode if this wasn't commissioned, simply because of how quick using explode would be.
I never said efficiency wasn't important. I said efficiency isn't important for a small scale, personal script. Efficiency is one of the most important considerations when coding something that will be public, even if it's not a site with a high footfall. Yes, I understand about OOP considering I code Actionscript 3 which is entirely OO based. I'm not disagreeing with any of the things said in this thread, simply stating my opinion on how I would approach this if it was my project.I think efficiency is the most important. If you're working for Google, Facebook or Youtube who get thousands of connections every second, they want what's best for both the server and the client.
It's like Object-oriented PHP, it takes a while to learn but the output is a lot better.
we're smiling but we're close to tears, even after all these years
You must have never worked with a large log before. When you start getting thousands, ten thousands, and hundred thousands of records.. you want to view and sort through them rather quickly.
A bodged down application, which has a flawed solution will only create more stress. It would be easier to match the string, then explode it instance by instance until you get what you want.
Explode isn't the best solution when it comes to this. If structure changes, your entire explode sequence would too. If it changed with a simple regex, one line would have to be configured.
Personal project or not, you should always code to long term time-saving, as well as efficiency.
I know I'd rather edit one / two lines of regex matching, then 7-8 lines of exploding and finding, then separation.
Whether it is just you, or an actual customer.. when it comes down to it in the future you will be glad you chose the right solution over the "fastest" solution for you to do. I've done it many times and regretted it when it came to modification / update time.
Last edited by Dentafrice; 08-06-2010 at 12:22 PM.
Thanks for telling me I have never worked with a large log file. I made a questionnaire system for a client, parsing thousands of rows to a CSV file, all done with regex. I stand by what I said.You must have never worked with a large log before. When you start getting thousands, ten thousands, and hundred thousands of records.. you want to view and sort through them rather quickly.
A bodged down application, which has a flawed solution will only create more stress. It would be easier to match the string, then explode it instance by instance until you get what you want.
Explode isn't the best solution when it comes to this. If structure changes, your entire explode sequence would too. If it changed with a simple regex, one line would have to be configured.
Personal project or not, you should always code to long term time-saving, as well as efficiency.
I know I'd rather edit one / two lines of regex matching, then 7-8 lines of exploding and finding, then separation.
Whether it is just you, or an actual customer.. when it comes down to it in the future you will be glad you chose the right solution over the "fastest" solution for you to do. I've done it many times and regretted it when it came to modification / update time.
we're smiling but we're close to tears, even after all these years
Then why would you not use the better method in an application like this? Are you saying you don't spend as much time implementing a good solution when it's work for your own self, or as you said small sites..?
If you used regex on your questionnaire system, there had to be a reason right? It worked better.. it was more efficient.. it got the job done right.. but yet on something of similar nature, that might not be as important.. or as popular.. you're saying implement a solution that will prove to be more work in the end, if it ever needs changing.. as well as pointlessly complex for what he needs.. correct?
Sounds like laziness.
Also, you call thousands of rows of questions a large log file? What about access logs, ever worked with them? They get quite large.. way larger then any questionnaire system ever would get. They require characteristics that other things do not.
Last edited by Dentafrice; 08-06-2010 at 02:19 PM.
At the end of the day the way I code for my own personal things are the way I chose to do it. Yeah, I'm lazy when I'm coding for myself, that's because I've been coding for clients for too long and coding bores me, money is the only thing that inspires me to code, hence why I code ANY commissioned work in the most efficient way I can.Then why would you not use the better method in an application like this? Are you saying you don't spend as much time implementing a good solution when it's work for your own self, or as you said small sites..?
If you used regex on your questionnaire system, there had to be a reason right? It worked better.. it was more efficient.. it got the job done right.. but yet on something of similar nature, that might not be as important.. or as popular.. you're saying implement a solution that will prove to be more work in the end, if it ever needs changing.. as well as pointlessly complex for what he needs.. correct?
Sounds like laziness.
Also, you call thousands of rows of questions a large log file? What about access logs, ever worked with them? They get quite large.. way larger then any questionnaire system ever would get. They require characteristics that other things do not.
we're smiling but we're close to tears, even after all these years
The issue comes down to the HxF community Caleb. People are extremely narrow minded and often mention about their client work in some attempt to *seem* professional.
My personal stance is that whether it is personal, or 'client' work you should always roll out the best possible code. Otherwise you get in to bad habits, look over things and start doing a generally poor job. It comes back down to 'regex wouldn't have taken that much longer than explode in this situation'.
It's a very bizarre stance one does have.
Last edited by Source; 08-06-2010 at 03:53 PM.
Want to hide these adverts? Register an account for free!