Live data from Hacker News

The Code It Yourself Manifesto (2016)

pestilenz.org

21–30 of 57 posts

Re: The Code It Yourself Manifesto (2016)

#21
In business this is known as the build/buy dichotomy. Best practice is to focus on your core competencies. Meaning buy unless the available solutions do not fit your needs or are cost-prohibitive.

As always, it all boils down to cost. "Code it yourself" may make your programmers happy, and give them interesting work to do, but if it costs the business a big chunk of money they could have saved or put to more profitable efforts, it's a very bad idea.

Re: The Code It Yourself Manifesto (2016)

#23
post #15

I believe the first step when creating something new aught to be answering honestly for yourself why existing solutions won’t work for you. Your time is valuable and much better spent building something no one else has yet. I was once heavily afflicted by NIH, but with experience I realized how much time I was wasting stubbornly trying to reinvent the wheel. That’s actually a great analogy if you think about it—-the…

A good reason to implement things yourself is to learn. I recently implemented a PNG loader saver. All in all it took me 3-4 days to do.

I now have a complete grasp of the file format, and the code base. I will never need to find a library for it, or have a dependency, the code wont change without me knowing about it, and I can very accurately make decisions about when using PNG is the right format. I can speak about the format with authority.

All this have a lot of long time value.

Re: The Code It Yourself Manifesto (2016)

#24
post #12
post #4

It is generally good to depend on well-tested, large and reliable libraries. I have done the code-it-yourself thing to smaller libraries, though. The quality of the maintenance work done on smaller libraries is by no means guaranteed. They can acquire bugs at any point in time and when they do it may be best to just replace them by home written replacements.

A large complicated well maintained and widely used library is infinitely preferable to a large complicated library you need to maintain yourself and used only by you. In a similar vein, a well known standard format (or encoding) will always be a better choice than some ad-hoc format you create yourself because not only will that standard have encountered and dealt with problems you haven't even considered, but there…

> A large complicated well maintained and widely used library is infinitely preferable to a large complicated library you need to maintain yourself and used only by you.

Yes, but a large complicated well maintained and widely used library is not necessarily preferable to a small not so complicated library that does exactly what you need and nothing else. And that goes for formats too.

Recently I was involved in a project where order numbers had to be sent from one system to another. Some colleagues insisted that we baked them into a large xml document and then used libraries to both create the documents as well as parse them. In this case the economic thing to do was to write them each separated by EOL. Even the code we would have written ourselves would have been larger if we’d used the XML solution, not to talk about everything needed to include in builds and deploys.

Re: The Code It Yourself Manifesto (2016)

#25
post #15

I believe the first step when creating something new aught to be answering honestly for yourself why existing solutions won’t work for you. Your time is valuable and much better spent building something no one else has yet. I was once heavily afflicted by NIH, but with experience I realized how much time I was wasting stubbornly trying to reinvent the wheel. That’s actually a great analogy if you think about it—-the…

A good reason to implement things yourself is to learn. I recently implemented a PNG loader saver. All in all it took me 3-4 days to do. I now have a complete grasp of the file format, and the code base. I will never need to find a library for it, or have a dependency, the code wont change without me knowing about it, and I can very accurately make decisions about when using PNG is the right format. I can speak about…

I agree. Years ago over a Christmas break I hand ported the Chipmunk-2d physics engine to javascript because I wanted to understand how it worked. (And wanted to have a physics engine I could use for small games).

It only took me about 2 weeks and it was one of my most memorable experiences of the year. I learned a few great data structures, I learned about JS microoptimization (I got an 8x speed up from the first port to the final version of the code). And I learned all sorts of practical physics - moments of inertia, rotational momentum, restitution, solvers, etc.

It was a silly thing to do by most standards, but acts like that make me a much better engineer.

Re: The Code It Yourself Manifesto (2016)

#26
post #15

