Click here to Skip to main content
15,887,214 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
JokeRe: An extension to Fix my AI, or my latest experience which was positive. Pin
fgs196319-Sep-23 8:00
fgs196319-Sep-23 8:00 
GeneralRe: An extension to Fix my AI, or my latest experience which was positive. Pin
jkirkerx19-Sep-23 9:04
professionaljkirkerx19-Sep-23 9:04 
GeneralRe: An extension to Fix my AI, or my latest experience which was positive. Pin
Mike Hankey19-Sep-23 10:02
mveMike Hankey19-Sep-23 10:02 
GeneralRe: An extension to Fix my AI, or my latest experience which was positive. Pin
BillWoodruff19-Sep-23 15:37
professionalBillWoodruff19-Sep-23 15:37 
GeneralRe: An extension to Fix my AI, or my latest experience which was positive. Pin
Super Lloyd19-Sep-23 19:04
Super Lloyd19-Sep-23 19:04 
GeneralRe: An extension to Fix my AI, or my latest experience which was positive. Pin
jkirkerx20-Sep-23 6:39
professionaljkirkerx20-Sep-23 6:39 
GeneralRe: An extension to Fix my AI, or my latest experience which was positive. Pin
jschell20-Sep-23 13:30
jschell20-Sep-23 13:30 
GeneralRe: An extension to Fix my AI, or my latest experience which was positive. Pin
jkirkerx20-Sep-23 13:52
professionaljkirkerx20-Sep-23 13:52 
It was a 23 year old PHP application, where the code was mixed in with HTML in a real bad way. I couldn't even read the code, that bad. Hardly any reusable code was written, so I picked out the code and created reusable functions and concentrated on creating models or objects first. It came down to not wasting time on bad functions that didn't work. Finally it was time to take the functions that actually worked correct and optimize them, and toss out the ones that were not being used. It's the project from hell, with never ending surprises from just poor design to begin with. I wonder why a university taught them this.

They wrote functions to repeat HTML or generate it, and inlined database code.

Here's a sample ...
$cost_sum = 0;
    $select = '';

<pre>
$get_cost = " 
SELECT SUM(proj_cost.Cost), proj_cost.Vend_ID
FROM proj_cost 
INNER JOIN vendor ON proj_cost.Vend_ID = vendor.Vendor_ID 
WHERE (proj_cost.Proj_ID = '$proj_no') 
  AND (proj_cost.Proj_Stage = '$proj_stage') 
  AND (proj_cost.Vers_ID = '$ver_no') 
  AND (proj_cost.Task_Oper = '$cat_ID') 
  AND vendor.delete_flag <> '1' 
GROUP BY proj_cost.Vend_ID 
ORDER BY proj_cost.Vend_ID ";

$res_cost = sqlsrv_query($conn, $get_cost) or Die(" 464:" . print_r(sqlsrv_errors()) . " <br /> ");
if (sqlsrv_has_rows($res_cost)) {

    while ($row_cost = sqlsrv_fetch_array($res_cost)) {

        $cost = $row_cost[0];
        $vend_id = $row_cost[1];
        $cost = $cost + $comment_cost;
        if ($job_vendor == $vend_id) $cost_sum += $cost;
        $vend_name = clsGetPart::getVendorName($vend_id);

        echo "<td class='text-align-left' width='10%'>";

        if ($job_vendor == $vend_id) {
            printf("<p class='margin-text-indent font-weight-bold text-red'>$vend_name <br /><b>$%.2f&nbsp; </b></p></td>\n", $cost);
        } else {
            printf("<p class='margin-text-indent font-weight-bold text-black'>$vend_name<br />$%.2f&nbsp; </p></td>\n", $cost);
        }
    }</pre>
If it ain't broke don't fix it
Discover my world at jkirkerx.com

GeneralRe: An extension to Fix my AI, or my latest experience which was positive. Pin
jschell21-Sep-23 4:37
jschell21-Sep-23 4:37 
GeneralRe: An extension to Fix my AI, or my latest experience which was positive. Pin
jkirkerx21-Sep-23 6:38
professionaljkirkerx21-Sep-23 6:38 
GeneralRe: An extension to Fix my AI, or my latest experience which was positive. Pin
jschell23-Sep-23 14:21
jschell23-Sep-23 14:21 
GeneralRIP Roger Whittaker Pin
Cp-Coder19-Sep-23 5:32
Cp-Coder19-Sep-23 5:32 
GeneralMy TV/Monitor woes have ended Pin
honey the codewitch19-Sep-23 4:39
mvahoney the codewitch19-Sep-23 4:39 
GeneralRe: My TV/Monitor woes have ended Pin
jschell19-Sep-23 5:54
jschell19-Sep-23 5:54 
GeneralRe: My TV/Monitor woes have ended Pin
honey the codewitch19-Sep-23 6:14
mvahoney the codewitch19-Sep-23 6:14 
GeneralRe: My TV/Monitor woes have ended Pin
LucidDev20-Sep-23 6:53
LucidDev20-Sep-23 6:53 
GeneralMy display is stuffed Pin
pkfox19-Sep-23 4:23
professionalpkfox19-Sep-23 4:23 
GeneralRe: My display is stuffed Pin
Richard Deeming19-Sep-23 4:31
mveRichard Deeming19-Sep-23 4:31 
GeneralRe: My display is stuffed Pin
pkfox19-Sep-23 4:37
professionalpkfox19-Sep-23 4:37 
GeneralRe: My display is stuffed Pin
jschell19-Sep-23 5:59
jschell19-Sep-23 5:59 
GeneralRe: My display is stuffed Pin
pkfox19-Sep-23 6:03
professionalpkfox19-Sep-23 6:03 
GeneralRe: My display is stuffed Pin
obermd19-Sep-23 6:45
obermd19-Sep-23 6:45 
GeneralRe: My display is stuffed Pin
OriginalGriff19-Sep-23 8:38
mveOriginalGriff19-Sep-23 8:38 
GeneralRe: My display is stuffed Pin
milo-xml20-Sep-23 1:53
professionalmilo-xml20-Sep-23 1:53 
GeneralRe: My display is stuffed Pin
Bruce Patin20-Sep-23 4:05
Bruce Patin20-Sep-23 4:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.