We are in an age of “refactoring.”

5 points by caviarncheese ↗ HN
Just a rant, but frankly, I'm tired of all this BS over frameworks, OOP, TDD, design patterns, factory classes, singletons, inheritance, structured data, and generally anything related to "clean code done the right way."

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 ] thread
Try to review your code in a year. Have fun.
Do you tell this to people in an interview? [sarcasm] I bet they'd hire you on the spot if they heard/read this [/sarcasm]

Do 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.

ok, but if you share your apartment, you'd want it to be clean for the sake of your roommates right? if you use your car to pick up a date, you'd want it to be clean and presentable so she'd have a place to sit... it's the same idea with code.
First of all: I'm not much of a ruby programmer, but how is it a refactored language? It goes pretty far from standard Algol syntax. I have read the syntax was heavily influenced by the differing SOV/SVO structure in english and japanese, but this may be hyperbole.

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.

"My apartment's not hierarchy-based into neat little tree structures, but it's ok."

I'm imagining a blank, unamused stare from an ex-girlfriend while reading that.

Computers generally don't really mind how you have defined your variable names, structured your data, and named your functions in your program, it all gets translated into a memory adres and machine code.

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...

I think it's time for you to get out of Javaland and try a functional language. Maybe give Clojure a shot if you want to stick with a JVM language. I think you'll find that the frameworks and patterns aren't even necessary.
This. I wouldn't even just call it Javaland though, the Ruby world is like this now too. My favorite part about my journey into functional programming so far has been that I don't need to stay up to date on whatever the talking heads of OOP are preaching these days.

Seriously, give functional programming a shot. It isn't as scary or esoteric as you might think.

> 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.

Oh, you'll care about the quality of code a whole lot more when developing new features comes to a grinding halt.