I believe the first step when creating something new aught to be answering honestly for yourself why existing solutions won’t work for you. Your time is valuable and much better spent building something no one else has yet. I was once heavily afflicted by NIH, but with experience I realized how much time I was wasting stubbornly trying to reinvent the wheel. That’s actually a great analogy if you think about it—-the…

A good reason to implement things yourself is to learn. I recently implemented a PNG loader saver. All in all it took me 3-4 days to do. I now have a complete grasp of the file format, and the code base. I will never need to find a library for it, or have a dependency, the code wont change without me knowing about it, and I can very accurately make decisions about when using PNG is the right format. I can speak about…

I guess it depends on the problem domains you work in because I've never once needed to speak on the PNG format with authority.

Similarly, finding authoritative comparisons of which image formats do what best is pretty easy.

I've also never run up against shortcomings of existing PNG solutions. Even in assembly for the Z80 I remember using a PNG converter that would handle greyscale on a calculator!

But 3 or 4 days of work! Mam I can think of a lot of things I could do with that.

If it was for the fun of the experience I'd totally get it, but spinning it as an "I needed to do this", I don't think I could go that far in the areas I've worked in

Re: The Code It Yourself Manifesto (2016)

#27
post #19
post #15

I believe the first step when creating something new aught to be answering honestly for yourself why existing solutions won’t work for you. Your time is valuable and much better spent building something no one else has yet. I was once heavily afflicted by NIH, but with experience I realized how much time I was wasting stubbornly trying to reinvent the wheel. That’s actually a great analogy if you think about it—-the…

I think you mean re-implement the wheel, people often misuse the term re-invent the wheel. You actually need to change things for it to be called an invention: http://move.rupy.se/file/wheel.jpg That said I always write everything from scratch, to me it's the meaning of life; If you are only using things you don't understand, you cannot (re-)invent anything. Today we also do not own anything, which makes the problem…

Feinman said something like that. IIRC, “I cannot understand it if I cannot create it.” I probably butchered it.

Re: The Code It Yourself Manifesto (2016)

#28
post #24
post #12

Earlier quoted context omitted.

A large complicated well maintained and widely used library is infinitely preferable to a large complicated library you need to maintain yourself and used only by you. In a similar vein, a well known standard format (or encoding) will always be a better choice than some ad-hoc format you create yourself because not only will that standard have encountered and dealt with problems you haven't even considered, but there…

> A large complicated well maintained and widely used library is infinitely preferable to a large complicated library you need to maintain yourself and used only by you. Yes, but a large complicated well maintained and widely used library is not necessarily preferable to a small not so complicated library that does exactly what you need and nothing else. And that goes for formats too. Recently I was involved in a pro…

There's an important difference between using something because it's popular, and using something because it's a standard designed for your problem. For something simple like just sending some numbers across the wire XML is massive overkill (as an aside, there's actually very little XML is a good solution to). CSV, TSV, JSON arrays, one of dozens of serialization formats, or even just a simple EOL separated value like you proposed are all both standardized and very simple solutions to the problem. On the other hand, had they proposed inventing some new binary serialization protocol and using that to transmit the numbers, that would be even worse than using XML.

You should always pick the simplest solution to the problem that meets all your requirements, but when considering solutions you should favor standards compliant solutions. A common example is date formats. Lots of places roll their own date format string when sending dates, but using ISO-8601 will save you (and your clients) so many headaches in the long run.

Honestly for your example, not knowing all the details I can't say for sure if a EOL separated value is a good solution, but based on just the description I probably would have gone with a CSV, or possibly a JSON array. I definitely would not have used XML (dear god, why would anyone pick XML in this day and age?), although if they were concerned about needing to add more data down the line I could maybe see an argument for something a bit more involved than a CSV.

Re: The Code It Yourself Manifesto (2016)

#29
However attractive the proposition may be, there is one, tiny fly in the ointment: time

Of which there isn't much to go round, and very much of which would go down the drain if one were to follow that philosophy to get things done.

Oh, and ... there's also all those pesky people who don't really know how to code.

Post reply on HN