We are in an age of “refactoring.”
People are getting cult-like over this "clean code" mentality, it's like a fanaticism. The funny thing is, almost all the code I've seen is still spaghetti code, often interconnected within a larger system of more spaghetti-systems, with spaghetti-documentation scattered across the internet and various peoples in an organization.
We're sort of in an age of refactoring, aren't we? We've seen the demise of "messy" languages like PHP or Perl. Swift is a refactor of Objective C. Ruby and Coffeescript are more refactored languages. Plain old javascript just doesn't seem to cut it anymore either - we need framework upon framework, hierarchical trees, patterns, and everything's gotta be object-oriented for some reason.
But you know what...? Real life isn't organized, and just maybe, code doesn't always need to be either. My apartment's not hierarchy-based into neat little tree structures, but it's ok. I know where stuff is, and it's even convenient. My car's got a bunch of junk in it too, and I'm just fine with that.
When I code, especially for myself, sometimes I prefer no structure. Yep, I'll avoid OOP just because it takes me 10 minutes longer to type it all out and I think it makes things more complicated. I don't particularly care about private/public variables, I just make everything public - it saves me time typing the getters and setters. My variable names may be obscure, because I don't want to spend the extra time typing more descriptive names. Code might be messy and not the most efficient solution, but as long as it works, that's just fine with me.
Perhaps 20 years into the future, people will look back on this age of software and think "Why were we so obsessed over making everything OOP and so structured like that?"
Anyway, I think the true soul of programming lies in building stuff and launching. Users don't care how beautiful or elegant code is, that's something that employees/bosses/academics care about.
9 comments
[ 5.4 ms ] story [ 40.0 ms ] threadDo tell, please. Not sure if a troll or just really ignorant with the uses of OOP and "clean code". Original Poster probably also doesn't leave documentation in his code.
As for your main point, I would say have fun working with other human beings on a project, or working on a project that impacts more than just you. You apartment only impacts you and those directly associated with you. A successful programming project will affect far more.
Employees/bosses/academics comprise the majority of the adult populace who can take care of themselves, and maybe you should take a page from their book. And if you think users are the ones who "elegant" code is written for, you don't understand the point of writing good code.
Perhaps try working in a context where your application matters and uses the hardware it is working on to the fullest extent. Things like concurrency and performance are difficult with spaghetti code.
Maybe you've only worked on web projects, sites that don't run dynamically on a server, or are only accessed by a small number of people, so performance doesn't matter because you just pay a flat $5 for a single digital ocean droplet. But I'm being presumptuous. I don't know these things about you. So maybe share your own experience and how you think you have earned the right to call judgement on best practices developed over many years.
I'm imagining a blank, unamused stare from an ex-girlfriend while reading that.
Ofcourse code needs to work, and getting things done is important, speed of development is part of running a business.
But a program should also be readable & understandable, and maybe re-usable by a an other human being.
I don't think this implies you need to use OOP, but one of the nice characteristics is, that is has defined data and operations for a particular object.
Achieving a high development speed right now, without to much structuring and human readable & understandable logic in your code, won't do much harm right now.
Till someone asks you to change something in a working program.
Than re-reading and understanding to much unstructured code, at that time, kills development speed, which can block a much needed functionality.
And I personally think it is this building & launching of functionality that your users will care deeply about.
But, still I think there is a sweet spot, somewhere (between spaghetti and fully structured systems)
http://cdn-media-2.lifehack.org/wp-content/files/2013/05/THE...
Seriously, give functional programming a shot. It isn't as scary or esoteric as you might think.
Oh, you'll care about the quality of code a whole lot more when developing new features comes to a grinding halt.