Live data from Hacker News

Why can't I write code inside my browser?

tomcritchlow.com

371–380 of 624 posts

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

#371
post #96

I try to keep my comments nice on HN but in this case I can't, I've met this kind of person many times now and I just can't hold back. The author is lazy, and is channeling his energy into complaining rather than learning. He believes he is by default an expert on the 'user friendliness' of programming. His comments don't really make much sense, and come across as whining that should be ignored. "People hate command…

> "People hate command lines - not only do they LOOK scary, they give weird unhelpful error messages and… you have to type everything. Ugh. "... I have no patience any more for lazy know it alls I would guess that almost everyone who has ever learned programming has gone through this experience, been frustrated, and understood in the moment that this was bad UX that could be improved for learners. As such, your attit…

No, I do not think you have understood my argument.

There is only one word for someone, who approaches a topic they know little about, and suggests that its rubbish and he knows better.

That word is 'arrogant'.

And you are correct, I have no sympathy for arrogant people.

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

#372
post #88

If the author has “been playing with the web and code for years” and is still “wtf” on /usr/local/bin in $PATH it shows a lack of discipline and structure in their learning. I see this in many in many of my apprentices - the desire for instant gratification and the lack of experience means they refuse to do anything that doesn’t immediately proceed them closer to their goal. Here’s the thing with programming - you ca…

/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…

I'd say programming (at least modern programming) involves knowing one's environment and knowing how to get things done in relation to the actual code writing.

Also, using the search query "/usr/local/bin" in Google returns this[0] link first. This is my real issue. If a simple web search returns a good result first that gives you a good overview and gives you more background knowledge and more terms to search for and flesh out your knowledge, then there is little excuse to say learning is too hard. If you don't want to learn, that's fine, but complaining about learning being too hard here is unjust.

[0] https://unix.stackexchange.com/questions/4186/what-is-usr-lo...

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

#373
post #96

I try to keep my comments nice on HN but in this case I can't, I've met this kind of person many times now and I just can't hold back. The author is lazy, and is channeling his energy into complaining rather than learning. He believes he is by default an expert on the 'user friendliness' of programming. His comments don't really make much sense, and come across as whining that should be ignored. "People hate command…

> The author is lazy, and is channeling his energy into complaining rather than learning.

I don't know about that. The author is certainly confusing programming with setting up a development environment. I can understand why they would be frustrated with the latter, since it takes away with what they are trying to do.

When I started out, the latter was fairly simplistic: computers booted into BASIC. If you needed something more sophisticated, you could buy an IDE where everything would run right off the boot disk or after an automated installation. You can still find those tools, designed to serve everyone from home users to professional developers. That being said, it seems to be much less common.

In some cases, like web development, that makes sense. The target is a standard rather than an operating system or hardware architecture. In other cases it is self-inflicted. When you choose to work with third party libraries, there is a much higher probability that some work will need to be done to integrate it. Then there is the WTF category.

Take one of the easier cases: Java. Even though the development model is much closer to traditional languages like C++, the most common use case will involve installing an IDE and the language separately (possibly with some tweaking of the environment). That's not too bad, but it's likely more than people want to see when they want to get their tools up and running. Contrast that to C++ on a commercial operating system: you install Visual Studio or Xcode and are ready to focus upon programming for the chosen platform.

Of course, C++ isn't always like that and it comes close to representing the other extreme. Setting up development tools for microcontrollers can be quite the task, particularly if you choose the "wrong" one. That's a good part of the reason why novices like Arduino and Platform IO, it makes going from nothing to a functional IDE fairly straightforward.

Now I'm not going to say that the author is right, but I will admit that they have a point. Presenting Unix-isms in a macOS installer is going to rub some people the wrong way. That should have been addressed in a better manner. On the other hand, they were also attempting to accomplish something that is non-trivial to start with.

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

#374
post #59

I feel like the author is confused between server-side and client-side development, and proceeds to say that programming is hard. He even goes on to quote himself (sigh) as a proof of what he proposes. Look, maybe someone just explained it badly to you, and you should look it up for yourself. However, if the command line looks scary to you... wait until you read bad documentation :) My point is: yes, programming is a…

> But just like it's hard to become a good musician if you shy away from sheet music, programming is hard if you shy away from command line and a little web searching to know what $PATH is.

I like this analogy a lot. You can't just write code and then say "here, I'm done" most of the time. You need to know the environment it's around and what it needs to interact with/what will interact with it.

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

#375
post #334

Earlier quoted context omitted.

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 ha…

> But isn't using the code that people smarter/more proficient than you have developed a rather good way to go about things? One big task about programming is handling dependencies and thinking about assumptions. Before even beginning to write any code, you have to think about these things: - What environment do I expect the end user uses? Are there already some libraries I can use as well installed? - Do I need a GU…

That's a fair argument to make, however i'm not sure that i'm able to entirely agree to this.

> While good developers think about each one and try to find a minimal set of them.

(tl;dr at the bottom, things up to "In short, " are merely my experience, which is entirely subjective)

For example, suppose that i'm working on a Java project and i want to do some non-trivial operations with the filesystem. In this instance, my options for implementing the functionality would be as follows:

    1. Attempt to do it myself by using the standard library
    2. Attempt to find a really specific library that allows me to do what i need
    3. Attempt to use one of the larger libraries out there, that provide a variety of related functionality, which may or may not be useful
Each of them definitely should be evaluated, but for the most part, i've found the following to be true about these approaches:

