Live data from Hacker News

Why can't I write code inside my browser?

tomcritchlow.com

171–180 of 624 posts

Re: Why can't I write code inside my browser?

#171
post #26

Not all documentation should be aimed at an absolute beginner - the authors point about $PATH seems moot to me, especially considering how easy it is to look up. Should a library also explain how an async function works in JS when introducing its feature that uses promises? Of course not. Any field requires technical knowledge, and we're lucky we live in a world where its increasingly easier to overcome any roadblock…

It’s all about reducing the barrier to entry. Many people find the command line daunting. Why not reduce these barriers to entry? Why require someone to understand $path to start coding in JavaScript?

If it's not $PATH, it will be something else.

People should deal with it and learn. No matter how low the barriers to entry are, you're still going to have to figure shit out at some point.

PS: You don't need to understand $PATH to start coding in JS. You can create an HTML or JS file, hack away and run it locally.

Re: Why can't I write code inside my browser?

#172
post #147

Earlier quoted context omitted.

/usr/local/bin has absolutely nothing whatsoever to do with programming. Nothing. Zero. Zilch. It is completely superfluous knowledge. It is only required because, as the author correctly points out, the tools we use are BAD. They are absolutely fucking AWFUL. /usr/local/bin is an implementation detail from an OS nobody has used for decades. It's still here because we refuse to fix these ridiculous things. Nobody sho…

> /usr/local/bin is an implementation detail from an OS nobody has used for decades. Are you taking the piss? Should we also remove SOCKET's because they were introduced in that same OS? It should be noted that _EVERY_ modern operating system implements a "path" system, even the ones that are very divergent.

Should we remove sockets? Possibly. We could most likely design a better API today.

Re: Why can't I write code inside my browser?

#173

Earlier quoted context omitted.

The author is 100% correct on everything. Programming is massively over-complicated for no useful reason. Programmers tend to get very proud of the completely pointless knowledge they have to acquire to use the pointlessly complicated tools they do, and they confuse that with being clever. It's not. It's really not. Nothing has to be this esoteric and annoying. We've just chosen to keep things like this because we th…

You see that absolutely in every "new". Programming language. It starts simple, beautiful, easy to read and understand. And 10 years later: people want ways to write a ten liner, in one line compressed. The first one is easy to understand, easy to follow, the second one, not so much, even for the person who wrote it.. (after doing something else for a year for example) I hate it...

> And 10 years later: people want ways to write a ten liner, in one line compressed.

There is nothing wrong with that. People want to work with higher-level concepts, which allows them to solve more complex problems without burning their brains out. I'd go as far as saying that the utility of a programming language is measured in its ability to compress code with abstractions. All this means you have to first understand the abstractive tooling and the abstraction itself before you can work with it, but this is how it should be. Most programming languages are tools, not toys.

The alternative would be to handicap all programming, make it impossible to solve complex problems with it for the sake of beginners, who want to get accolades without putting in work. You can't run an industry on participation trophies. By this line of thinking, we wouldn't have this conversation because inventing computers took work. Hell, none of us would have any conversation whatsoever, because language itself is something that takes years to learn.

Re: Why can't I write code inside my browser?

#174

Earlier quoted context omitted.

/usr/local/bin has absolutely nothing whatsoever to do with programming. Nothing. Zero. Zilch. It is completely superfluous knowledge. It is only required because, as the author correctly points out, the tools we use are BAD. They are absolutely fucking AWFUL. /usr/local/bin is an implementation detail from an OS nobody has used for decades. It's still here because we refuse to fix these ridiculous things. Nobody sho…

The server you submitted your comment to uses this 'OS nobody has used for decades'. The OS you wrote this from, also uses this implementation detail.

It most definitely does NOT use that OS. That is a ridiculous claim.

Re: Why can't I write code inside my browser?

#175

Earlier quoted context omitted.

"The command line" is not pointless. The current popular implementation of a command line, is, however, pointlessly complicated and esoteric for no real gain. It could be improved massively.

What do you mean by "current popular implementation of a command line"? The shell, common tools (e.g ls, cat, grep), command line interfaces for other programs?

The vaguely-standard Unix shells, yes.

Re: Why can't I write code inside my browser?

