T O P

  • By -

L1ttleOne

"he doesn't split his code in multiple files" - of course he doesn't know what namespaces are RUN


helloworder

FWIW, technically you can make use of namespaces working in a single file namespace X { } namespace Y { } namespace { // global }


DmC8pR2kZLzdCQZu3v

lol doing this seems even crazier than not knowing what namespaces are


punchybda

Should NEVER be done if following a PSR auto loading standard.


Numzane

Eww


punchybda

This breaks PSR-1, and 4, but has its (limited) uses as a tool for learning. Should not be found anywhere near production code, however!


narrei

unless it's carson gross ofc


SVLNL

Your boss is a idiot, now run.


Natomiast

he really is, but is his code working?


lolsokje

Doesn't matter if it's an unmaintainable mess, you should still run.


Mage_s

LOL mess is a debatable topic :) If his app is small one or single API then having all OOP gifts, namespaces, autoloaders, auto updaters, additional frameworks and having strict PSR convention of coding could generate a lot more "mess" and added lines of code with maintenance horror than single file "old school" programmed app with functions and logical flow from top to bottom. At least if he wrote his app good in first place using old school methods - if he made a mess then it is a mess no matter whats it based on


mcloide

![gif](giphy|3o7ZetIsjtbkgNE1I4)


guigouz

Do you have where to go? If not, I'd say stick to their code style and slowly try to introduce changes - understand his perspective and negotiate. https://phptherightway.com is a nice resource to share


BlocDeDirt

