Programming question
-
If you are writing an app that no one will see (other devs), do you still follow best practices i.e. creating classes, data access layers, blah, blah, blah? or, do you say f'it and write the app like a retard? i.e. putting all 5-8K lines of code in one form class and calling it a day. I am being asked by a senior dev to do something that I feel is fundamentally wrong as a programmer but he is the "senior" dev and thus must be obeyed.
Just along for the ride. "the meat from that butcher is just the dogs danglies, absolutely amazing cuts of beef." - DaveAuld (2011)
"No, that is just the earthly manifestation of the Great God Retardon." - Nagy Vilmos (2011)If he were a good senior dev, wouldn't he subscribe to the the lounge and see all this ramblings about him??
-
If you are writing an app that no one will see (other devs), do you still follow best practices i.e. creating classes, data access layers, blah, blah, blah? or, do you say f'it and write the app like a retard? i.e. putting all 5-8K lines of code in one form class and calling it a day. I am being asked by a senior dev to do something that I feel is fundamentally wrong as a programmer but he is the "senior" dev and thus must be obeyed.
Just along for the ride. "the meat from that butcher is just the dogs danglies, absolutely amazing cuts of beef." - DaveAuld (2011)
"No, that is just the earthly manifestation of the Great God Retardon." - Nagy Vilmos (2011)If the code is one time use, won't be checked in, nobody else will ever see it, and there's no chance you'll ever have to go back into it to make any changes, then yeah, toss all the good practices that don't help you get it done quickly. I've yet to find any work code that has ever met any of those qualities. Only code for my own personal projects sometimes meets all those criteria, and even then, sometimes I've been wrong.
We can program with only 1's, but if all you've got are zeros, you've got nothing.
-
If you are writing an app that no one will see (other devs), do you still follow best practices i.e. creating classes, data access layers, blah, blah, blah? or, do you say f'it and write the app like a retard? i.e. putting all 5-8K lines of code in one form class and calling it a day. I am being asked by a senior dev to do something that I feel is fundamentally wrong as a programmer but he is the "senior" dev and thus must be obeyed.
Just along for the ride. "the meat from that butcher is just the dogs danglies, absolutely amazing cuts of beef." - DaveAuld (2011)
"No, that is just the earthly manifestation of the Great God Retardon." - Nagy Vilmos (2011) -
If you are writing an app that no one will see (other devs), do you still follow best practices i.e. creating classes, data access layers, blah, blah, blah? or, do you say f'it and write the app like a retard? i.e. putting all 5-8K lines of code in one form class and calling it a day. I am being asked by a senior dev to do something that I feel is fundamentally wrong as a programmer but he is the "senior" dev and thus must be obeyed.
Just along for the ride. "the meat from that butcher is just the dogs danglies, absolutely amazing cuts of beef." - DaveAuld (2011)
"No, that is just the earthly manifestation of the Great God Retardon." - Nagy Vilmos (2011) -
For God's sake, do it right! I have seen too many /quick jobs/ that evolved from helping one person to becoming used company wide. Where the code is shyte, the extensibility is greatly reduced and at some point the whole shedangs need to be redone. [edit] Looks like I can not spell today.
Panic, Chaos, Destruction. My work here is done. Drink. Get drunk. Fall over - P O'H OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett
Nagy Vilmos wrote:
For God's sake, do it right!
I have seen too many /quick jobs/ that evolved from helping one person to becoming used company wide. Where the code is shyte, the extensibility is greatly reduced and at some point the whole shedangs need to be redone.So true! I watched something that we started to call the "revolving iterative prototype" slip into production under the radar and then suddenly the business unit using it (yep, real users, not tech savvy IT types who might be understanding if something was a little shaky). The users wanted to start adding features, requesting bug fixes and after a year or so made a formal request to expand it to a suite of applications. :omg: When I left the company some 7 years later some parts of the expanded suite were still in use. I was the last developer in the company who was there when it was born and, luckily, managed to put a good bit of distance between myself and the suite in that time.
Mike Devenney
-
If you are writing an app that no one will see (other devs), do you still follow best practices i.e. creating classes, data access layers, blah, blah, blah? or, do you say f'it and write the app like a retard? i.e. putting all 5-8K lines of code in one form class and calling it a day. I am being asked by a senior dev to do something that I feel is fundamentally wrong as a programmer but he is the "senior" dev and thus must be obeyed.
Just along for the ride. "the meat from that butcher is just the dogs danglies, absolutely amazing cuts of beef." - DaveAuld (2011)
"No, that is just the earthly manifestation of the Great God Retardon." - Nagy Vilmos (2011)By the tone of the question, I'm assuming that the senior dev has asked you to throw together something quick and dirty to get a specific job done. Under the right conditions, that may be ok. If it is a run-once tool to correct/convert something in persistant storage (example - you have been storing some text data, say xml, in a VARCHAR(MAX) column of a table in the database and need to start compressing the data and storing the compressed byte array in a new IMAGE column to save drive space. Converting the existing entries would be a good job for a one-off run-once tool). It's ok to write something like this without adhearing to all of the "best practices" as long as it runs once and gets the job done correctly. Data import from a legacy application to a new one is another example. However, if it is something that is to be a part of the system, even for a short while, you are right to want to make it as stable and maintainable as is allowed under whatever time constraints you have. That being said, I don't know the office politics climate where you work. If your senior developer is a real tyrant and has the ear of management, there is no need to argue or stress over it, just do it and move on. If he is open to ideas and suggestions, voice your concerns, and once you have, follow whatever decision he comes up with. The reality is that, in the end, you are there to do a job. I recognize and applaud your passion for doing it right, but until you are the one in the position to make those decisions, I'm afraid you're going to be stuck doing as you're told (sometimes called "paying your dues"). As distasteful as it may sometimes seem, you don't need to let that passion die, but you may need to occasionally rein it in a bit, and get the job done.
Kevin Rucker, Application Programmer QSS Group, Inc. United States Coast Guard OSC Kevin.D.Rucker@uscg.mil "Programming is an art form that fights back." -- Chad Hower
-
For God's sake, do it right! I have seen too many /quick jobs/ that evolved from helping one person to becoming used company wide. Where the code is shyte, the extensibility is greatly reduced and at some point the whole shedangs need to be redone. [edit] Looks like I can not spell today.
Panic, Chaos, Destruction. My work here is done. Drink. Get drunk. Fall over - P O'H OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett
If you've never had to maintain code, you'll never know the problem when people don't do things properly. I maintain legacy coding and I have to look at everything - even stuff that people think nobody looks at. Code is read more often than it is written so anything that helps the reader understand the code is important. You never know, the person reading your code may be your future employee or employer. They know what your coding is like. Would they trust what you say when they know how you code? They may think Good analyst but can't code to save his life!.
-
Had a guy who loved classes so much everything was a class. We canned his code when he was asked to make a change and he could not decipher his "classes". Every variable had a class! By the way there were no comments.
-
If you've never had to maintain code, you'll never know the problem when people don't do things properly. I maintain legacy coding and I have to look at everything - even stuff that people think nobody looks at. Code is read more often than it is written so anything that helps the reader understand the code is important. You never know, the person reading your code may be your future employee or employer. They know what your coding is like. Would they trust what you say when they know how you code? They may think Good analyst but can't code to save his life!.
Member 4608898 wrote:
You never know, the person reading your code may be you!r future employee or employer.
FTFY
-
For God's sake, do it right! I have seen too many /quick jobs/ that evolved from helping one person to becoming used company wide. Where the code is shyte, the extensibility is greatly reduced and at some point the whole shedangs need to be redone. [edit] Looks like I can not spell today.
Panic, Chaos, Destruction. My work here is done. Drink. Get drunk. Fall over - P O'H OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett
Agreed
-
If you are writing an app that no one will see (other devs), do you still follow best practices i.e. creating classes, data access layers, blah, blah, blah? or, do you say f'it and write the app like a retard? i.e. putting all 5-8K lines of code in one form class and calling it a day. I am being asked by a senior dev to do something that I feel is fundamentally wrong as a programmer but he is the "senior" dev and thus must be obeyed.
Just along for the ride. "the meat from that butcher is just the dogs danglies, absolutely amazing cuts of beef." - DaveAuld (2011)
"No, that is just the earthly manifestation of the Great God Retardon." - Nagy Vilmos (2011)Even in my most complex and hacky code I still use clear flow descriptions. an example in c#:
public class CustomerDataService
{
public Report GetReports()
{
var IDs = LoadCustomerIDsForProcessing();var Data = LoadRelatedDataForCustomers(IDs); return = RunReport(ProcessCustomers(IDs,Data));
}
//... Other methods and junk
//
//also humor is always good to leave behind in code.
//especially if you've had a few drinks.
}So then all my functionality at least can be explained to the developer that is trying to figure it out. I do make it a point to use implicit variables as It doesn't matter here. All that matters is what we are getting and what "black box" of code it's coming from.