Hacker News new | ask | show | jobs
by blakeyrat 3474 days ago
I think we need to first get over the hurdle of "code == text".

I mean, the features you talk about are great-- but right now I can't even embed a little vector graphic explaining a function's flow in my source file. Every time I've suggested using a file format that allows things like fonts, styles, embedded images, to write my code, the reaction is always an insanely irrational knee-jerk against it. (Seriously, try it out with your programmer colleagues.)

(And to prod the bear a bit, a large part of the problem is the developers who insist in working in tools like the ones we're discussing here, designed in the '70s and using absolutely no technology that was invented after 1985 or so. Ludicrous. Imagine if any other industry worked that way!)

Then a couple days later, you found out they spent like an hour making ASCII art of some diagram because they couldn't just paste the actual diagram into the code. Sigh. Reason #3136269 I don't get along with other programmers.

I mean you're talking about advanced AI code that looks up Google links to explain code constructs, meanwhile 95% of the industry is using a code editor that doesn't even allow you to embed a link in a code file. (If you're lucky, it'll make an obvious URL clickable, that's about the best you get.)

3 comments

To prod back, you have three source code files---one is in Word Perfect format from 1987. The second is from Microsoft Word from 1998. The third is an ASCII text file from 1972. Which one can you open and reuse today?
None of them! The ASCII file might be legible, but then it turns out that you don't have the correct build environment or all the dependencies, so the code isn't useful to you as-is.
I can open all of those formats in Microsoft Word right now this instant. So.

Good argument?

No. How about Easy Writer II? Or even Type-Rite?
To be fair, why does it need to be imbedded in the code? Why can't it just be a plain text link to a binary file (your vector image), which automatically embeds for supported editors?

What you're talking about is turning source code into a binary object. That's fine, if you use an editor that supports it, but you shun all other editors when you do that. There is a middleground that doesn't involve making your source code into rich text, imo.

It doesn't need to be. (Why the italics?) In fact I don't give half a crap about the implementation details of how it works. All I want is to be able to drag a little diagram from a paint program into my code editor and have it there in the code and then when someone else looks at the code they see the little diagram, too. Whether it's implemented by a "binary object", or by adding an additional XML file, or by a magical monkey from heaven reaching down and placing it there, I do not care. I'm talking about a feature I want to use, not about nitty-gritty implementation details.

As for "shunning other editors", well, frankly, why are we as an industry bending over backwards to support people using editors from the 1970s? Do you think Ford still builds cars with imperial measurements just so Old Bob the mechanic can keep using the tools he bought when he went into the field in 1968? No of course not, that's stupid. But that's exactly what our industry is doing.

This is actually something that can be done in the IDE distributed with Racket (https://racket-lang.org/). When I first started playing with the language one of the biggest things that stood out was the ability to embed images straight into the source code. It's pretty neat and I other platforms adopt it.