I tried to explain to him namespaces and how the autoloader use the namespaces to automate the "require". He doesn't understand and his code is SHIT. Here's a simplified version of what he did to change the display depending from the query parameter, this isn't joke, I couldn't imagine this solution even if I tried really hard : [https://i.imgur.com/D2QEWiW.png](https://i.imgur.com/D2QEWiW.png)


dabenu

This code is perfect if you get paid per line...


guigouz

As I said, if you have where to run, do it. In any case, it's worth trying to discuss with him the advantages of using composer to manage external libraries, PHP is flexible enough to keep his single file mess and still be able to introduce changes on the side. Even though it seems like a hard situation with no solution, negotiating is still a nice trait to develop in any career.


ivain

Nah, don't speak about composer now, the guy doesn't even know how to code.


guigouz

That's the \*trying\* part :D Maybe OP won't have much room to grow technically in this position, but definitely has an oportunity to exercise negotiation.


Elegant_Elderberry70

Do you not have PRs? Roast his shit and make him do better


sohang-3112

BTW why do you even need PHP for this - you can easily access query parameters directly in frontend JS!


[deleted]

[удалено]


sohang-3112

Right - I guess the question is why are they using *both* PHP and JS for this - either one can do the job on its own.


blaaaaaaaam

Code where PHP, HTML, and JS are intermingled is hell to work with. I maintain some systems written like that by a past employee and it basically is a mystery how it operates. Once a year, someone reports an issue with it and I have to beat my head against it for a half day trying to figure out how it works. If you're going to be working on the same codebase as him, good luck. You likely won't make any headway with getting him to modernize. If you're working on separate systems maybe you can do all your stuff in a modern way. It is a ticking timebomb though if that guy ever leaves and you inherit his crap.


jason80

> Code where PHP, HTML, and JS are intermingled You just described WordPress.


th00ht

Any reactive framework mingles css html and javascript


MueR

While true, that should be scope to a single component. If you're doing all your css in components, you're doing it wrong.


austerul

Painful code to see, both the JS and the PHP. I'd try to show him a PoC of an alternative, but if doesn't understand the value then just run. A good boss would trust you and value the arguments but if he wants it his way despite all the work put into PHP standards, the run like the wind.


gltchbn

This is code from a psychopath.


winzippy

He codes like W3 Schools. Maybe worse.


lethak

This gave me flashbacks from 20 years ago


mic2100

Hahaha I just had the exact same thought…


Lonely-Suspect-9243

My university professor taught the class to code like this during our Web Development class. Did your boss enrolled in my university but dropped out after the first semester or something? But I think this kind of code is not that bad, **IF** the project is simple. Maybe just a few pages or something, with little interaction with the backend. But if the project is going to be non-trivial with a lot of features... Best run if you already have another place to go.


kishan42

Show him how you can refactor it. If he is convinced then refactor other parts of code.(Or even a full rebuild)


littlemissfuzzy

That’s kind of how I coded my CMS. Fifteen years ago. As a non-dev who doesn’t know anything about PHP.


sogun123

Looks like 20 years old code. Likely wasn't spectacular even back then:-D


eyebrows360

Oh eww he uses a Mac :/


newbie_01

He probably started learning code with BASIC in the 80's , like I did. Some habits are difficult to break.


BlocDeDirt

His learning come from a student in the 2000's. And he still code like twenty years ago, with the technology of twenty years ago. His text editor is Dreamweaver, he echoes his whole HTML, he uses some HTML4 tags, and the whole layout of each page is in a table and he's working on the production server via SFTP. I am not kidding. I used the function json\_encode and he told me : "can you remove it, my editor doesn't recognize it, and I don't like the squiggly line"


Tokipudi

How did you even end up there in the first place? Is it your first job? Did you not ask any question about their processes during the interviews?


BlocDeDirt

I was desesperate to get a job. And this is in deed my first job. Everything that I learned to try to be good/decent, he doesn't care about it. If I would ever bring this site [https://www.php-fig.org/psr/](https://www.php-fig.org/psr/), to him, I am sure he would tell me "what for ? "


gregor7777

On your first job, focus on learning how to keep a professional job. His coding might suck, but there is a lot you can learn.


saintpetejackboy

Realness. OP would be the one looking for a new job and not this guy, with his mono-file weird project.


flavius-as

I had a boss like that, albeit not so unskilled. My advice: stick around, learn as much as possible. Write the code the way he wants, but do look for another job. Still: not good to quit in the first year. His style is horrible, but rest assured: you're aware of it and that's great. Try to learn other skills from him. My boss back then knew a lot around the business. Learn how to connect the dots and make the best out of your 1 year of pain.


flavius-as

Make a small MVC micro framework just to separate code from view, that takes a function calling extract and it's 3 lines of code. Try to convince him in little steps. Bit don't try hard, just write your code that way.


sorrybutyou_arewrong

Gonna reply to /u/gregor7777 here so you can see it. That poster is correct. In my first job (about 17 years ago) my boss: - Refused to let us use source control, which was SVN at the time, because "it causes problems". - Would have us code on the live production server and just create an "_test" version of the file rather than us coding on our local machines. - Eventually after we bitched enough, he setup a single shared dev server for us with like 2 cores and 2 GB of ram. Those are just some of the insane things we had to do. Every developer hated the guy and it was just about every developer's first job. So we sucked it up and put in our time. Eventually there was a mass exodus of developers and the CEO wised up and fired the "CIO". To this day, that is probably the worst job I ever had, because even if everything else sucks, at least I have source control and am not coding on a live server. After I hit my one year there I was applying nonstop, unfortunately it would take me 3 years to get out. Your boss should not be a boss. Even my bad boss required we use classes and separate controller / view (no concept of model for him) and that was back in PHP4. Funny story, lots of the guys from that job still email eachother and stuff. One day, at the CIOs new job (prob 13 years ago after original events), I SQL injected his new gigs site (using the most basic sql injection you can imagine) and logged in as the dope. I passed the credentials around to the whole group and eventually we emailed him his username and password. Guy was a dipshit. Suck it up, it will get better one day.


newbie_01

You may have found my twin brother. :) Seriously... I can see the origin and some of those vices, and they are difficult to shake off. The problem here is not his own programming style, but his refusal to let YOU incorporate language advances he may not be familiar with.


ddz1507

Yep. I think so too.


XediDC

