Res facta quae tamen fingi potuit (
pauamma) wrote in
dw_dev_training2013-07-20 01:12 pm
![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
![[site community profile]](https://www.dreamwidth.org/img/comm_staff.png)
Entry tags:
Question thread #10
Again, it's been way too long since the last question thread (why didn't anyone poke me?) so let's have another one!
The rules:
- You may ask any dev-related question you have in a comment. (It doesn't even need to be about Dreamwidth, although if it involves a language/library/framework/database Dreamwidth doesn't use, you will probably get answers pointing that out and suggesting a better place to ask.)
- You may also answer any question, using the guidelines given in To Answer, Or Not To Answer.
And since no one poked me this time either: do these still serve a useful purpose? And how often would you like to see them, if at all?
The rules:
- You may ask any dev-related question you have in a comment. (It doesn't even need to be about Dreamwidth, although if it involves a language/library/framework/database Dreamwidth doesn't use, you will probably get answers pointing that out and suggesting a better place to ask.)
- You may also answer any question, using the guidelines given in To Answer, Or Not To Answer.
And since no one poked me this time either: do these still serve a useful purpose? And how often would you like to see them, if at all?
no subject
I would say they are useful.
no subject
Compiling
This week I started writing a question about a bug I was stuck on, and putting the question together made me realize what the answer was, so the thread has already helped me.
So now I have another, more general question: working on a Dreamhack, how do I check whether my code compiles? Up to now I've been working in S2, where I can compile either in the S2 editor or by doing a database update via the command line. But for patches that are back-end, rather than S2, how do I screen out syntax errors? So far I've mostly been working on code that directly generates webpages, so I can go to my hack and sometimes get a meaningful error on the page. But what if I'm working on code that doesn't print anything, how can I tell whether it compiles correctly?
Re: Compiling
- If your code is part of a Gearman or TheSchwartz worker: just starting the worker at the shell prompt in your dev. environment (devhack or standalone) will tell you. If your code doesn't compile, you will get a perl error message.
- If your code is web frontend (perl code that generates HTML to be sent to your browser), or web backend (perl code that does everything else related to a browser request, like posting an entry or a comment, retrieving data from the database servers, etc.), it is usually loaded at the time you start Apache, then check your Apache error log for messages about perl syntax errors. (Can't remember offhand where it is, but I think ~/Apache/logs/error or something like that.)
- In some cases, web frontend or backend code might not be loaded until actually used. In that case, you need to fire up your browser and perform the appropriate task (view page, submit entry or comment, change account setting, etc.) before checking the Apache error log.
- If your code is web user interface code written in Javascript, the tools available for syntax checking and reporting errors are usually plug-ins for your browser, like Web Developer for Firefox. (IIRC)
Re: Compiling