Tagged Questions
1
vote
0answers
27 views
PHP Framework that favors better general habits over convention
This is intended as an objective question. I've been reading about most of the Frameworks for PHP. We use Cake at work, and I've had exposure to CodeIgniter and Symphony.
They all have their own ...
0
votes
1answer
47 views
Automating form error handling
I'm not sure if I'm being clever or making things more difficult. I'm working within a custom MVC framework, and within some of my "views" which contain forms I'm preserving input and styling errors ...
0
votes
2answers
163 views
Is it better to use already build plugins/extensions or code your own in programming projects [duplicate]
I am building a web app in PHP and Symfony.
Basically if we search there are plugins / extensions / bundles for almost 60% of stuff.
The advantage of using them is that you can easily get your ...
1
vote
2answers
162 views
Is it bad practice to follow up a call to a terminating function with exit()?
I'm currently working on a php frontend. Specifically, the authentication process.
I'll spare everyone the exact details of the decision tree, but it includes a lot of checks and about half of them ...
0
votes
2answers
271 views
In PHP, should I delete objects immediately after use?
I've read in PHP Advanced and Object Oriented Programming by Larry Ullman that it is good programming practice to delete object immediately after use but reason is given nowhere.
I am a student web ...
1
vote
4answers
258 views
What's the most readable way of echoing from PHP?
Should I use
<?php
if(!$user->is_logged_in()){
echo '<p id="login">Click <a href="login">here</a> to log in</p>';
}
?>
or
<?php
...
8
votes
4answers
566 views
Is error suppressing bad practice?
On a SO question I asked here about some code I was unsure about, someone replied "BTW, horrible code there: it uses the error suppressing symbol (@) a lot."
Is there a reason why this is bad ...
2
votes
1answer
276 views
PHP high traffic default page
I have a php website that will be experiencing high levels of traffic in a few weeks. We scaled the servers to accept the traffic, but want some sort of fallback page in the event that something ...
1
vote
1answer
141 views
How to maximise the features of MySQL when used with php
I asked this question a while back on SO (http://stackoverflow.com/questions/15506040/maximising-the-features-of-php-and-mysql-when-used-together) but it's a recurring topic, so I thought I'd ask in a ...
1
vote
2answers
435 views
How can I work on multiple programming languages at same time [duplicate]
It always happen to me that if I leave the stuff for 1-2 months I forget the stuff.
5 months back I had symfony project and I did that. At that time I was very much confident that I can do any ...
1
vote
1answer
434 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
2answers
162 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
450 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 ...
4
votes
3answers
501 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 ...
3
votes
2answers
870 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
274 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 ...
6
votes
2answers
530 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
436 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 ...
28
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 ...
6
votes
4answers
1k 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
167 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
146 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
2k 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
3k 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?
20
votes
10answers
2k views
Struggling as a programmer. Need some advice [closed]
I've been a developer now for a number of years. I'm pretty good at what I do and can "get the job done".
But, there is a difference between "getting the job done" and "doing the job properly". Let's ...
3
votes
3answers
936 views
Code to simulate a users actions, such as logging in
I've recently begun working on a PHP application, replacing another developer. I believed the application was using an API to communicate with a remote service but when I looked through the code I ...