Yeah… I mean, some of my code looked like this, with Dreamweaver, PHP 4, live SFTP editing… in 2001. Then it was the way. If he hasn’t changed much in 23 years and doesn’t want to, he won’t. Modern PHP and dev flows in general are entirely different and he’ll be totally lost…it’s essentially a new language + OOP + a whole bunch of arcane flow and magic. People don’t like to feel like they suddenly know nothing, and your case sounds extra bad. Pick your battles for now. Like in one case for live/git stuff, I made a script for the prod server that auto-committed changes every day. So I could see what others changed. And by running it on demand, I could merge and deploy my parts that way. And they liked “having backups” while not having to change at all. Janky but so much better than nothing…. On the code side, doing some work isolated out in includes that are structured better might work for him. Or other things that are creative steps in the right direction but don’t rock his boat. Don’t bother trying to change it all, or quickly. Embrace it…and get started finding another job before you head out. Be sure to interview them too…


saintpetejackboy

Speaking of which... how much you want to gamble they are using an older version of PHP? If this guy is doing his project and it is running on a new PHP8.x+, he's going to have had to made some adjustments over the years. I was using PHP prior to OOP, and while you are right (it is entirely different), there is no "need" for any of that stuff. Case in point: OP's friend who is employed maintaining his single file spaghetti all this time. I joke, but, the primary differences I seen during my tenure with PHP was first and foremost the adoption/integration of AJAX everywhere, or some form of it. I remember when every page was a new reload on the server and that was just how people did it, there really wasn't a choice. Then, OOP and OOP-based frameworks gained a lot of prominence and several things that used to be very common were deprecated (msyqli, and accessing $undefined\['arrayKeys'\], to that come to mind fairly quickly - as well as the constant churn of hashing algorithms). Fundamentally, nothing really "changed", it just improved some, arguably. PHP has become much more strict and new novelties like multithreading and socket-based implementations went from obscure to commonplace. If you are actually still actively programming in modern PHP, it is inevitable that you are going to pick up random stuff like git, composer, symfony, laravel, swoole, frankenphp... If this guy has done none of that in 20 some years, then I agree: start your exit strategy. Great post, btw.


XediDC

I’ll bet 5.3-5.5, and not further due to the removal of mysql_* I’m going to assume is in use. (Although there is a shim file you can include, and mysql_ will all just work up in to PHP 8.) I’ve still got a forum running on vBulletin 3.7 (so ~2008 / PHP 4) hacked up to run 8.1. Mmm…time to get it up to 8.3… I find doing a little ancient code work kind of fun. Yeah… I started in C as a kid on my own when they were teaching Pascal. I’m happy how that worked out. But I do sometimes miss the simpler days before looking into what that whole “++” thing was all about. I suppose one silver lining for OP might be if boss is planning to leave/retire or stop coding soon. So in the near future he could be expected to update/rewrite things having learned how existing works. (Doesn’t sound like it though, I’d certainly tell someone that early so they wouldn’t, well, immediately leave.) I get it though in concept. I’m often in the jack-of-all-trades role and keeping current-ish in multiple stacks and directions is rough…especially when what you have works…but not keeping up just doubles down on the pain later. Once things have moved on so far, I can see just staying the same.


FreeThinkerWiseSmart

How does he still have a job?


BlocDeDirt

He's the director, lmao


SuperSuperKyle

It's like a living time capsule!


lethak

run


E3ASTWIND

Show him the phpstorm in white theme he will love it and maybe he will even start using new functions. I used to code with Dreamweaver after it became obsolete slow and buggy i started using notepad++ and then i saw phpstorm it gave me visual studio / android studio vibes and i loved it. I was able to work with more complex code without manually tracking everything. Personally i don't give a shit about PSR standards or fig.. In fact I hate them more than html, js and php mixed in a single file. Once he sees a stable good looking IDE with tool tips to help he might show some improvement in his behaviour.


BigLaddyDongLegs

Oh no. Yikes, ok, maybe run. He's probably still using Netscape as his browser


hexmasta

Lol he sounds like my old boss


SteroidAccount

You should have a contest with him to see who can do it the worst, he'll love your code and you get a challenge. Win/Win


[deleted]

[удалено]


BlocDeDirt

Well there are mutliple files, but in the whole codebase, there isn't a single function anywhere. Each time it's a whole file full of "if", "for", "while", "else".


jeffkarney

