Live data from Hacker News

Why can't I write code inside my browser?

tomcritchlow.com

291–300 of 624 posts

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

#291

Earlier quoted context omitted.

The whole point is, there is no reason to require a programmer to know them. That is an arbitrary choice we have made. We could make a different choice, and not require a programmer to know these things. They could do everything just as well without knowing this, if we let them.

When I was travelling through Italy, I learnt a phrase from programmers there, "If my mother had wheels, she would have been a bike" - and it's a criticism of hypothetical situations like your answer above. Saying "This is arbitrary if we made a different choice things would be different" is a total meaningless statement because you just move the bar and then say if the bar is moved things are different. My argument…

What I am saying is, as soon as someone new to programming points out, entirely correctly, that the tools we use are weird, obscure and difficult to use for no apparent reason, programmers will scream in rage that no, they are not, and by the way, you are stupid for saying it, you clearly have no idea what you are doing and you will never be a programmer.

As is happening everywhere in this very thread.

I am saying that this is weird, toxic and must stop. We must be able to admit that yes, the tools we use are kind of bad. We must admit that we could do better. Otherwise nothing will ever change, and we will keep using stupidly broken tools until the end of days, while patting ourselves on the back for being clever enough to use them.

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

#292

Earlier quoted context omitted.

And what does "usr" mean?

User System Resources

That is not what it meant when it was created. Apparently some people have retroactively tried to change it mean that, but, that is just a complete nonsense phrase.

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

#293

Earlier quoted context omitted.

And do you have any proof of that? Because in my humble opinion, the command line is great solely because keyboard is (up to now) the best input device we have invented. Any graphical tool requires eye-hand coordination, which slows things down considerably. Using keyboard you basically only depend on your muscle memory and can input commands to the machine way more quickly. What you seem to miss is that developers t…

The proof is that I develop for iOS, and I do not need to use the command line at all for this. Using it does not make anything easier and more efficient. It live this every day. I can use the command line. I've used it for decades. I know it intimately, and I know just how many problems it has. Problems it doesn't NEED to have, but problems that we have just decided will be there, and we learn them, and live with th…

You repeat the previous content without any example on how they are better. To you it seems that not having to use command line is an advantage. To me it's not, making your argument moot.

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

#294
> So I can write code inside my spreadsheet, but not inside my browser? WTF.

You can, press F12.

> Here’s my pitch: build a browser that comes pre-installed with node.js, an IDE and a simple runtime environment.

Why? If you’re new to coding then you don’t need an IDE: it adds complexity. You just need a “Run” button like in Excel (right?).

Additionally, you probably don’t need Node.js because it is just adding some API to interact with the operating system.

If you use said APIs then you need to learn a couple of things about the O.S. - nothing major - like what is a shell, or what mkdir and PATH stands for.

But, hey, we’re talking about non-coders here right? They don’t need these APIs, they are just getting started. So why should they need Node.js?

> People hate command lines - not only do they LOOK scary, they give weird unhelpful error messages and… you have to type everything. Ugh. This is why people would rather code inside a spreadsheet application - because it’s an application.

I’m all in for the no-code movement, although I’m not the target audience. I agree that you don’t need to know how to code to setup a simple website. You can just use Webflow.

I think this article doesn’t make much sense. Every paragraph of the article (especially the outro) suggests that Node.js is not an example, it’s the target of the article. The fact that the OP is proposing to run Node.js on the browser suggests that they doesn’t know what Node is, and why you should use it.

Your code will run fine on the browser and on Node as long as you don’t use Node APIs.

Once you use such APIs, you’re agreeing to the fact that you know what you’re a doing - you agreed to use Node’s API; if you didn’t want to deal with the OS directly, then should have opted for something like Visual Basic. And if you agree to use such APIs then you know that Node exists so that you can forget about the browser.

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

#295
post #169

Earlier quoted context omitted.

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)

And why would anyone want that? Would you want your kitchen to be limited to plastic spoons and silicone bowls, because that's easy for a 2 year old to grasp? Pots and stoves and knives, after all, are too complicated, and God forbid the knife is metal and the stove is powered. You can't do useful things and cater for beginners at the same time, because that implies nothing can ever improve beyond what a beginner can…

Very well said. I like your analogy here.

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

#296

Earlier quoted context omitted.

