Readit News logoReadit News
rottc0dd commented on Review of 1984 by Isaac Asimov (1980)   newworker.org/ncptrory/19... · Posted by u/doruk101
rottc0dd · a month ago
I really loved Pynchon's introduction to 1984[1] in new Penguin edition.

[1]: https://shipwrecklibrary.com/the-modern-word/pynchon/sl-essa...

rottc0dd commented on Public static void main(String[] args) is dead   mccue.dev/pages/9-16-25-p... · Posted by u/charles_irl
unscaled · 6 months ago
This heavyweight syntax has nothing do with OOP. No common definition of OOP (before Java came into existence) said that functions cannot exist outside of a class.

Java choose to adopt object oriented purity in a very weird way. Sun has initially rejected the idea of standalone functions (static import was introduced in Java 5, closures in Java 8 and compact source files/instance main is only coming now). Even with static imports and compact source files, there is still a class holding these methods behind the scenes (for practical and compatibility reasons, more than to achieve any ideological or theoretical goals at this point). That seems like Sun was trying to keep the purity of "everything is an object", but at the same time they've introduced primitive values, which are clearly not objects. This was a pretty bad decision in my opinion. There is no practical benefit from requiring every function to be defined inside a class[1]. On the other hand, being able to have methods defined on an integer is a pretty nice feature.

If we look at a Smalltalk, which is generally considered be an example of a "pure" OOP language, we see a striking difference. This is Hello World in Smalltalk:

  'Hello, world!' printNl
Smalltalk allows you to freely define functions outside of classes and even write code that is not part of a class (directly in the REPL).

[1] https://steve-yegge.blogspot.com/2006/03/execution-in-kingdo...

rottc0dd · 6 months ago
I am not sure of historical significance of what OOP is, but even Alan Kay seem to agree that modern definition of OOP is not what he intended[1]. But, for better or worse we are stuck with the principles.

We even have design patterns like Command, to workaround first class functions in "pure" OOPy way.

And for enterprise software development, I like it that way. It can make up a definition it wants and stick to it. I think it is better for a language's ecosystem and culture to have one dominant paradigm than becoming kitchen sink of programming languages.

Edit: added a link

[1] softwareengineering.stackexchange.com/questions/264697/alan-kay-the-big-idea-is-messaging

rottc0dd commented on Public static void main(String[] args) is dead   mccue.dev/pages/9-16-25-p... · Posted by u/charles_irl
rottc0dd · 6 months ago
From my previous comment in hn:

As a java guy and think python is weird, I don't think this sucks.

But, I also agree that can serve as terrible intro to programming if you start programming right away without understanding the basics of abstractions. But, often when we have tools either designed for a purpose in mind or a dominant paridigm or reaction to existing set of tooling, this can result in understandable yet extreme abstractions.

Java is designed with OOP in mind and it kind of makes sense to have the user to think in terms of lego blocks of interfaces. Every method or class needs to have clear understanding of its users.

public - software handle is for all users

protected - software handle for current and extending classes

default - software is exposed to current package

private - software is restricted to be used in current class alone and nowhere else

So, the beginning of java programming starts with interface exposed to the user or other programmers. Is it weird and extreme. Yes. At least, it is consistent.

rottc0dd commented on Writing code is easy, reading it isn't   idiallo.com/blog/writing-... · Posted by u/jnord
s_Hogg · 6 months ago
You need to be twice as smart to debug code as you need to be to write it. So if you write the smartest code you can, then you by definition are too dumb to debug it

Just write simple code

rottc0dd · 6 months ago
Good ol' Kernighan strikes again [0]

[0] - https://www.laws-of-software.com/laws/kernighan/

rottc0dd commented on Do the simplest thing that could possibly work   seangoedecke.com/the-simp... · Posted by u/dondraper36
sodapopcan · 6 months ago
Right, and again this is reading too much into it. The simplest thing possible does not mean the best solution. If your solution that worked really well yesterday no longer scales today, it's no longer the correct solution and will require a more complex one.
rottc0dd · 6 months ago
Another thing that impedes us sunken cost fallacy. Classic "Simple vs easy" change. Even if a design is comparatively simpler, it is harder to make such change for small feature.

We had a project which is supposed to convert live objects back into code with autogenerated methods. The initial design was using a single pass over the object graph and creating abstractions of HDL and combining method blocks in the same pass.

That is a big hairy code with lot of issues. Simpler would be to handle one problem at a time - method generation in one pass and then convert the methods to HDL. But, getting approval for a deployed app is so hard. Particularly when it is a completer rewrite.

rottc0dd commented on Eternal Struggle   yoavg.github.io/eternal/... · Posted by u/yurivish
francisduvivier · 6 months ago
Well that's fixed in the V2 with even more vibe coding:

https://francisduvivier.github.io/eternal-struggle-with-spee...

rottc0dd · 6 months ago
Nice work.

Still buggy. If you increase the ball size and increase the speed, the whole thing goes black/white in 10 seconds.

rottc0dd commented on Ask HN: Is it time to fork HN into AI/LLM and "Everything else/other?"    · Posted by u/bookofjoe
simonw · 8 months ago
I built you this: https://tools.simonwillison.net/hacker-news-filtered

It shows you the Hacker News page with ai and llm stories filtered out.

You can change the exclusion terms and save your changes in localStorage.

o3 knocked it out for me in a couple of minutes: https://chatgpt.com/share/68766f42-1ec8-8006-8187-406ef452e0...

Initial prompt was:

  Build a web tool that displays the Hacker
  News homepage (fetched from the Algolia API)
  but filters out specific search terms,
  default to "llm, ai" in a box at the top but
  the user can change that list, it is stored
  in localstorage. Don't use React.
Then four follow-ups:

  Rename to "Hacker News, filtered" and add a
  clear label that shows that the terms will
  be excluded

  Turn the username into a link to
  https://news.ycombinator.com/user?id=xxx -
  include the comment count, which is in the
  num_comments key

  The text "392 comments" should be the link,
  do not have a separate thread link

  Add a tooltip to "1 day ago" that shows the
  full value from created_at

rottc0dd · 8 months ago
Top story: Kiro: new agentic IDE
rottc0dd commented on -2000 Lines of code (2004)   folklore.org/Negative_200... · Posted by u/xeonmc
rottc0dd · 9 months ago
Hi,

I think I have mentioned this before in HN too. I am not from CS background and just learnt the trade as I was doing the job, I mean even the normal stuff.

We have a project that tries reify live objects into human readable form. Final representation is so complicated with lot of types and the initial representation is less complicated.

In order to make it readable, if there is any common or similar data nodes, we have to compare and try to combine them i.e. find places that can be made into methods and find the relevant arguments for all the calls (kind of).

Initial implementation did the transformation into the final form first, and then started the comparison. So, the comparison have to deal with all the different combinations of the types we have in final representation now, which made the whole thing so complex and has been maintained by generation of engineers that nobody had clear idea how it was working.

Then, I read about hashmap implementation later (yep, I am that dumb) and it was a revelation. So, we did following things:

1. We created a hash for skeleton that has to remain the same through all the set of comparisons and transformation of the "common nodes", (it can be considered as something similar to methods or arguments) and doing the comparison for nodes with matching skeletal hashes and

2. created a separate layer that does the comparison and creating common nodes on initial primitive form and then doing the transformation as the second layer (so you don't have to deal with all types in final representation) and

3. Don't type. Yes. Data is simplest abstraction and if your logic can made into data or some properties, please do yourself a favor and make them so. We found lot of places, where weird class hierarchies can be converted into data properties.

Basically, it is a dumb multi pass decompiler.

That did not just speed up the process, but resulted in much more readable and understandable abstractions and code. I do not know, if this is widely useful but it helped in one project. There is no silver bullet, but types were actual problem for us and so we solved it this way.

rottc0dd commented on Human   quarter--mile.com/Human... · Posted by u/surprisetalk
rottc0dd · 10 months ago
I did try to ask are we not computers. I tried to imply, in the fundamental level there are striking similarities to computation.

> That’s not to say that computers couldn’t do what the brain does, including consciousness and emotions,

Yes. Fundamental building blocks are simple and physical in nature and follow the computational aspect good enough to serve as nice approximations

> but that wouldn’t have any particular relation to how DNA/RNA and protein synthesis works.

Hmm... transistors are not neural networks so? I am sorry, I am a non native speaker and maybe I am not communicating things properly. I am trying to say, the organic or human is different manifestation of order - one is chemical and other is electronic. We have emotions and consciousness, but we can agree we are made of cells that send electric pulses to each other and primitive in nature. And even emotions and beliefs are physical in nature (Capgras syndrome for example).

rottc0dd · 10 months ago
> I did try to ask are we not computers.

I meant to say "I did not try to ask are we not computers."

rottc0dd commented on Human   quarter--mile.com/Human... · Posted by u/surprisetalk
TapamN · 10 months ago
IIRC, Gödel, Escher, Bach discusses comparing chromosome/protein generation and computation.
rottc0dd · 10 months ago
You might like Gene: An intimate history[0]. It was really good book.

[0]: https://www.amazon.com/Gene-Intimate-History-Siddhartha-Mukh...

u/rottc0dd

KarmaCake day349September 14, 2020View Original