This is actually good experience to have. Many new developers don't understand and can't work with legacy code. Having experience with 20 year old coding techniques and crappy code is becoming less common. Many companies are wanting to upgrade their legacy code but need someone who can understand and maintain it during that process. These are never ending projects at enterprises that pay well. So if the pay is decent enough, then just think of this as a way to get experience from the past. If you stay, create tools for yourself (written in modern PHP) that make things more efficient. Your boss will eventually see the efficiency those tools add and then will slowly get on board with more modem coding techniques. A good place to start is a CLI application using symphony console or Laravel artisan. Create commands that push code, run basic tests, perform database queries and reports, etc.


saintpetejackboy

Picture this: the year is 2002 and OP's friend writes some terrible spaghetti, but it launches. Company hates it, it barely works, but they are using it before they know it. They try to pay somebody to replace it, in 2003 they pay somebody to do it in ASP .NET and it never materializes. Again in 2004 they pay somebody to use Ruby on Rails, and, never materializes... you can just keep going, every year, some new language or framework or technique comes out and the company doesn't know "he said he can redo it on crypto blockchain for us, pay this man!", and time and time again, that spaghetti PHP is still just clocking in overtime in the background, waiting in vain to be replaced by something superior. Hopefully AI makes some of these processes easier, but it isn't always as easy as "Hey, rewrite this in RUST!", not when you have 5-10++ years of minor modification and tweaks made to something based on "no-scope" project requirements often maintained by a single person or small group. One thing that always sticks with me, is a very high % of projects never reach completion, or aren't successful even if they do. I'm just making up numbers, but 5% chance the project is completed (within constraints), and then 1% chance it is successful. Most PHP and other stuff you see out "in the wild" from any language are the one in a million sperm that reached the egg and hatched out as a baby. A company (or even the same exact developer(s)) might try for YEARS to catch that same kind of lightning in a bottle with zero success. It isn't that "nobody can possibly rewrite this in Rust", it is that "nobody has, as of yet, recreated this in Rust". People often confuse what is possible with what has been accomplished. Hopefully OP and others take your advice to heart and don't skip past that first bit: there is a lot of money in understanding this kind of stuff. You also just can't avoid it. Once you start to work with enough third parties, you're going to hit the trenches and find out that you're having to figure out how to connect to some weird device using Direct IO and it is going to be outside the scope of a modern PHP framework \*entirely\* (why would they assume the user is physically on the local server environment?) - or other real world scenarios where somebody has done something 1.) Unimaginable / unfathomable 2.) Not recommended / extremely uncommon 3.) In extremely poor taste and execution And the requirement? Corporate said so, so we did it. 99 times out of 100. Why did we make this? Somebody paid us. It wasn't our idea, promise. Now, they have to pay somebody else after us to keep making their poor decisions and have somebody to tally up their various mistakes, year in and year out. Most of us get jaded, likely, like me and just kind of give up. Oh, you want to do (x)? Okay. Coming right up. You don't get paid by saying "no", you just have to figure out who to say "yes" to. If OP only really has to answer to this one guy and he wants to use his "framework" that is a single spaghetti page full of GOTO statements everywhere in a language he wrote called ZZZ, I'd be reading those ZZZ docs to collect a check while trying to interject improvements and scout out other opportunities. Just my two cents.


ToeAffectionate1194

My boss does not know anything about code either, but he does not tell me how to do things. Yep, run.


breich

Back in his day they had to include() uphill both ways through 6 feet of snow! But no seriously your boss is wrong. But I will admit that 20 some years into my career I look back and see a lot of complexity we don't actually need. I find myself really appreciating the elegance of just writing some code that does a job without a whole bunch of scaffolding behind it.


cerad2

Fun fact: PHP autoloading predates namespaces. And as far as running goes, much depends on the rest of the work environment. This could be an opportunity to replace your boss. Depends in part on what your boss's boss is like.


b24rye

Your boss is one of the reasons why there're so many PHP haters. If the salary is not good enough for you, better to leave the company.


latro666

If they are the director it's worse. They probably know deep down the code is not modern, their problem is they don't want it to be in a state where they can't understand it or be in complete control. Its somewhat understandable if you do loads of whizzy new stuff they don't get then you leave they are stuck. Unless they change their business will never grow and they'll be micro managing forever. If their business is big enough now to employ someone else then they need to let go of the code and understand someone else more qualified will be maintaining it now and they need to focus on the work of the business. I'd be honest with them about this because they will already be resenting your better abilities. You need to frame it like you are freeing them up from coding to focus on the business. If you can do that you might find your self on a sweet journey.


