Live data from Hacker News

Too scared to write a line of code

medium.com

101–110 of 130 posts

Re: Too scared to write a line of code

#101
post #29

I'm by no means a pure functional programmer, but I've found some of the mantra from that paradigm helps when building the early blocks of a program as it allows you to break down your application into core problems which can be tackled individually. Plus it allows your application to scale easier and makes it easier to rip out and replace code as you start to add complexity. But of course, before starting any major…

Be careful going overboard with pure functional programming. It could become one of the immobilizing factors the blog was talking about. Is the code pure FP? Can I get rid of the states? Am I doing correct FP? Should I write generic function for more abstraction? Am I doing DRY enough?

Re: Too scared to write a line of code

#102
I can relate to this, somewhat. I've spent quite a bit of the last few years writing code either under deadline, or for work that's ultimately charged hourly. That doesn't lend itself to thoughtful refactoring.

As such, when I'm not under those constraints, I sometimes go a little overboard factoring out duplicated code and looking for the beautiful solution. To me, beauty is the maximization of clarity and conciseness. Since I'm usually writing Perl, there's quite a lot to work with in that regard.

For example, yesterday I spent 4-6 hours writing approximately 40 lines of Perl (along with another 40 lines of tests).

On the plus side, what I generate during these binges is generally an efficiency multiplier for the other code I write, as well as a god way to really examine some of the more esoteric, but useful, ways to use your chosen language.

Re: Too scared to write a line of code

#103

The Bad Guys want you to feel insecure about your work, your position, your relative standing, and everything else because their worst nightmare is that software engineers and scientists and thinkers wake up and realize how much leverage they would actually have if they were organized and capable of looking out for their own interests. We'd reshape the entire business landscape, and the power relationships between us…

Wow. When are you going to post a comment that isn't about Our Malicious Overlords?

The people who promote careful programming methodologies aren't trying to make people miserable. In fact I'd lay half the blame with the OP, who needs to rein in a tendency to overthink things. We don't need a villain here.

Re: Too scared to write a line of code

#104
The problem with this approach, while great for you, the developer it is a nightmare for the future team.

I am now working at a startup where the early devs have left. They did precisely what was needed at that point - build quickly, ensure it works for the 3/4 customers we had back then and document it as well. Fast forward a year later, that same code is no longer extensible for many clients. Its rigid and tightly coupled and rewriting some parts means, we have to pretty much rewrite a whole lot more than we bargained for. We will have to burn through a lot of cash to just build a whole new product based on some of the scalability and maintenance learning we now have from a year of learning and growing to client# 100.

The point is, there is always going to be "this is the right thing right now, its what our customers want" and then something else for the future.

I have seen that people who have worked for a while and in many startups do the smart thing (as expected) and while follow "build for now" they also do the sensible thing of investing for the future (from experience).

Re: Too scared to write a line of code

#105

Earlier quoted context omitted.

If you write code too slowly, go faster. If you write code too quickly, go slower. You can tell if you're too slow when you've spent two weeks thinking about the program and have neither working code nor a detailed design, or if you've created a detailed design only to realize upon implementation you'd gone about it entirely the wrong way. You can tell if you're too fast if you find yourself spending more time cleani…

This is like in go. If your walls are too brittle, play more conservatively. If your walls are too thick, loosen up. You can make generally better moves in go just by recognizing if you are too conservative or too aggressive. Same with poker.

Upvoted to make up for MBlume's mistake. :)

Re: Too scared to write a line of code

#107
I've missed coding with whimsy and curiosity. There was a time in my life when it wasn't all engineering. Characters from the Lord of the Rings trilogy made their way into tutorials and references to the Flying Circus were everywhere. Communities were a lot more accepting of newcomers and few people were so paranoid of bad, unmaintainable, spaghetti code. There was less of a focus on being a 10x developer and more on learning, having fun, and doing neat things.

I'm probably remembering things with rose-tinted glasses.

These days, even in open source -- the once proud land of eccentric hackers and the can-do spirit, there is such a negative focus on bad developers. I can certainly see how the OP could feel paralyzed when just trying to write a line of code.

In reality we're all at different points in our journey and have had different experiences along the way. There's always room to improve ourselves and it's important to listen to criticism so that we know where to start. But sometimes you just need to cut loose and let it all hang out. I started writing a library I call "Horton," for this very purpose: whimsy, pleasure, and most of all to avoid the engineer mindset!

In order gain insights and develop new ideas you have to find new hunches and investigate them. It's hard to develop hunches in a vacuum where your reality doesn't expand beyond your own self-made bubble. You've got to push once in a while... and people out there who complain so loudly about shitty developers? Get a life and help someone out. We're just making programs.

update: https://github.com/agentultra/Horton forgot the link...

Re: Too scared to write a line of code

#108
post #46

I don't know--my impression is that most people go to far in the other direction. They write code with no thought at all for the future, and then shortly have nightmarish debugging sessions in spaghetti code that's impossible to extend or reuse. All in the name of a rather extreme "worse is better" philosophy. I've certainly experienced this with some of the people I worked with recently. Anything you win in the shor…

> Improve your code by making it do less not more.

Exactly. The problem is that code can tend to be either crap (spaghetti) or too much code (too many methods and layers of extraction). So, I'd go one step further: code should do less, not more, and should be clear and understandable, without making unnecessary sacrifices. What is clear to me isn't clear to everyone else, but striving for clarity and simplicity isn't a bad thing.

Re: Too scared to write a line of code

#109
post #94
post #87

Earlier quoted context omitted.

How long have you been programming, and how many jobs have you had writing code in an actual business? Your profile says you're a student, so I'm curious how you can feel justified in writing such a thesis. Personally, after 16 years in the industry, I do stress about my code as described in the article... Not about making it work, because that will happen regardless, but about how. It affects my ability to code, bec…

His CV on his website http://jelv.is/resume.pdf . Seems he's fairly experienced. Anyway such things are highly subjective, and YMMV

wow, SO experience is now something one puts on top of the Achievements section! (I don't say it in a bad way, I'm just surprised things have evolved to such a point)

Re: Too scared to write a line of code

#110
post #46

I don't know--my impression is that most people go to far in the other direction. They write code with no thought at all for the future, and then shortly have nightmarish debugging sessions in spaghetti code that's impossible to extend or reuse. All in the name of a rather extreme "worse is better" philosophy. I've certainly experienced this with some of the people I worked with recently. Anything you win in the shor…

> Improve your code by making it do less not more. Exactly. The problem is that code can tend to be either crap (spaghetti) or too much code (too many methods and layers of extraction). So, I'd go one step further: code should do less, not more, and should be clear and understandable, without making unnecessary sacrifices. What is clear to me isn't clear to everyone else, but striving for clarity and simplicity isn't…

> too many methods and layers of extraction

Surely, you mean abstraction?

Post reply on HN