Live data from Hacker News

Ask HN: How’d you go from a noodler to writing large well structured programs?

news.ycombinator.com

71–77 of 77 posts

Re: Ask HN: How’d you go from a noodler to writing large well structured programs?

#71
post #52
post #24

I will reiterate some of what others have said: - Use version control! - Hire a professional software developer - Good architecture and abstraction comes mostly from practice but if you really want to do some reading on software architecture check out "The Architecture of Open Source Applications" (vol 1 & vol 2) http://www.aosabook.org/en/intro1.html

Version control will be on the list starting next year. Thanks! I'll also take a look at the link. Unfortunately it isn't in our budget to hire a pro dev to the team but I can work attempt to increase time working with our corporate IT department which has some excellent devs.

If all the resources for this project are in one folder as you described, what keeps you from waiting until the new year to start using version control? It seems you could do something like:

$ git init $ git add . $ git commit -am "Initial messy commit."

You could start using a more refined approach from there, and that would be a start.

When I start working with someone else's code for the first time, I run these commands and immediately have a baseline to work from. Once you run these commands, you can start experimenting with your code, and you can start guarding against someone else's accidental bugs in the project.

This does assume some basic understanding of how version control works, but it seems you could learn the basics of git in an afternoon and start using it to provide a baseline.

Are you currently doing the "make a copy of the project folder and call it project_backup_110217" approach to version control?

Re: Ask HN: How’d you go from a noodler to writing large well structured programs?

#72

I suggest you hire a software developer, preferably a senior one if you can afford it. The difference between a bunch of impressive algorithms written by specialists in the field stitched together by brittle connections, and a bunch of impressive algorithms that are part of a well structured, tested and maintainable suite is huge. Reading a book or two is not going to solve the problem in the long term, which I assum…

This is a great point. Having someone on your team who can act as a mentor to others is really, really important. Reading well-written code from their work/check-ins will help everyone improve over time.

I still think there are programmers more akin to artists who have a knack for solving complex problems elegantly. BUT there is a lot of craft in coding that can be learned. Even if you're not a greater programmer but you write clear, maintainable code you/someone else can improve it overt time.

Re: Ask HN: How’d you go from a noodler to writing large well structured programs?

#73
post #53
post #38

MatLab is a disaster for this. Great software, but a horrible, horrible coding environment. I came from a CS background and did a EE masters. Working in Matlab made me want to cry because of the problems you're describing; I think they're endemic to Matlab rather than anything you're doing wrong. Source control will help, just look at some of the git tutorials. Go through them enough to where you can create a "releas…

Interesting to know others have had similar experiences in Matlab. I'm hoping to find the time to recode the whole thing in python in the new year as well as implement source control. Thanks for sharing your experience.

Before you launch into a "recode the whole thing" project, read this:

https://www.joelonsoftware.com/2000/04/06/things-you-should-...

Having your code base in python would be great, but do consider doing it piece by piece. Try to see if there's a part that would benefit greatly from the better organization features of python, and start there.

Re: Ask HN: How’d you go from a noodler to writing large well structured programs?

#74
post #38

MatLab is a disaster for this. Great software, but a horrible, horrible coding environment. I came from a CS background and did a EE masters. Working in Matlab made me want to cry because of the problems you're describing; I think they're endemic to Matlab rather than anything you're doing wrong. Source control will help, just look at some of the git tutorials. Go through them enough to where you can create a "releas…

> separate files instead of one massive one, yay!

Matlab doesn't give you a choice here... every single function has to go in its own file.

I'm also not a huge fan of matlab.

Re: Ask HN: How’d you go from a noodler to writing large well structured programs?

#75
post #67
post #64

Earlier quoted context omitted.

>Version control will be on the list starting next year. The fact that you make quant software trading millions of dollar without version control surprises me. Is the quant industry really like that?

It is in commodities. Not at banks. In commodities it is the wild west.

What kinds of interesting analytical things are you doing in commodities?

Re: Ask HN: How’d you go from a noodler to writing large well structured programs?

#76
post #46
post #44

Start using Git right away. The time dimension of code is the most useful to organize. Then learn and use some object oriented programming. Don't go too deep- just enough. Then organize your code into files and folders based on the class relationships that start emerging. It's really that easy. One more thing: don't read any books about structuring code or go by any blog posts. They will only teach you someone's opin…

>It's really that easy It's really not. Neither git, OOP, nor nice folder structures are a panacea (nothing is, of course). I've seen beautiful C in Source Safe and I've seen awful, overly engineered class happy crap in git repos. Writing good, non-trivial systems requires experience and skills in many areas. No design pattern or source control system will save you from yourself if you're just not at that level yet.

I'm not sure mystifying good code design is the right approach to take here. I wanted to emphasize that it's something attainable to anyone, and therefore, worth the effort.

I'm of the belief that most sloppy or "noodly" code is usually written that way not because the person is unable to produce good code, but because they just aren't trying. There are a lot of reasons why people don't try, and feeling intimidated by other devs is actually a pretty common one.

Re: Ask HN: How’d you go from a noodler to writing large well structured programs?

#77
post #76
post #46

Earlier quoted context omitted.

>It's really that easy It's really not. Neither git, OOP, nor nice folder structures are a panacea (nothing is, of course). I've seen beautiful C in Source Safe and I've seen awful, overly engineered class happy crap in git repos. Writing good, non-trivial systems requires experience and skills in many areas. No design pattern or source control system will save you from yourself if you're just not at that level yet.

I'm not sure mystifying good code design is the right approach to take here. I wanted to emphasize that it's something attainable to anyone, and therefore, worth the effort. I'm of the belief that most sloppy or "noodly" code is usually written that way not because the person is unable to produce good code, but because they just aren't trying. There are a lot of reasons why people don't try, and feeling intimidated b…

I didn't intend to 'mystify' design patterns, but how useful are they really without experience? Take polymorphism for example. Personally, I didn't have my 'ah ha' moment there until I was faced with a problem which really benefited from it (early career and designing a device which had many supported hardware configurations.) It seems obvious now, but it took experience (i.e. making mistakes) to get here.

Maybe I'm just a slow learner, but I don't believe being shown a bunch of class Animal {}; class Dog : Animal {} examples really bring the point home. It's a combination of knowing what tools you have available to you and having the experience to know when and how to best use them.

In other words, gifting me a high end set of tools will not turn me into a great craftsman overnight. I think the "they're just not trying" argument is going to be hit or miss. Definitely true for some, not true for others. If you're 10+ years into your career and still writing unmaintainable spaghetti... then yeah, you're probably right.

Post reply on HN