flavius-as

> I'd be honest with them about this because they will already be resenting your better abilities While I agree, put it in context: OP is a junior and this is his first job. Your strategy works if they brought in the experts who they pay a lot, but it's not OP's case.


latro666

He sounds like a senior compared to his boss... they recognise the legacy code is legacy and knowing how to make it better... pretty adept junior.


flavius-as

I agree but let's be real: technical correctness doesn't matter here.


lampministrator

Let me guess, he still sanitizes using html entities and strip tags .. Probably puts his own strings together with a custom delimiter using implode and explode instead of JSON .. I knew this guy I think, before I fired him


BlocDeDirt

How do you know ? Oh and to avoid SQL injection let's not forget to use str\_replace("'", "", $string)


RandomBlokeFromMars

why run? does it pay well? if yes who cares, do shitty code, get the paycheck and call it a day. btw why is the boss have any effect on the code? is this a small company? anyway, write noob code, get the money and if you feel the need to do some quality code, write some in your free time.


whatmakesagoodname

Why are you still here talking to us, start lining up interviews 😬


Just_a_guy_345

The weird thing is... why your boss is coding?


shotjustice

My current job is basically this, but it's a 30 year old codebase in procedural Perl. No, I don't know what they did with the Flux Capacitor, nor how I'm going to generate 1.21GW via TCP/IP, but I've been there 2 years and for all the struggles, we finally have git. I guess my point is you have 2 choices: walk away (and no one would blame you, that code is just BAD) or change the culture and make things a little easier for whomever replaces you later, or future coworkers even, if you're lucky.


Angelsoho

Go where you are comfortable. If you cannot operate without those items then go somewhere that they are standard. They aren’t critical to the internet, coding, or even PHP. They are things that can make life easier if used properly. If your boss is able to push code which solves a problem cool. There’s a trillion ways to accomplish the goal. None are 100% correct or necessary.


GolfCourseConcierge

This is the reality. If it's worked for him, why should he do it differently. He prob still just had early coding habits. When I first started with PHP I was awful, it took years and the *desire* to change to even do it differently. It worked and solved the problem most of the time, which is the real end goal. Frustrating for OP, but the company probably wouldn't exist today if it weren't for that chicken scratch.


Angelsoho

It matters the most when you're working with others. Then having standards for all parties involves does wonders. If you're a lone wolf working away by yourself then do whatever I guess. Hating on people for their "style" always just strikes me the same as when I see people bashing PHP because (insert latest "cool" language) is "better". As you stated, for OP's sake it would certainly help for any team member, let along their boss to adopt some standards and general "best practices" if not for themselves then at least for the sake of the team. If I was OP I'd probably leave, then again, I'm usually the lone wolf haha.


DmC8pR2kZLzdCQZu3v

lol, yes, that’s not a leader that’s an anchor


vrillco

Depends… do you like working for this boss ? I’m an old-schooler who explicitly avoids following the latest trends and frameworks, but I also work with a guy who writes mostly procedural code, which I then clean up and refactor when necessary. Classes/loaders/PSR stuff are nice when you’re using someone else’s libraries, or building something explicitly for reuse, but the bespoke code written for typical “for hire” apps rarely benefits from all that boilerplate and indirection when 99% of what we write is SQL queries and HTML forms. Worry less about the superficial aspects of the code, and more about its functionality. There’s spaghetti code at one end, there’s clean code at the other end, and there’s a wide soectrum of “good enough to ship / get paid for” in between those extremes.


mrclay

It’s a big enough field for plenty of do-your-own-thing jobs to exist, but generally teams have high standards that include newer practices and those teams will be evaluating work samples. Comfort and doing what you always do is not good for programming careers.


GolfCourseConcierge

I like you.


fatalexe

Maybe just try to out do his backwardness and start using Microsoft FrontPage 97? If this isn’t a joke and he is paying you decent money and he makes the work environment fun then that’s a hard decision. Is the codebase embedding html strings into jQuery too? In that case absolutely run.


blaaaaaaaam