#176

Earlier quoted context omitted.

"The command line" is not pointless. The current popular implementation of a command line, is, however, pointlessly complicated and esoteric for no real gain. It could be improved massively.

Which one? Please explain how it's pointless. What is esoteric about typing which program you want to run?

Standard unix shells. They contain a massive amount of complexity and obfuscation that only exists because that's how it was always done and nobody dares change it any longer.

Re: Why can't I write code inside my browser?

#177
The hostility coming off of these comments is pretty off-putting. I share some of the sentiments and believe that the authro has some misconceptions.

But I also believe that he makes a lot of great points. Installing and maintaining programming languages is too hard. Going from "I would like to try some $lang" to being up and running is usually difficult and requires you to install binaries, then deal with PATHs, and with CLIs, and REPLs and a bunch of cruft before you can start experimenting and getting to the interesting parts.

The programming language experience comes with a shitoad of stuff that really has very little to do with the language itself.

There is also a lot of potential in more flexible tools that allow me to create small apps with, well, maybe not with minimal coding, but with minimal installations, minimal integrations in my particular OS, minimal maintenance of the installed binaries and tools etc.

Re: Why can't I write code inside my browser?

#178
post #169
post #155

Earlier quoted context omitted.

What would be the layer below it? It's certainly not GUIs, which are a significantly more complex layer of abstraction.

It's definitely GUIs, which is much easier to use for beginners (we're talking about beginners here, not people who have been using command lines exclusively for the last 20 years)

In one statement you just revealed your age and experience level.

The general trend in programming has been moving TOWARDS command line interfaces, not away from it. Mac OS didn't even have a built in command line until 2001. Microsoft Windows in the last few years has had its command line functionality enhanced, to the point that the GUI only Server versions of Windows have been stripped back, and now there are CLI only versions of Windows Server.

You can do more now in a command line than ever before, you can do more now in a command line than you could in 2001.

"Everything should have a GUI alternative" has been tried and it has failed. Almost all computer efforts through the 1990s were focused on making everything GUI only.

Re: Why can't I write code inside my browser?

#179
post #137

Earlier quoted context omitted.

The author is 100% correct on everything. Programming is massively over-complicated for no useful reason. Programmers tend to get very proud of the completely pointless knowledge they have to acquire to use the pointlessly complicated tools they do, and they confuse that with being clever. It's not. It's really not. Nothing has to be this esoteric and annoying. We've just chosen to keep things like this because we th…

I am not sure how true this is. There have been numerous attempts at visual programming and they have generally turned out to be crap. Because syntax is actually a relativity small part of the problem.

It has nothing to do with visual programming. Which, by the way, is in massive, wide-scale use today. Game engines tend to use it, audio processing software uses it, and scientific control software also use them.

But no, what I am talking about is all the tooling around the programming, which in turn relies on the massively archaic Unix command line.

Re: Why can't I write code inside my browser?

#180
The reason you can't do this is that Node of course has a bunch of file system APIs that for security reasons necessitate an application designed for automatically downloading and executing arbitrary source code can never, ever, have access to.

But you could rephrase the authors point this way: Browsers make a ton of concessions to regular users at the expense of developers. Consider for example that the act of developing a web application in fact often does not involve executing arbitrary source code online, it involves executing specific source code you have control over, which has different security requirements.

The author is expressing something I'm surprised more developers don't pick up on: The browser is a consumer tool first, and yet it's a favorite tool of developers despite the fact that it barely caters to developers at all. Take for example the "Developer" menu item, which is two levels deep in Chrome. A rational developer, who spends all day with a browser open for development, would be frustrated that one of their primary use cases has such a low priority in the application. But that's not how developers perceive the browser, developers have a fondness for the browser that's not reciprocated.

Another example of the low priority of developer use cases in browsers is that the commonality of the other main developer tools, text editors and terminals, is that they achieve incredibly powerful functionality through process management. E.g., code completion, linters, integrated debugging, `grep`, `git`, are all based on text editor's and terminal's ability to manage external processes. But browsers can't do this, which firmly limits their usefulness, and creates bizarre situations like having to manually hit the refresh button because your server process can't talk to the browser application itself.

Post reply on HN