This or that / old or new

ยท

1 min read

I have this fear.

I land a dev job, only to find I'm stumbling over unfamiliar code. ๐Ÿ˜ฑ

Where it works but I don't know why, or it's just simply outdated, and I've had little to no exposure to this alternative approach.

EDIT I'm starting to realise chat gtp is handy for this stuff too.

My response of course is to make a list. A list of concepts and things to remember that either once worked a little differently or have multiple ways in which they can work.

Updated as I come across them.

So, this list may get long and it may just be a massive can of worms. ๐Ÿ—‘๏ธ ๐Ÿชฑ๐Ÿชฑ ๐Ÿ›

This or That

Topics where I can take different approaches

Laravel:

Layouts or Components

CRSF Authentication

vite.config.js used to be something called mix (apparently I will hear this when watching Laracasts)

Calling a route

//The Modern way
Route::get('contacts', [ContactsController::class, 'index']);
//The Old Way
Route::get('contacts', 'ContactsController@index');

Testing:

Unit testing or Pest Testing

PHP:

old array
array($thing, $otherThing);
modern array
[$thing, $otherThing];

new shorthand echo
<?=$randomNum ?>
old echo
<?php echo $randomNum ?>

Have you ever found yourself getting tangled in different approaches and outdated coding styles? Let me know in the comments.

Mac and Windows differences

Laravel uses .notation so on my mac contacts/index is contact.index

ย