>Be me
>Just graduated college (European, so no ridiculous debt)
>First programming job at a company that offers software as a service.
>Only other developers are web designers that have no programming experience before
>Their inexperience shows in the code base:
> - It’s in PHP
> - Files can get thousands of lines long, no exaggerating
> - - One of our api’s was just 1 file when I started
> - The HTML of a form and the logic to handle the HTTP POST are in the same file
> - The page files are I one folder, loaded with a include ‘/pages/’ . $_GET[‘page’]
> - - The index.php file outputs the html tag before it knows what page to load
> - - - This counts for POST data to, it outputs half the page, then includes the file, the file redirects with a meta tag, so the browser has to start loading the page again
> - No error pages, an empty page if it passes trough index.php, otherwise the standard 404 page of the server
> - Security issues
> - - They just started escaping input for SQL queries before I stated, because they got hacked, to this day I find scripts where that’s not the case yet
> - - I could log in on one of there websites with classic SQL injection
> - - The user id was passed as an argument in some ajax files, instead of using the server side session
> - - I could get around two factor authentication on one of there sites by using the back button in the browser, because the session was already set before the second factor
> - - Just a general lack of input validation
(1/2)
I need advice, if not, horror tread I guess
Other urls found in this thread:
> - No good practices
> - - Variables with shitty names like $searchquery when just getting data from the db, and when data from an other table was needed that variable would get the name $searquery2, yes the data itself has query in the name
> - - No OOP
> - - Some file called functions.php for everything that isn’t inline
> - - No framework used
> - - No directory structure
> - - SQL queries just inline
> - - Even thing like HTML for automated emails just inline
> - - Copy paste instead of creating a funcion or class
> - - - For example said inline email text would have the boilerplate like the head tag and the css in it for every single possible mail, so like 5 times in one file
> - - - Some functions copied and pasted, with like one line changed in the copy, instead of just an if statement
> - - - Indentation sometimes seemingly random, and that’s not even talking about some lines using spaces and others using tabs
> - - - Almost all of the js that’s not 3rd party is inline
> - - - Css is 3 different frameworks
> - - - I learned that the w3c HTML validator can crash
> - Sometimes in functions, instead of using the global keyword, it would open a new db connection
>Some actually shady shit, like using code we don’t have a license for
>Errors? Just turn error reporting off.
>Didn’t start using version control until I was working there. It was just ftp to the server
> - Because of this the code is full of leftovers from failed experiments
>Boss doesn’t realize the code is a disaster because it somehow works
>Colleague just tells me to not care, even though it makes my job way harder than it should be
>I get asked to add new functionality to this trash fire, because of the lack of structure, everything is just hacked in and makes things only worse.
Should I quit? They aren’t bad people.
Does anyone else have experience with a code base created by people who can’t code?
Ask them if you can rewrite everything, not just refactor. If they don't agree, quit.
If you want to be a big fish in a small pond, then maybe you want to stay. Or maybe the money is so good that you can hold your nose at the quality of the code emanating from the behinds of your coworkers. Or do you feel like you could be a teacher to a generation of people who obviously have built something that runs but is horribly horribly broken? Or are you in a part of the country where there are a few programming jobs and this is the best that you can find? There are reasons for staying.
My boss has been saying for months that rewrites are coming, but there's always more work. I also don't have the experience to just write such a big and complicated project, it's not just a standard crud project..
I'm still at a starting wage, like I said, this is my first real programming job after finishing college.
It's not that I live in the middle of nowhere, but all the programming jobs seems to be located in the big cities here, and all the companies close by seem to have their IT outsourced. When i was looking for a job there wasn't really something close by, maybe I should look again.
Most of what you list are complete nonissues. Why waste thousands of hours when you can get something that works right now and is trivial to modify and upgrade, for the putative advantage of newcomers needing days, not hours, to get used to the codebase? The fact is you should forget everything you've learned in college, it's not good practice and is in fact rather fucking awful and counter-productive.
Not saying your coworker is a programming genius or anything, but clearly neither are you.
The big secret is that bosses hate paying for technical debt. Technical debt is not sexy. New features are sexy. So for the people in charge of your budget, they want new stuff. What the website already does is assumed to work forever, perfectly.
Watch and learn: youtube.com
It's the ideal talk for your problem
It's not trivial to modify and upgrade, that's the problem. The files are almost unreadable with shitty indentation an variable names, functionality is sometimes duplicated so fixing a problem in one place means it still doesn't work in another, changing a variable might break another file because everything is global. I also sometimes have to spend the most time on the front end on which is missing a tag. It's a nightmare to maintain.
Also wat seems to work of often buggy, so we spend a lot of time on fixing bugs.
That seems very possible, me and even my coworker know its shit, but my boss just doesn't seem to care. Even though the website hangs sometimes because it's all running on one database, so we are getting scaling problems. It might actually break in the near future.
I'll watch that, I'll tell you if it was useful for me
>shitty indentation an variable names
>functionality is sometimes duplicated
>everything is global
These are examples of real problems. You should have listed more or less just these in your OP.
>wat seems to work of often buggy, so we spend a lot of time on fixing bugs.
Depending on the scope of the software this might be a nonissue (e.g. if it's throwaway code you'll use to get one result out and then dump within 3 months). Otherwise you should be teaching that guy how to write unit tests.
Eitherway, know that you're in a pretty good situation. You're uniquely placed to be able to make major impacts on the business. The trick is you need to learn the correct way to report the work you've done. Understand that your boss doesn't care about the codebase, but rather wants to see improvement in features. Meanwhile your coworkers do enjoy seeing a better codebase and better development habits. However, be careful in the way you approach them and present your help or they might take it as you being holier-than-thou and talking down to them "even though you're their junior". This can lead to petty politics and ruin you pretty hard.
If you play your cards right though, you're headed for basically free promotion and significant improvements in salaries. Most people in their first job aren't that lucky: they are unable to write anything because they have to navigate politics and redtape for a long time, with managers taking credit for their work and putting the blame on them for the manager's failings behind their backs.
At least you got a programming job. I know of a graduate who was trolled into a company and got a job where all he was allowed to do was watching a screen and sending an email if it showed an error message. He would have been doing this for at least one year if he wouldn't have left.
haha this if pretty much a job I'm interviewing to get after several months of searching
please kill me
>Files can get thousands of lines long, no exaggerating
about 3k is ok
>One of our api’s was just 1 file when I started
I would not need more actually
>The HTML of a form and the logic to handle the HTTP POST are in the same file
>The index.php file outputs the html tag before it knows what page to load
>This counts for POST data to, it outputs half the page, then includes the file, the file redirects with a meta tag, so the browser has to start loading the page again
>No error pages, an empty page if it passes trough index.php, otherwise the standard 404 page of the server
If they would use output buffering and redirect before any output happens this would be ok for me.
>Variables with shitty names like $searchquery when just getting data from the db, and when data from an other table was needed that variable would get the name $searquery2, yes the data itself has query in the name
>No OOP
>Some file called functions.php for everything that isn’t inline
all acceptable to me
>No framework used
good, not needed.
>Css is 3 different frameworks
stupid if they use no framework for the rest
>Errors? Just turn error reporting off.
Fine too in production
The rest sounds pretty horrible, but these would be fine for me.
It's called Service as a Software Substitute, or SaaSS.
This should be easy af to refactor. I have to deal with thousands of stored procedures and that is fucking hell.
spend 30min a day creating a map of the program. Then when u have an architecture u like, present it to ur peers, review, present to manager. tell him it will take x hours.
Management like proactive people, if the project goes well ask for a raise or at least a better title.
its good practice in any case.
t. Pajeet
go cry in a corner while I am going to make 6figures you newb.
>PHP
>6 figures
guy sounds like an asshole, not listening to him
>Depending on the scope of the software this might be a nonissue (e.g. if it's throwaway code you'll use to get one result out and then dump within 3 months).
It's a project that has been there for years and will be there until the company goes bankrupt.
>Otherwise you should be teaching that guy how to write unit tests.
The code doesn't have units to test. It's all one long script.
>If you play your cards right though, you're headed for basically free promotion and significant improvements in salaries.
It's a very small company, single digit employees small, and most of these people aren't doing development. My coworker already jokingly called me "head of development", because they know I have the most knowledge of PHP.
Me and my coworker have tried to tell the boss the code is shit multiple times, and its at the point no the boss says we will rewrite it at a time when there is less work, which has been delayed multiple times now.
Also most of our tasks are "a customer paid for this change, it has to be done this week", so I don't think I can get promoted to something with more decision making.
Is this bait?
>Then when u have an architecture u like
Why do you assume we have those.
I should probably have mentioned I work at a very small company
>software as a service
>They aren’t bad people.
You should fucking kill yourself and take the company with you.
>No framework used
Based
Wait, misread architecture as architect.
>tell him it will take x hours.
I have no idea how long it will take.
Also I can't just start a big project. Again small company, orders for custom functionality already paid for before asking dev anything
Seems like a good talk, I will show this to my coworkers.
>Be intern in a small company of 4 people
>Good people and my boss is pretty chill
>I am the only one with programming experience fresh out of college
>Everyone else are System admins, Microsoft server or they install servers or wifi at schools, comapnies etc.
>Boss has this idea to make this IOT device to regulate heat, to say it simple
>Only toyed around with some Arduino and Raspberry pie
>Have to work with this Velleman K8055N prototype interface and somehow make it work with Spring boot in Java and you can semi-control the device through a React website
>Sweating furiously, oh god
>Pull out every trick i know about Java's JNI and backend Spring boot
>Manage to do it in a week
>
Have to go back next month and make the motors work but until now everything is going great even though.
Even though i made a exact copy of this project with the same capabilities in Arduino made totally in C and then interfaced through USB with Java's JNI with a C++ DLL with COBS.
And spring boot with a modified EnumMap Event manager i learned somewhere.
But i have no idea if this "professional"
I really hope i can complete this successfully cause i'm the only one that knows "something".
Bring up the situation with the boss and tell him how to improve things, fix all that junk, declare yourself senior developer and leave that place for better money or a consultancy gig.
>t. doesn’t know what technical debt is
These issues while seemingly benign will 100% ruin OP’s company later down the line if they’re not properly addressed.
This. Everyone who thinks otherwise never worked on anything of scale.
>Also I can't just start a big project. Again small company, orders for custom functionality already paid for before asking dev anything
Literally gitflow.
Just hack in the code in the dumpsterfire, while also implementing it nicely in your new project
You yourself seem to have very tenuous understanding of principles in software engineering. Unit testing has no concept of units as files, only as functionality. If you have a custom framework that generates CSS from some artifact, throwing edge-case artifacts (including malformed) at it and checking the output is correct is a unit test.
Part of developing proper unit testing involves selecting what part of the program needs to be tested and therefore how to break it down. That's the main idea behind TDD as a software design methodology (protip: don't do TDD).
>It's a very small company, single digit employees small, and most of these people aren't doing development.
That's exactly why you are in this unique position where you can easily advance. In normal scenarios advancements don't happen, you have to leave every 2 years and apply to increasing positions at best.
>My coworker already jokingly called me "head of development", because they know I have the most knowledge of PHP.
That's a good thing, it means that when management is ready to have a managerial role, so long as they're aware you'd like that position, they will put in words for you. Exactly what I mentioned before: you are in a position to get promoted 'for free'.
>Also most of our tasks are "a customer paid for this change, it has to be done this week"
That's every programming job ever. Don't know what you expected.
> the boss says we will rewrite it at a time when there is less work
Ignore this. Do the work in parallel as the feature implementation.
See
It depends if this is the company's product or throwaway garbage they're building for a client. It's most likely the latter. In that case it has 0 impact. If it were the company's main product, 90% of the issues OP lists are complete non-issues (as in they're better than what OP suggests doing instead) and/or irrelevant at the current point in the company's life (i.e. trivial to change at any time and completely useless currently, a pure waste of time that would make development much slower for the next several years).
The core issues (that OP minimized, hilariously enough) definitely should be addressed yesterday, but OP's first posts aren't that.
what country?
>PHP
I would have walked right out the door the first day on the job the instant I saw a single PHP file
Post a link to their site.
>>company that offers software as a service.
Fucking disgusting. Don't you have some free software project to work on?
By the way, it's not "software as a service". It's "service as a software substitute".
it will never get rewritten and will be burried along with the company.
t. worked at a shitty shop
some people have to pay for their own food and shelter
Just get another job then. No excuse for making the world a worse place.
For example, RMS once made money by selling GNU Emacs tapes.
weak bait
That's how corporate shitware normally is. Get used to it if you want to work in the industry. Only free software is actually good.
This is not bait. I don't want OP to contribute to a growing injustice in the technology industry (propietary software).
Is robbing grannies also good because you have to feed yourself? What about murder?
Corporate commercial free software also exists, those concepts aren't mutually exclusive.
Guilty of at least half of that shit. In my defense, profits are slim and growing slimmer by the day, so management doesn't care able things like reusability or best practices, they just want changes shat out as quickly as possible.