Live data from Hacker News

Code is cheap. Show me the talk

nadh.in

151–160 of 237 posts

Re: Code is cheap. Show me the talk

#151
post #139

Earlier quoted context omitted.

I believe this is conflating abstraction with encapsulation. The former is about semantic levels, the later about information hiding.

Maybe I am? How is it possible to abstract without encapsulation? And also, how is it possible to encapsulate without abstracting some concept (intentionally or not) contained in that encapsulation? I can't really differentiate them, in the context of naming/referencing some list of CPU operations.

> How is it possible to abstract without encapsulation.

Historically pure machine code with jumps etc lacked any from of encapsulation as any data can be accessed and updated by anything.

However, you would still use abstractions. If you pretend the train is actually going 80.2 MPH instead of somewhere between 80.1573 MPH to 80.2485 MPH which you got from different sensors you don’t need to do every calculation that follows twice.

Re: Code is cheap. Show me the talk

#152

I asked Codex to write some unit tests for Redux today. At first glance it looked fine, and I continued on. I then went back to add a test by hand, and after looking more closely at the output there were like 50 wtf worthy things scattered in there. Sure they ran, but it was bad in all sorts of ways. And this was just writing something very basic. This has been my experience almost every time I use AI: superficially…

This is how you do things if you are new to this game.

Get two other, different, LLMs to thoroughly review the code. If you don’t have an automated way to do all of this, you will struggle and eventually put yourself out of a job.

If you do use this approach, you will get code that is better than what most software devs put out. And that gives you a good base to work with if you need to add polish to it.

Re: Code is cheap. Show me the talk

#153

Earlier quoted context omitted.

Best example of this is Claude's own terminal program. Apparently renders react at 60fps and then translates it into ANSI chars that then diff the content of the terminal and do an overwrite... All to basically mimic what curses can do very easily.

This is the fun part of whole AI-built things that a lot of people don’t want to accept - it really, really, really does not matter if the code “nice, maintainable and etc.”. Does it work? Is it somewhat extendable with AI? Are users generally happy and adoption rate is high? That’s it.

If you have high time preference yes. Over longer time horizons I think the issues with vibe coded software will reveal themselves in the same way badly written software does.

Re: Code is cheap. Show me the talk

#154

I asked Codex to write some unit tests for Redux today. At first glance it looked fine, and I continued on. I then went back to add a test by hand, and after looking more closely at the output there were like 50 wtf worthy things scattered in there. Sure they ran, but it was bad in all sorts of ways. And this was just writing something very basic. This has been my experience almost every time I use AI: superficially…

I've always said every line is a liability, its our job to limit liabilities. That has largely gone out the window these days.

No code is as easy to maintain as no code.

No code runs as fast as no code.

Re: Code is cheap. Show me the talk

#155
post #151
post #139

Earlier quoted context omitted.

Maybe I am? How is it possible to abstract without encapsulation? And also, how is it possible to encapsulate without abstracting some concept (intentionally or not) contained in that encapsulation? I can't really differentiate them, in the context of naming/referencing some list of CPU operations.

> How is it possible to abstract without encapsulation. Historically pure machine code with jumps etc lacked any from of encapsulation as any data can be accessed and updated by anything. However, you would still use abstractions. If you pretend the train is actually going 80.2 MPH instead of somewhere between 80.1573 MPH to 80.2485 MPH which you got from different sensors you don’t need to do every calculation that…

I'm using the industry definition of abstraction [1]:

> In software, an abstraction provides access while hiding details that otherwise might make access more challenging

I read this as "an encapsulation of a concept". In software, I think it can be simplified to "named lists of operations".

> Historically pure machine code with jumps etc lacked any from of encapsulation as any data can be accessed and updated by anything.

Not practically, by any stretch of the imagination. And, if the intent is to write silly code, modern languages don't really change much, it's just the number of operations in the named lists will be longer.

You would use calls and returns (or just jumps if not supported), and then name and reference the resulting subroutine in your assembler or with a comment (so you could reference it as "call 0x23423 // multiply R1 and R2"), to encapsulate the concept. If those weren't supported, you would use named macros [2]. Your assembler would used named operations, sometimes expanding to multiple opcodes, with each opcode having a conceptually relevant name in the manual, which abstracted a logic circuit made with named logic gates, consisting of named switches, that shuffled around named charge carriers. Say your code just did a few operations, the named abstraction for the list of operations (which all these things are) there would be "blink_light.asm".

> If you pretend the train is actually going 80.2 MPH instead of somewhere between 80.1573 MPH to 80.2485 MPH which you got from different sensors you don’t need to do every calculation that follows twice.

I don't see this as an abstraction as much as a simple engineering compromise (of accuracy) dictated by constraint (CPU time/solenoid wear/whatever), because you're not hiding complexity as much as ignoring it.

I see what you're saying, and you're probably right, but I see the concepts as equivalent. I see an abstraction as a functional encapsulation of a concept. An encapsulation, if not nonsense, will be some meaningful abstraction (or a renaming of one).

