Live data from Hacker News

Write Less Code

mikegrouchy.com

31–40 of 54 posts

Re: Write Less Code

#31
post #17
post #3

Code you never write never breaks. It has astonished me how much code people can crank out. It does not astonish me that they spend most of their time maintaining things they've written.

> Code you never write never breaks. ... but doesn't do anything either. :P

You are jumping to the assumption that the code you do write does anything at all.

Re: Write Less Code

#32

Any day that has a negative LOC count is a good day :) This usually means I found a good refactoring, or a good abstraction that removes a lot of stuff that is now boilerplate. If I can also add a feature with a negative net LOC count, it is a gold-star day :) That being said, sometimes just dumping a pile of code that passes tests, but is large (bloated), unwieldy and redundant is the right move. It give me somethin…

I’m with you. The most rewarding thing about diving into a large codebase is that you have many opportunities to refactor while you add features. At my current job I add only marginally more code than I delete. Feels good. :)

Sure -- as long as there are tests and some semblance of order. Trying to add new features to an untested ball of mud is just about the worst possible thing one can inflict on a poor programmer.

Re: Write Less Code

#33
I think this applies on every scale. Not just writing more elegant code but also just writing code in smaller units and having a prejudice against large methods/classes/components. I've noticed a lot of devs have a mental block about things like one-line methods or extracting a single conditional test into a method and other trchniques that really do help make your code clearer.

The more experienced I get the more I come to view big code as an anti-pattern / code smell.

Re: Write Less Code

#34
One of my favorite reads lately:

"The problem is largely philosophical: as software developers we're trained to think in terms of rigid systems of objects, design patterns and re-usable code. You might set out with the great idea to build a system of classes with clearly defined interfaces that inherit from one another when specialized behavior is needed. You might model all this in Lua using any number of class and inheritance patterns to try and enforce your vision. But, if you're perceptive, you'll soon start to suspect that all of the work you're doing to build an architecture really doesn't add much practical value. You may find yourself in the situation of having spent a lot of time defining a traditional OOP-style inheritance hierarchy and a big pile of fancy data structures only to realize you've created nothing more than an especially convoluted way of initializing tables.

Fortunately, there's an easy solution: don't do it. "

From : http://getmoai.com/wiki/index.php?title=Structuring_Your_Moa...

Re: Write Less Code

#35

I would go even further: to be a good developer you have to hate programming. If you like to fiddle too much, you'll waste time messing around and bikeshedding instead of taking your time to think about the problem at hand at a more fundamental level. Sometimes you solve a programming issue without writing even one line of code, but challenging the business requirements instead. It's important to be holistic.

People who hate programming don't program a lot. Programming is immensely about experience.

I have not seen a programmer who hated programming and wrote good code.

Re: Write Less Code

#36

I would go even further: to be a good developer you have to hate programming. If you like to fiddle too much, you'll waste time messing around and bikeshedding instead of taking your time to think about the problem at hand at a more fundamental level. Sometimes you solve a programming issue without writing even one line of code, but challenging the business requirements instead. It's important to be holistic.

To be a good developer you have to know what you're doing. That is, to know when it's a good idea to write more code, and to know when it's an even better idea to challenge the rationale for writing it in the first place.

I don't think the assertion that raw, passionate emotion (ie. hate) drives a good developer is an ideal, or a correct one.

Re: Write Less Code

#37
'Spend more time writing less code.'

I think that quote, or something like it, is from the 80's.

I've found this is the hardest thing for non tech business partners to understand, because most of the time, it appears as if you are doing nothing.

Re: Write Less Code

#38
If you find a way to avoid writing ASCII codes, or avoid it most of the time, then you aren't programming. And therefore, you are no longer a programmer.

Arranging, configuring and connecting components/widgets with GUIs is a very powerful way to solve all sorts of problems in many application domains. Unfortunately, the more powerful a system like that is, the less attractive it is for 'software developers' because it means they mostly aren't writing code, but rather are dragging around widgets.

I'm building a system like that anyway, for my own personal sanity. It is definitely a tool for advanced software developers to create, publish and configure widgets, not just for users or designers, although its also specifically for users and designers as well. I expect that most software developers will not appreciate it because it will make it too easy to build powerful applications without writing code.

The biggest thing holding back software engineering right now is source code.

The problem is that the definition of programming and software development is outdated. Programmers write colorful ASCII codes.

https://github.com/ithkuil/cureblog

https://vimeo.com/43784316

Re: Write Less Code

#39
there is no universal truth other than balance and careful judgement. Say "write less code" to the wrong person, and they will go off and create six months of meetings where they decide what they should decide what they should decide to decide to do. Analysis paralysis will creep in and kill you.
Post reply on HN