1. Attempt to do it myself by using the standard library

    + Will be easily customizable, because no source/recompilation will be necessary for an external library (though mostly a problem of the toolchain and approaches to including libraries).
    + Will result in a small distribution size, since there won't be redundant code included.
    - The code mostly won't have good test coverage, since i cannot spare the time because of business/bosses needig functionality ASAP. Neither will i be able to address the technical debt that might arise from this solution, or throw out a sub-optimal solution and rewrite it until i get it right. Ideally this wouldn't be a problem, but i'm afraid that this is usually the case.
    - The documentation will be sub-par, since code itself doesn't provide many mechanisms for showing examples on how to use it (as opposed to a Wiki/sandbox), even in the case of "self-documenting code", non-trivial concepts will still require code comments, which will also need to be kept up to date by someone who'll need to edit the code. Onboarding will be more difficult, because initially noone will be familiar with the solution.
    - Time spent creating bespoke solutions will prevent me from implementing other solutions and addressing other concerns with the limited time i have. In addition, bugs could arise, since i'd miss certain aspects that people who are more proficient in working with IO would notice and address.
2. Attempt to find a really specific library that allows me to do what i need

    + Will result in a small distribution size, since there won't be too much redundant code included.
    - More often than not, minimal dependencies can result in many of the above problems (especially problematic with documentation, since i wouldn't even have had written the code in the first place).
    - In addition, minimalistic solutions often have relatively few contributors, which can result in them becoming abandoned some time down the road. Maybe not too important for small libraries that can be rewritten, but eventually you'll end up with unmaintained dependencies which will need addressing.
3. Attempt to use one of the larger libraries out there, that provide a variety of related functionality, which may or may not be useful

    + Will usually be actively maintained (for example, https://github.com/apache/commons-io has 70 contributors and 360k users).
    + Will usually also have reasonable test coverage (the library above has 89%, according to GitHub)
    + Will usually have a rather good documentation that's updated by others (sometimes in the form of a separate website, like https://commons.apache.org/proper/commons-io/)
    + Can easily be Googled with plenty of common problems (some of which are almost inevitable) addressed. This will also help others, who need to work with said code.
    + Maintenance and technical debt won't need to be addressed in house. Oftentimes it'll be as easy as bumping up the version number and running the tests surrounding the integration (if any exist).
    - Will probably include lots of bloat, which may or may not have a significant impact on the bundle size of your project.
    - Will most likely increase the attack surface of your project in some way.
    - Will also be difficult to audit and really get to know in entirety (if not impossible).
In short, i don't think that how "minimal" dependencies are should be the deciding factor when choosing them, but rather the results of deliberation of the points that you've described above. In my experience, i've found that more often than not, counting on existing and popular frameworks/libraries/approaches is the best way to go. Though this is from the perspective of someone creating mostly business oriented solutions for external clients, thus i'm biased because of time/resource limitations and such.

There was actually a rather humorous presentation a while back and while the best video i can find of it is still in pretty bad quality: https://youtu.be/AUYPnxv0yss (couldn't find the exact timestamp) one of the things that stuck to me was the suggestion that you should use whatever language/tool/framework that your friends/colleagues use, if possible. Essentially - use boring technology, that will be easy to reason about and that will help you more often than not.

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

#376
Chrome includes (almost) a fully functional IDE. If you dig around, you can bind Chrome's Javascript debugger to files on disk. You can also interactively tweak the CSS that's rendered and then copy and paste it back to your sources.

But, I don't see why this guy thinks installing NodeJS is hard. I have a low tolerance for painful installs, but NodeJS and Visual Studio Code were quite easy for me to install and pick up.

Furthermore, you can code in a browser: Azure supports this, although it was somewhat buggy when I tried it.

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

#377

Earlier quoted context omitted.

> 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 ha…

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

Many problems don't go away and don't become easier just beacuse you shove them under the carpet into a library. A lot of developers use libraries as an excuse to NOT THINK about the issues and ignore their existence not to save work. There's a fundamental difference between "I understand the problem and I know that library X will give me a good solution with low amount of work" and "This problem is hard, I'll shovel in another library and keep my fingers crossed that it does a good job at it."

It's saving work vs. saving thinking. First one is ok. Second one is not.

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

#378
post #88

If the author has “been playing with the web and code for years” and is still “wtf” on /usr/local/bin in $PATH it shows a lack of discipline and structure in their learning. I see this in many in many of my apprentices - the desire for instant gratification and the lack of experience means they refuse to do anything that doesn’t immediately proceed them closer to their goal. Here’s the thing with programming - you ca…

/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…

All environments for computer development need to manage some amount of abstraction to bootstrap that environment and get programs to run. In nixes, it's the bootloader, the kernel, and shell (with its ENV). When you issue the command `node` to a computer, what does that actually mean? Your Delphi setup probably just hid most of that abstraction from you, the way most people need not worry about the bootloader. But env is kind of unavoidable. It's like the Construct from the Matrix. The staging area for all other programs.

I have struggled a lot with the nitty-gritty of ENV over the past few years and I agree with you that maybe there is a better way. /etc/, Conda, virtualenv, docker, ROS, Windows registry, they all deal heavily with managing the environment, and all have their own thorns. Then you have kube, consul, ansible, and all the fun of distributed environments.

The bottom line is, if you want multiple, orthogonal runtimes, you need an abstraction for managing namespaces. PATH is actually one of the simplest mechanisms to achieve this.

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

#379
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)

That's like people expecting to be able to repair their TV with their remote control.
Post reply on HN