I'm genuinely interested in an example of an encapsulation that isn't an abstraction, and an abstraction that isn't a conceptual encapsulation, to right my perspective! I can't think of any.

[1] https://en.wikipedia.org/wiki/Abstraction_(computer_science)

[2] https://www.tutorialspoint.com/assembly_programming/assembly...

Re: Code is cheap. Show me the talk

#156
post #142

Earlier quoted context omitted.

> My theory is that this is a source of diverging views on LLMs for programming: people who see programming languages as tools for thought compared to people who see programming languages as, exclusively, tools to make computers do stuff. It's no surprise that the former would see more value in programming qua programming, while the latter are happy to sweep code under the rug. i'd postulate this: most people see llm…

Most people? I'd suggest few people see LLMs as tools for thought and more that they're slop machines being cynically forced upon workers by capitalists with dollar signs in their eyes. Over and over and over again we see real-world studies showing that the people far more excited about genAI are managers than the people doing the actual work.

i mean - i think people recognize that they are pattern matching tools. pattern matching is useful for thinking.

Re: Code is cheap. Show me the talk

#158

I asked Codex to write some unit tests for Redux today. At first glance it looked fine, and I continued on. I then went back to add a test by hand, and after looking more closely at the output there were like 50 wtf worthy things scattered in there. Sure they ran, but it was bad in all sorts of ways. And this was just writing something very basic. This has been my experience almost every time I use AI: superficially…

This is how you do things if you are new to this game. Get two other, different, LLMs to thoroughly review the code. If you don’t have an automated way to do all of this, you will struggle and eventually put yourself out of a job. If you do use this approach, you will get code that is better than what most software devs put out. And that gives you a good base to work with if you need to add polish to it.

Im sick and tired of these empty posts.

SHOW AN EXAMPLE OF YOU ACTUALLY DOING WHAT YOU SAY!

Re: Code is cheap. Show me the talk

#159
post #155
post #151

Earlier quoted context omitted.

> How is it possible to abstract without encapsulation. Historically pure machine code with jumps etc lacked any from of encapsulation as any data can be accessed and updated by anything. However, you would still use abstractions. If you pretend the train is actually going 80.2 MPH instead of somewhere between 80.1573 MPH to 80.2485 MPH which you got from different sensors you don’t need to do every calculation that…

I'm using the industry definition of abstraction [1]: > In software, an abstraction provides access while hiding details that otherwise might make access more challenging I read this as "an encapsulation of a concept". In software, I think it can be simplified to "named lists of operations". > Historically pure machine code with jumps etc lacked any from of encapsulation as any data can be accessed and updated by any…

> I can't think of any.

Incorrect definition = incorrect interpretation. I edited this a few times but the separation is you can use an abstraction even if you maintain access to the implementation details.

> assembler

Assembly language which is a different thing. Initially there was no assembler, someone had to write one. In the beginning every line of code had direct access to all memory in part because limited access required extra engineering.

Though even machine code itself is an abstraction across a great number of implementation details.

> I don't see this as an abstraction as much as a simple engineering compromise (of accuracy) dictated by constraint (CPU time/solenoid wear/whatever), because you're not hiding complexity as much as ignoring it.

If it makes you feel better consider the same situation with 5 senators X of which have failed. The point is you don’t need to consider all information at every stage of a process. Instead of all the underlying details you can write code that asks do we have enough information to get a sufficiently accurate speed? What is it?

It doesn’t matter if the code could still look at the raw sensor data, you the programmer prefer the abstraction so it persists even without anything beyond yourself enforcing it.

IE: “hiding details that otherwise might make access more challenging”

You can use TCP/IP or anything else as an abstraction even if you maintain access to the lower level implementation details.

Re: Code is cheap. Show me the talk

#160
post #158

Earlier quoted context omitted.

This is how you do things if you are new to this game. Get two other, different, LLMs to thoroughly review the code. If you don’t have an automated way to do all of this, you will struggle and eventually put yourself out of a job. If you do use this approach, you will get code that is better than what most software devs put out. And that gives you a good base to work with if you need to add polish to it.

Im sick and tired of these empty posts. SHOW AN EXAMPLE OF YOU ACTUALLY DOING WHAT YOU SAY!

these two posts (the parent and then the OP) seem equally empty?

by level of compute spend, it might look like:

- ask an LLM in the same query/thread to write code AND tests (not good)

- ask the LLM in different threads (meh)

- ask the LLM in a separate thread to critique said tests (too brittle, testing guidelines, testing implementation and not out behavior, etc). fix those. (decent)

- ask the LLM to spawn multiple agents to review the code and tests. Fix those. Spawn agents to critique again. Fix again.

- Do the same as above, but spawn agents from different families (so Claude calls Gemini and Codex).

—-

these are usually set up as /slash commands like /tests or /review so you aren’t doing this manually. since this can take some time, people might work on multiple features at once.

Post reply on HN