Yup. That's because programming isn't just learning the vernacular. It's, first and foremost, learning to express concepts in a structured, super-precise way; learning to evolve systems in your head step by step, according to a set of arbitrary rules; learning the nature of computation. Familiarity with this type of thinking is visible not just in computer-related endeavors, but often in everyday life matters as well…

We gotta keep beating this drum though. You get people saying programming is just learning Node.Js or learning X or learning Y, and you end up with bootcamps and no computer science. Just reading this thread has been a true journey.

For some people, bootcamps could be the right entry point. I started by building websites in a wysiwyg editor :)

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

#297
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?

That is a good point, but, instead of explaining path in the installer, maybe the starting point for learning should be somewhere else, such as a tutorial?

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

#298
My only explanation for the existence of this article is laziness. You can write code inside your browser easily.

Cloud9 exists and although it was acquired by AWS you can still use it.

https://aws.amazon.com/cloud9/

The real solution to this problem is more awareness and good entry level resources that you can point indecisive people toward. None of his points are actually going to improve the situation even a tiny bit, mostly because they already exist and some of them completely failed while the others are there if you just look for them.

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

#299

Earlier quoted context omitted.

The proof is that I develop for iOS, and I do not need to use the command line at all for this. Using it does not make anything easier and more efficient. It live this every day. I can use the command line. I've used it for decades. I know it intimately, and I know just how many problems it has. Problems it doesn't NEED to have, but problems that we have just decided will be there, and we learn them, and live with th…

You repeat the previous content without any example on how they are better. To you it seems that not having to use command line is an advantage. To me it's not, making your argument moot.

I am saying that if I were to use the command line, things would not be easier for me. Thus, the GUI tools I have are superior to the command line.

I know how to use the command line. I could do it. But there is no reason to do so. It would not do a better job than the tools I have been given in the GUI.

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

#300
post #139

Earlier quoted context omitted.

Programming COULD use a lot of simplification and removal of barriers. But still, just like you, I really hate the base attitude here. And for a different reason: I find that programmers who think like this, are also lazy when it comes to respecting the user. They're lazy when it comes to supporting accessibility. They're lazy when it somes to properly supporting i18n and making experience great for non-Americans. Th…

> Programming COULD use a lot of simplification I so completely disagree. Writing JavaScript is already so simple that almost nobody knows how to do it any more. You can download a colossal framework and a billion NPM packages to write some completely unoriginal CRUD application and bitch about how hard life is. Fearing writing original code is the name of the game.

But isn't using the code that people smarter/more proficient than you have developed a rather good way to go about things?

If not, where do you draw the line? Should you write your own business logic? Should you write your own logic to allow implementing that business logic (e.g. request parsing, validators, data transformations and processing etc.)? Or maybe you should write your own web framework that routes and handles HTTP(S) requests? Or maybe the entire ORM (if you're using one in the first place) as well? But that ORM probably uses JDBC/ODBC or some other driver as well, and the HTTP(S) requests also can be processed because of some additional code and libraries. Should you write those as well? What about the operating system itself, and the code that allows it to interface with the hardware? What about the kernel?

I don't necessarily agree with the OP's point about making a browser that has Node.js packaged (though it's a novel idea), but i definitely agree that defaults and tools matter. Tools like XAMPP ( https://www.apachefriends.org/index.html ) or the CLIs for automatically generating projects and helping automate everything from creating project files, like in Ruby on Rails Generators ( https://guides.rubyonrails.org/generators.html ) or entire apps, like with JHipster ( https://www.jhipster.tech/ ) or create-react-app ( https://reactjs.org/docs/create-a-new-react-app.html ) all seem to decrease the chance of human error and make development safer, more consistent and easier. Even IDEs that are aware of the specifics of the frameworks you're using can be very useful!

In addition, they can improve the developer experience (DX) a whole bunch, since in larger projects time can be invested to address common problems. For example, see Dylan Beattie's conference talk on the topic: https://youtu.be/lFRKrHE8oPo?t=431

I've seen people trying to write their own web frameworks and most of the time the results have been poor, both in understanding the system and maintaining it in the long term, in addition to which you can't hire people that are familiar with "Random Company's Web Framework". Unoriginality is good for being to maintain the project, as far as i'm concerned.

Here's another conference talk, by Venkat Subramaniam about deciding between using existing code or writing your own: https://youtu.be/OheeK7Ux2-8?t=727

Post reply on HN