0
votes
1answer
36 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
147 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
154 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
227 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
253 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
523 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
262 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
132 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
413 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
419 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
160 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
427 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
463 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 ...
2
votes
2answers
723 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
259 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
524 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
421 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
165 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
145 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
816 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 ...