Hacker Newsnew | past | comments | ask | show | jobs | submit | usrbinenv's commentslogin

I thought those of you who said he was being offensive were more or less justified in saying it here. Then I read the post. Literally nothing offensive. Calling someone a code-monkey has been around for as long as I can remember. If throughout your career you haven't questioned yourself "am I a code monkey?" at least once you're either incredibly smart or incredibly stupid.

I can't agree with him more that Github went to absolute shit and I can feel React crap emanating from it without even looking at the code. There's everything in the world wrong with React and I would easily call anyone advocating it a code-monkey in their face. It's not about JavaScript itself - it's about the framework ideas, which are absolute trash. If anyone's offended by a code-monkey, I feel like maybe they should be.


Frontend framework in JavaScript that requires no build step, relies on DOM and SSR and can be used to build both SPA and hybrid apps without VDOM, js templates, hydration or putting HTML (or worse, css) inside JS code. It'll also have a very sophisticated declarative state manager which makes managing state and ui transitions a breeze. It's basically anti-React.


can you share a repo link please?


Sure: https://code.qount25.dev/qite/qite-js No docs yet, but I suggest you go to test/demo for examples. You can actually see them work if you run it with `node test/server.js`.

State manager isn't there yet, but it's coming.


If I could make one law related to software, it would be to ban React and React-like frameworks (includes Vue and Svelte I believe): if you have to put more than one line of HTML in your JavaScript, if you have VDOM, if you have a build step - I want this to be illegal. It is entirely possible to write a js-framework that attaches itself to DOM from the top, without any kind of expensive hydration steps or VDOM or templating (I've built one). React is a horrible complex monster that wastes developers time, heats up users' CPUs and generally feels super slow and laggy. 99% percent of websites would work a lot better with SSR and a few lines of JavaScript here and there and there is zero reason to bring anything like React to the table. React is the most tasteless thing ever invented in software.


> React and React-like frameworks (includes Vue and Svelte I believe)

Putting React with those two is a wild take.

> 99% percent of websites would work a lot better with SSR and a few lines of JavaScript here and there and there is zero reason to bring anything like React to the table.

Probably but as soon as you have a modicum of logic in your page the primitives of the web are a pain to use.

Also, I must be able to build stuff in the 1% space. I actually did it before: I built an app that's entirely client-side, with Vue, and "serverless" in the sense that it's distributed in the form of one single HTML file. Although we changed that in the last few months to host it on a proper server.

The level of psychological trauma that some back-end devs seem to endure is hilarious though. Like I get it, software sucks and it's sad but no need to be dramatic about it.

And btw, re forbidding stuff: no library, no process, no method can ever substitute to actually knowing what you're doing.


You can do very complex stuff without any need for React like approach. I literally said I've written a very sophisticated framework that was exceptionally snappy - that's what should be used for that 1% (not my framework, but the approach). Even better, I could introduce it very gradually and strategically on different SSR pages and then (if I wanted to) I could turn the whole app into an SPA - all without needing to "render" anything with JavaScript, VDOM or other such nonsense.


Is this framework public? I think the same way as you and developed my own framework with/out the things you mentioned and would like to compare my approach with yours. Biggest difference is that I use lit-html for templating, which is quite efficient.


Kind of, but not really. I'll make it public soon when I have the documentation ready.


> It is entirely possible to write a js-framework that attaches itself to DOM from the top, without any kind of expensive hydration steps or VDOM or templating (I've built one)

Can you elaborate more on how this works? Do you mean JS loading server generated HTML into the DOM?


Server renders the page. Suppose you have a element there which reads like <div data-component="HenloComponent">...</div>. Then the .js framework which was loaded on that page queries the DOM in search of any elements with data-component attribute and creates instances of HenloComponent (which is a class written by you, the developer, user of the framework). It's a bit more complicated than that, but that's the essence of it.

Note that with this approach you don't need to "render" anything, browser already done it for you. You merely attaching functionality to DOM elements in the form of Component instances.


Yes, that is what I was asking about.

I entirely agree. It is what I do when I have to - although I mostly do simple JS as I am a backend developer really, and if I do any front end its "HTML plus a bit of JS" and I just write JS loading stuff into divs by ID.

When i have worked with front end developers doing stuff in react it has been a horrible experience. In the very worst case they used next.js to write a second backend that sat between my existing Django backend (which had been done earlier) and the front end. Great for latency! It was an extreme example but it really soured my attitude to complex front ends. The project died.


> In the very worst case they used next.js to write a second backend that sat between my existing Django backend (which had been done earlier) and the front end.

That's hilarious.

Casey Muratori truly is right when he says to "non-pessimize" software (= make it do what it should do and not more), before optimizing it.


Oh no, they do that? I thought Next.js is a fully functional backend itself, like Django. But I'm shocked to learn that it's just a middleman-backend to render templates that are already served from another backend.


Next.js is a a fully functional backend. Its not Next's fault - I dislike it for other reasons, but this was not a Next problem.

The problem was that the front end developers involved decided to use Next.js to replace the front end of a mostly complete Django site. I think it was very much a case of someone just wanting to use what they knew regardless of whether it was a good fit - the "when all you have is a hammer, everything looks like a nail" effect.


It is Vercel's "fault" because it sold Next.JS as a BFF (Backend-for-frontend), a concept that didn't exist but helped them sell lots of hosting for React, something absolutely unexpected to every old school React developer.


I did not know they sold it as that.

I did a search and a lot of people are promoting the concept. Maybe it makes sense if you have a strong reason to use micro services, but for the vast majority of systems it seems crazy!


Why not ditch HTML itself? People are already downloading binary blobs on a daily basis anyway, just download some binary once, execute them in some isolated environment. So you only have to transmit data.


I don't see a problem with HTML. It's easy to learn, easy to use and a very nice format for web. CSS is also great. JavaScript is pretty great too. My point is that modern web is horrible because people with no taste and no understanding of the underlying technologies turned it into a horrible shitshow by inventing frameworks that turn the web upside down and making a bloat out of it. I don't hate many things in life, but this one - with passion, because every time I visit a website, I can just feel it's made with React because of how slow and laggy it is.


Do not know to what extent you are serious, but I think the idea is that content should be HTML and apps should be just JS.

We could go further and have a language written to run in a sandbox VM especially for that with a GUI library designed for the task instead of being derived from a document format.


Yeah, I think my point was misunderstood: part of what I'm opposed to was writing HTML (or worse, CSS) inside .js files.


Yes, I think you were misunderstood.

I think HTML inside JS is a code smell. I cannot even imagine why you would need CSS inside JS.


lit-html templating inside JS is a code smell?


Ehrm, have you seen how fancy UI stuff is being implemented in so-called "native apps" these days? Anything more complicated than a button or label or other elements familiar since 1993 gets shoved into a webview and rendered with HTML and CSS.


And? I don't need any of that fancy. Does anyone need that fancy stuff? I don't think anyone complained about UIs with apps in Windows XP.


I really love D, it's one of my favorite languages. I've started implementing a vim-like text editor in it from scratch (using only Raylib as a dependency) and was surprised how far I was able to get and how good my test coverage was for it. My personal favorite features of D:

* unit tests anywhere, so I usually write my methods/functions with unit tests following them immediately

* blocks like version(unittest) {} makes it easy to exclude/include things that should only be compiled for testing

* enums, unions, asserts, contract programming are all great

I would say I didn't have to learn D much. Whatever I wanted to do with it, I would find in its docs or asked ChatGPT and there would always be a very nice way to do things.


D is a bittersweet topic for me.

From a philosophical/language-design standpoint, it ticks so many boxes. It had the potential to be wildly popular, had a few things gone differently.

If the language tooling and library ecosystem were on par with the titans of today, like Rust/Go, it really would be a powerhouse language.


Isn't D supported by the GNU compiler collection? I personally would prefer this type of tooling over what Rust and Go do (I can't even get their compilers to run on my old platform anymore; not to mention all this dependencies on remote resources typical Rust/Go projects seem to have: which seems to be enforced by the ecosystem?)


It is, however keeping LDC and GCC up to date is a volunteer effort with not enough people, so they are always a bit behind dmd.

Still much better than GCCGO, kind of useless for anything beyond Go 1.18, no one is updating it any longer, and may as well join gcj.


LDC isn't regularly behind DMD lately. The issue lately has been more the release process with respect to DMD. People issues impacting that.


Which was my point, volunteer work without enough people.


Having written real code in D, I can say that the slight discrepancy between dmd, LDC, and gdc isn't a roadblock in practice.


Depends how creative you happen to be with some features.

For regular common code that is indeed not an issue.


It is supported. However on Windows GDC does not work. LDC based on LLVM needs Visual Studio but I maybe wrong since there are clang/llvm distributions based on mingw64. Other than that DMD works fine, a bit slower than the other compilers, but a charm to use.


Ldc like dmd ships lld and mingw import libraries and has for a few years now.

They both work out of the box without MSVC installed.

It's only ImportC feature that requires MSVC. The work required to get clang working in its place hasn't happened yet.


It is


Yeah, the foundations of the language are incredible. It's just everything else around it that brings it down (and is unfortunately very hard to motivate people to solve).

D definitely missed a critical period, but I love it all the same.


So, I also write Go and I don't get the part about tooling. I don't need formatters or linters as I'm adult enough to know how to format my code (in fact I dislike tools doing it for me). D also has dub, which is fine, as far as package managers go. The ecosystem is the only issue and Go does arguably have a lot of very cool libraries for virtually anything, but outside of webdev, I can't see myself using them. This is why D works a lot better for projects where I don't need all those dependencies and would do better without them.


I freely admit to not being a Go or Rust expert, but from what I can tell using C from D is even easier than in either of these languages. The C++ interop is also decently usable.

IMO, the bigger issue is language tooling.


D really does work as a "Better C" C compiler. For example, D's Import C supports this:

    void abc() { def(1.0); }
    void def(double) { }
I.e. forward references "just work". (Forward references don't work in C++, either.)


Being able to use ImportC to "just include" all of LAPACKE was a high point for me with this! Thanks for adding this feature, it rocks.

... Now, get started on ImportC++!!! (Only joking... kind of. ;-) )


If it makes you feel better I have some projects that I'm working on in order to improve the tooling. Would you mind listing out all of the things you think are missing, so I can work on those once I get the other ones done?


I like a lot about D. My main criticism of the language is that it quickly becomes too noisy as more of its nice features are used. I think this could be fixed, for example with better attribute defaults in function signatures, and I think Walter is aware of this.

I could tolerate the noisy language bits, but:

The standard library (Phobos) was so riddled with paper cuts that every day I used it felt like trying to navigate the surface of a coral reef... barefoot... in a hurricane... while blindfolded. It drove me off after a few months. (That was last year.)

A Phobos V3 design has begun, but given how few people they have to work on it, I am skeptical of it ever developing into a library that I would want to use. Here's hoping for a pleasant surprise. :)


You have any specific complaints about Phobos and a standard library you like?


A few examples from a little over a year ago:

Heavy reliance on the range interface, without automatic support for common range-like types like arrays, so calling code must be cluttered with wrappers.

Insistence on returning things exclusively as ranges, even when a single item is wanted, so calling code must be cluttered with dereferencing. (e.g. std.algorithm.searching.find)

The doubly-linked list implementation had no obvious way to remove a node by reference; removal of an inner item seemed to require traversing the list.

Inconsiderately designed class hierarchies. (e.g. InternetAddress & Internet6Address shared a base class that lacked a port field.)

Inconsiderately designed interfaces. (e.g. CRC32 could deliver a result only as a byte array, which fits the generic std.digest interface, but not as an integer, which is how 32-bit CRCs are often used in the real world.)

Unfortunate naming choices scattered about, such as a function name implying behavior subtly different from what the function does and a user probably expects (leading to surprising bugs) or named after a specific computer science algorithm instead of its purpose (making the needed operation hard to discover).

Various types and functions defined without the attributes required by other parts of the stdlib, or required in order to use/override them in safety-minded code. (e.g. nothrow, @safe, scope)

Time module lied about system clock resolution despite having internally retrieved the correct value from the OS.

Generally useful functionality kept private within the library, rather than made public, forcing users to either re-implement it themselves or lean on arcane trickery to get at it. (e.g. string escaping.)

Logger output customization was needlessly difficult.

No viable async/coroutine support. Vibe.d is the closest substitute, but is a third-party package, integrates poorly with Phobos, isn't documented very well, and is buggy.

...

Mind, these are just highlights of things I discovered while using D for one small project (a network protocol library and tool) so this is by no means a comprehensive account of problems in Phobos. All these problems could be worked around, but I ended up spending far too much time investigating them and developing workarounds instead of being productive.

I acknowledge that I was new to D, so some of my complaints might have had solutions. (However, I would point out that a solution that isn't easy to find might as well not exist.) Regardless, the pattern was clear: Phobos was a PITA to use. Too many paper cuts.

> a standard library you like?

I stuck with C, C++, and Python for more than a few years. Their standard libraries all have significant problems, but none frustrated me so much as to drive me away from the language.


The following statement originates from Adam Wilson who is heading the PhobosV3 project, and I will second it.

The issues you have are examples of known problems that PhobosV2 has suffered under. Coroutines, for instance we would like to have in language, a proposal (me, not Adam) have already made one, but it's sitting till next year. Naming and interfaces issues are a big part of what will change in PhobosV3.


If you introduce coroutines, please consider unifying them conceptually w/ generators (or better yet - ranges)


>Heavy reliance on the range interface, without automatic support for common range-like types like arrays, so calling code must be cluttered with wrappers.

But D arrays/slices are already ranges. Is this referring to string autodecoding or something else completely? I fail to recall any situations where builtin types required wrappers often.

>Insistence on returning things exclusively as ranges, even when a single item is wanted, so calling code must be cluttered with dereferencing. (e.g. std.algorithm.searching.find)

This is mirroring C++ iterator design and IMO the right move though I agree that specifically for ranges it is rather awkward to use in practice.

What would you return instead? A pointer? What if one wants to find the position of the element and do something after that with that position/subrange.


Thank you for this post. I can tell you that we do appreciate comments like this, and the deficiencies you cite are many of the reasons we are rewriting phobos and druntime.

The time module "lied" seems like a straight up bug. Can you give any more details on it?


https://issues.dlang.org/show_bug.cgi?id=24446

Thanks for responding well to constructive criticism.


Wow, this was introduced in 2012!

https://github.com/dlang/druntime/pull/88


> ### seems like a more primary header

I really dislike this for headers, but also, this marker is only valid inside code blocks and is optional.

> How do you specify the language for code blocks so they can be syntax highlighted?

See above, with ###Go and then add Prism.js into your document.


Markdown is unreadable as a source. This solves the problem of looking good and clean as a text document and not having to remember many rules (certainly less than Markdown) to write a valid Shrimple markup that compiles nicely to HTML. Another thing is a static site generator that's very nice for writing documentation sites -- it takes care of generating not just the html pages tree, but also inserts menu and navigation links in them correctly.


The nice thing about MD is that it's a spec, separate from impls. If I were to use this, I'd want to install a node.js lib that renders it to HTML and has a plugin API for features you didn't think of but that I need and know how to implement myself. So I wouldn't tout the built-in-ssg as a feature, more of an ad hoc spec like perl markdown originally was.

Also I commented with some feedback in another part of this post.


Yeah, I get it. Technically, nothing prevents me from writing a formal spec (rules are rather simple too and most are listed in the README), but I just don't expect any kind of adoption, it was really just a tool for myself to ease the pain of writing docs. Thank you for the feedback.


To add to my other comments ITT, I was thinking how the proposed name-spacing in Ruby would work is, in one way, diametrically different from Go where you'd normally import a package with the name that was chosen by the package author. But, at the same time, you could choose to import it under a different name or with no namespace at all, using the dot prefix. I'm not sure which is better. I suppose I could agree Go has a better default when it comes to namespaces.


It's not straightforward to prevent the original name from existing, though you can play games with File.read() and class_eval, but if you just want it to be available under a different name, and don't mind that the old one is there too, you can just do:

    require 'foo'

    module MyPreferredNamespace
      include Foo
    end


I disagree. I've also been working with Ruby for almost 20 years and quite a few times I came across a situation where I definitely wanted to wrap my library in a module for name-spacing and it was almost always cumbersome. I'd rather not wrap it and let others (or myself) use the library name-spaced under whatever name they choose. Right now, if you're working on a gem, you have to think really hard how to name it so its top-level classes an modules don't conflict with any other modules and classes found in the Ruby ecosystem.


> Right now, if you're working on a gem, you have to think really hard how to name it so its top-level classes an modules don't conflict with any other modules and classes found in the Ruby ecosystem.

Follow gem naming conventions and this is a non-issue -- both FooBar::Record and BazQux::Record can coexist for foo_bar and baz_qux gems, respectively. If a gem is defining other top-level constants outside of their gem module, then that's considered against convention, i.e. bad practice, and the language should not be modified to allow such a thing.

I'd like to hear of a real use case for namespaces that existing conventions don't already solve.


Wrapping `Record` in `Foobar` or `BazQux` is just not a good pattern, even if it's common place and is included in current guidelines. Most of the time, you don't have gems that would use the same class and thus would rather not type a long name-spaced name every time you want to use `Record`. But when you do have gems with conflicting classes, you'd have the power to wrap one of them or both in a short namespace identifier and be in charge of the naming. Using modules for wrapping is a pattern currently, but modules should primarily be used for mixins, not name-spacing.


If you don't have a conflict, and the module is wrapping everything, nothing stops you from doing "include <yourmodule>".

Similarly, if you want to group modules that don't conflict together under a short module name, nothing stops you from doing:

    module MyGroup
      include Module1
      include Module2
      ...
    end
In other words, wrapping them doesn't remove your ability to use short non-namespaced names.

Using `include` of specific functionality into a class that will use it is furthermore an idiomatic way of avoiding that extra typing without polluting the global namespace

For that matter, you can often achieve close to what you're arguing for as well without actually making any changes to Ruby:

   def wrap_load(path) = class_eval(File.read(path), path)

   module Test
     # some_file.rb will act as-if defined within Test
     wrap_load("./some_file.rb")
   end
You can do better than that, to get closer to emulate `require` rather than `load`, and handle dependencies.

Overall, I think the fact you can do these things suggests you could probably write a good enough plug-in `require` monkeypatch suitable for the rare cases where `include` from within a class or module without needing a language extension.


What's the difference between FooBar::Record and ns1::Record? Nothing, except the latter pushes encapsulation onto the user.

This is not the Ruby ethos.


Realistically it would be FooBar::Record and ns1::FooBar::Record too, unless gems start replacing their top level module FooBar with FooBar = Namespace.new.

And why would you bother doing that when it would be a breaking change?


On a purely syntactic level snake_case gives me a clear indication this is something different (not a module). But the underlying mechanics of how namespaces would work, as I've mentioned in another comment, is that the choice of picking namespace identifiers is shifted to users of gems/libraries. I think the proposal might further benefit from maybe giving libraries default namespaces and, for example, Go does exactly this: you can import a package with the namespace prefix defined by package author, but you can also change it or import it without a namespace prefix at all.


Using Ruby modules to namespace things is certainly possible, but is very often cumbersome. Modules also "hardcode" a namespace: that is, if I use modules for name-spacing, it will always be "MyModule::MyClass" everywhere -- or, in other words, namespacing is controlled by library author, not user. The proposed feature shifts that control to library user.


> if I use modules for name-spacing, it will always be "MyModule::MyClass" everywhere

It will be identified as such by e.g. the default `inspect`, but nothing stops you from `include`-ing MyModule into another module or class, or even the global scope so that you can reference MyClass without MyModule.


I recently read almost the whole book in a week or so. It's excellent and I feel like I can write in D pretty well after reading it. Too bad that I most likely won't be writing in D, but, at least, I'm confident I can come back to it anytime and be up to speed if I ever need to. This book should be the goto for anyone who wishes to quickly learn the language.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: