Tagged Questions
1
vote
1answer
118 views
Which practice is the best for database connection? (PHP, etc)
Leave a open database connection throughout the execution of the aplication, or for each time a operation will be executed a new connection will be created?
Open throughout the execution:
Open ...
0
votes
1answer
104 views
How to begin with web development in PHP [duplicate]
As I am the New Learner in the PHP Web Development and I want to become a good web developer who can at least make a good and dynamic web site quickly.
Currently I have learnt the following things:
...
0
votes
2answers
137 views
Custom error handling
I'm trying to figure out the best way to handle custom errors in my application.
Option 1:
if(expr) {
} else {
$_SESSION['error'] = "Some message describing the error";
}
Option 2:
if(expr) {
...
3
votes
3answers
279 views
Multiple parameters vs single parameter(object with multiple properties)
I have an Entity Student with following properties - (name, joinedOn, birthday, age, batch, etc.) and a function fetchStudents(<params>).
I want to fetch students based on multiple filters.
In ...
3
votes
3answers
369 views
What is the best practice, point of view of well experienced developers [closed]
My manager pushes me to use his self defined best practices. All of these practices are based on is own assumptions. I disagree with them and I would like to have some feedback of well experienced ...
1
vote
2answers
158 views
What are the benefits vs costs of comment annotation in PHP?
I have just started working with symfony2 and have run across comment annotations.
Although comment annotation is not an inherent part of PHP, symfony2 adds support for this feature.
My ...
3
votes
3answers
180 views
Sites with overlapping code-bases. Developing multiple sites with little changes
I have to develop 3 different sites
video.com for hosting video
audio.com for hosting audio
docs.com for hosting docs.
domain names for example only
Almost 80% of the functionality is the same ...
5
votes
2answers
471 views
Is it bad practice to output from within a function?
For example, should I be doing something like:
<?php
function output_message($message,$type='success') {
?>
<p class="<?php echo $type; ?>"><?php echo $message; ...
3
votes
3answers
363 views
Is there a limit on how many global consts are used before an application is considered bad programming?
Basically, I develop websites, some large with many crud operations, etc...
However I've gotten into the habit of storing re-usable data as a constant in my PHP applications
I currently have 44 ...
26
votes
15answers
2k views
Is it wise to be going back and forth between two programming languages? [closed]
I have been writing quite a lot of PHP for nearly two years. Now I am doing .NET (mainly c#) development. However, sometimes I go back and do some php.
My main question is, is it wise for me to ...
5
votes
4answers
421 views
What is a good starting point for small scale PHP development and would a framework be overkill?
I'm a web development intern working on a small PHP application (just a few pages with a little database access) which has fast become a couple of very non-DRY, non-OO, individual scripts.
A ...
1
vote
4answers
151 views
In a web application, is it ok to group multiple pages in one view class or one class per page?
If you are building a web application, and you have a user management component, is it recommended to do:
class UserAdminView extends View {
}
or
class UserAdminUpdateView extends View {
}
...
1
vote
1answer
134 views
Older PHP v/s newer PHP version [closed]
My company is building a website with database. Programmer's used PHP 5.0. My Service Provider (shared) in the meantime upgraded to PHP 5.3.0.
Fixes have been on going and seem endless...
Do I move ...
4
votes
3answers
1k views
URL Encryption vs. Encoding
At the moment non/semi sensitive information is sent from one page to another via GET on our web application. Such as user ID or page number requested etc. Sometimes slightly more sensitive ...
3
votes
4answers
1k views
What is best practice for log level in PHP?
When programming in C, I often get the advice to turn on many or all warnings and not ignore warnings.
Does the same hold in PHP, should I enable all warnings in the PHP log?