Welcome Guest, Not a member yet? Register   Sign In
formaldehyde and CI
#1

[eluser]alxjvr[/eluser]
hello,

has anyone tried out formaldehyde (http://code.google.com/p/formaldehyde/) with CI?

i haven't yet though. just curious if anyone has an experience to share.

best regards,
alxjvr
#2

[eluser]darkhouse[/eluser]
I don't know anything about formaldehyde, I just skimmed it, but it looks like it's just a way to debug ajax apps? If so, just use the FireBug plugin for FireFox. Just open it, click on Net (make sure it's enabled in the little drop down arrow), and test your javascript functions. It will show you the calls it's making to your php scripts, and then show you the output, which is great when you have a php error or something.

No need for extra code just for debugging.

Edit: I didn't even notice the screenshots show FireBug for debugging... so now I'm confused why this even exists. It looks like it's just so it generates an error in Javascript... but why would you need that when you can see the php error right in FireBug? Is it just so you don't have to open FireBug?
#3

[eluser]Unknown[/eluser]
I was hoping to find integration instructions for Formaldehyde as well... as a newbie I can use as much debugging help as possible... as for the last post, read this: http://code.google.com/p/formaldehyde/wiki/FirePHP
#4

[eluser]Nick Husher[/eluser]
Wow, that's definitely something I'll have to investigate.

@darkhouse: it's a library that intercepts PHP errors and reformulates them as JSON objects so you can properly handle them in your application. The example basically shows what happens if you try to call a non-existant function in a JSON service view, resulting in an exception and some definitely-not-JSON behavior. With Formaldehyde, you can avoid such things more easily.
#5

[eluser]darkhouse[/eluser]
Thanks, but I still don't see the benefit when you can see errors in firebug. If it's for displaying php errors to your users, that's a bad idea altogether. A properly functioning ajax application shouldn't have any php errors, and for debugging those, firebug works just fine, no need to pump them back through the javascript. The only time an error should be displayed to a user is when they do something wrong, in which case your php should be returning that error to javascript anyways for you to display it to the user however you want. Sorry, I just don't see the benefit of formaldehyde.
#6

[eluser]Nick Husher[/eluser]
That assumes that nothing will ever go wrong with your application. In something medium or enterprise-sized, that's a totally unrealistic assumption. If you aren't testing every branch of the code before every release, you're going to have the occasional run-time error. If you're making tens, hundreds, or perhaps thousands of asynchronous queries (as apps I have built in the past have done), it can be difficult to track down which one it was that was throwing the error. Formaldehyde has a client-side library that automatically catches formaldehyde errors and throws them as javascript exceptions that are easy to spot in the console.

Of course this is of limited use if you're only making occasional asynchronous calls, but in very "chatty" RIAs, I can definitely see the value in formaldehyde.
#7

[eluser]darkhouse[/eluser]
Well, I must be missing something... but I'm not going to dwell on it. I have my methods of debugging and they haven't failed me yet. Carry on.




Theme © iAndrew 2016 - Forum software by © MyBB