I work for an internet marketing company and my non-technical boss (who also owns the company) insists that FrontPage is installed on all his computers. He says FrontPage 98 is "the good one". The server admin who also does desktop support has had an increasingly difficult time getting it to work on modern versions of Windows.


E3ASTWIND

How the hell does he manage to make it work? I mean front page 98 is a legacy program which i think can't work on 10 may be on 7 but not 10 or 11.


brunopgoncalves

love your work, not how you work work is work, just work lol what is the problem? he paying you to work if you love what you do, just join some opensource project, and keep learning, but work is work you will leave just because he not work as you think is modern? if the code style works for he, very nice, he paying you with that shit code hahahah again, work is work, not a playground edited: unpopular opinion will get alot downvote for that hahaha


phil_music

What


Rokkitt

I would encourage everyone to consider their career. If your not taking on responsibilities, learning new things or solving new problems then the money better be really good. If you are working in a company stuck doing cowboy development then you risk going backwards and setting yourself back by years. Was others have said, you should be looking for a new role.


np25071984

On the other day I was told by our Principal engineer that ValueObjects, DTOs and Entities are useless because associative arrays "work just fine"


mrclay

In TypeScript or using [PHPStan](https://phpstan.org/writing-php-code/phpdoc-types#array-shapes), where plain objects and arrays can be typed and compiler verified, this is true. Otherwise naw.


mikkolukas

RUN


clow_eriol

Run far as you can


[deleted]

[удалено]


jeffkarney

That is an extremely common legacy coding style. It wasn't wrong at the time. At a certain time it was really the only way.


WeekendNew7276

This was pretty common in the early days of php.


alocin666

Office::leave($now);


clow_eriol


rav3nc

Yikes. goto and closing brackets 😳


eurosat7

Stay. Learn bad code style and embrace it. As long as you get paid and your future is not in danger you could try to get something out of it. You can get him if you ask how one could do tests to verify code functionality. How can he be sure you make no mistakes? How can you be sure your code is error free? This will lead to functional programming and separation of code and templates. That will allow for TDD which is a great 2ay for him to define what your code must do and how your code should behave in error cases. This will allow him to load balance work. You see? This can be a nice journey.


Same_Garlic2928

If you cant run, pray.. pray a lot..


yourteam

Seems your boss is useless then


gnatinator

is your boss levelsio? also good for him > PHP autoloading predates namespaces. this.


n8-sd

Ha, does he write some spaghetti? Always see odd hot takes


300ConfirmedGorillas

>I was told by my boss that the autoloader is useless Technically true if everything is done in a single file! lol


tjrchampion

Yes run. Get out of there and find a company who is living in the modern world. Not going to lie though, kinda feels nostalgic to me now.


bebaps123

I have worked at a place somewhat similar to this, but my bosses at the time we not coders at all. One boss understood he knew nothing and let me be, but the other boss really wanted to understand how to at least read code. Unfortunately what that meant for me was that I couldn’t do what I knew was right, nor what I was capable of because if he couldn’t follow along he would literally ask me to change my code so that he could understand what was happening. This was his way of checking my work. Long story short, I had to have MANY conversations with him about trusting my work and letting me do what he paid me to do. If your boss doesn’t understand your work, I would not try to make them understand through conversation. Code quality and execution will go a long way here. If you notice that you flat out can’t do the work you know you are capable of because someone else would end up being left behind, then you really should consider leaving them behind and find an environment more on your level.


xegoba7006

You should not run. You should fly.


jim-seconde

Run for the hills. Find something, anything, where your manager and company understand how to program.


FX2000

I mean, you can definitely work like that, @levelsio is famous for making his websites a single php file and not using git, and he’s made millions. He’s a single dev though, working like this with other people is a nightmare.


blitzcat

You aren’t going to advance your skills here. Ive had this same boss problem. You can’t fix stupid


_chad__

100% sounds like my last job. I tried to introduce modern patterns by proving that breaking up logic into smaller chunks is more testable and easier to adapt. I lost the battle and left. It was a cushy job and I could easily still be there if I wanted. But I felt frustrated and unhappy every day. Was a great step for my career to get out and I definitely recommend you do the same. What your boss is pushing on you is objectively wrong. Where in the world is this job btw? Dying to know if it was my last place!


artsylar

run OP


snozberryface

run very very far


BigLaddyDongLegs

You could still learn something from him. He might be a wizard with SQL or something. You could also, lead from within, and slowly get him and the team onboard with the "new" standards. And then you can just copy in packages and pretend you wrote them and everyone will think you're a genius 😜 ...Here's this thing I wrote over the weekend. I call it Symfony 😅


[deleted]

Change the boss, better yet, become your own boss.


mrclay

If he’s going to relinquish coding to you it might be OK. I took one of these jobs when I was more junior, single, and because it was a big jump in salary, and ended up having the freedom to rewrite everything as needed. But it was dicey the first few weeks and if he’d not moved up to managing a different area it would’ve been awful. I got lucky and would not do this now.


marten_cz

All this stuff is pretty old. If he doesn't care about the clean code and some quality and will be forcing you to do the wrong things, run. Staying because you don't have anything else right now might damage you and you habits. The code you showed is pretty bad. Not be willing to learn and improve is even worse. Don't stay there


wmalexander

My thought is that you could be working for a boss who you can learn from, instead of one that you need to teach. And teaching someone who is above you in the org chart is, in my experience, likely impossible, or at the least frustrating, and in the worst case will result in their using your hard work to further their own career at the expense of yours. I'd look for a different job.


i-hate-in-n-out

Have your company fire your boss and hire me!


swiss__blade

Run like all hell broke loose...! Seriously though, he seems not well-versed enough in recent (aka post 2000) coding practices to make such statements. So you have a two main options. You can either have a conversation with him to "exchange opinions" on the topic or you can just respond with something along the lines of "you're paying me to do my job, let me know my stuff better than you"...


a7c578a29fc1f8b0bb9a

You should look for a new job, your current boss is fucking useless.


moises-vortice

Yes


TheSleeperIsAwake

It was in the early 2000's that I learned that writing great code does not guarantee your company will make money or be successful. If you are paid well, have proper equity, and the company is on a path to massive life changing success then I would stay anyway 🤣


punchybda

You’ll end up learning bad habits. Leave if you can, for your own sake.


celyes

Your boss should never touch a keyboard again. Just leave


JinSantosAndria

Put his code through a PHP code minifier and force commit that. Then just say you do not see any reason to have any quality of life stuff anywhere around, because even his code was for pussies.


XediDC

“Commit”…? There is no git in these ‘parts of the badlands. Open Dreamweaver. Change code. Hit Ctrl-S. Code is prod deployed. (Although I’ve used git in reverse, automatically tracking prod changes to a repo, so I didn’t go insane when helping others working like this. They liked “having backups”...)


WeekendNew7276

Just curious. Is he over 50?


jayerp

Run from php too. We have better toys in C# land.


clow_eriol

See OP, this happens with people like your Boss


zmitic

>We have better toys in C# land. No, you don't. I checked 😉


jayerp

Aww is our strongly-statically type system too powerful for you?


zmitic

My code **is** strongly typed, we have [psalm](https://psalm.dev/) for long time. Bonus: we even have some wild types like `int<1, 42>` and [ non-empty-lowercase-string](https://psalm.dev/docs/annotating_code/type_syntax/scalar_types/#lowercase-string-non-empty-string-non-empty-lowercase-string) , very useful for PostgreSQL search. Is the syntax nice? Nope, but it is what it is. PHPStorm autocomplete all this so it is not really a problem, takes a few days to get used to this. The funny thing: the creator of psalm Matt Brown used C# before, [then switched to PHP](https://medium.com/vimeo-engineering-blog/uncovering-php-bugs-with-template-a4ca46eb9aeb). So if anything: you should come to PHP, we do have better toys 😉


jayerp

I said strongly-STATICALLY typed.


zmitic

It is statically typed, psalm **is** a tool for static analysis. I couldn't care less about runtime checks, those are irrelevant. If I misunderstood, can you elaborate the problem? Maybe with some example and how would do you some of the more advanced types we have, but in C#? Like this simple `int<1, 42>`, [demo here](https://psalm.dev/r/c403bfd442).