HNHacker News
TopNewBestAskShowJobs

gjadi

629 karma · joined August 3, 2021

https://omecha.info/blog/

Software Engineer at MicroEJ Currently working on embedded systems/IoT in Java & C. Previously worked on ML & NLP in Java, Python, Common Lisp, C, C++, ...

Homepage: https://omecha.info Email: gjadi@ the homepage domain. LinkedIn: https://www.linkedin.com/in/gr%C3%A9goire-jadi-8988a415b/

https://hnbadges.netlify.app/?user=gjadi

submissionscomments
gjadi··on “Clean” code, horrible performance
I'd say that it really depends on what the code needs to do.

For example, if the code is to be distributed and extended as a third-party library, then the class hierarchy is probably a better fit to allow extensibility.

But if the purpose of the API is to compute the area of given shapes (as in the example), then it makes sense to make it efficient and there is no use to provide extensibility to the outside world.

The advocates of "clean code" that Casey mentions will go for extensibility no matter the use.

I find it very interesting to have numbers to weight what you are leaving when you go the extensibility route instead of the non-pessimistic route.

gjadi··on “Clean” code, horrible performance
I don't understand what you are saying.

My comment was a jest (as suggested by the smiley).

What I take from Casey's post is that a simple non-pessimistic representation allows for efficient code. That is, using a table instead of a class hierarchy gives massive performance boost. Compared to a "clever" loop unrolling doesn't give that much of a boost.

So we need simpler representation. IMHO the table implementation is not less readable nor less flexible than the class hierarchy. But it is less common in the code I am used to, in other words, it's not a widely used pattern).

gjadi··on “Clean” code, horrible performance
I didn't watch the video but I read the article and in the later part he shows how to extend every versions (polymorphic, enum and table-based) to "computing the sum of the corner-weighted areas".

This extension is easy enough with in the non-pessimistic case (table based).

gjadi··on “Clean” code, horrible performance
One can argue that simple code is both fast and clean. However, you can only measure how fast (or slow) your code is, so make it simple, aim for fast and hope it's clean (:
gjadi··on KDE and GNOME seeks $100k to turn Flathub into a Store for the Linux desktop
Like *BSD, with base + ports.
gjadi··on A Lost Hiker’s SOS Signal Sparked a Wildfire. Now He Must Pay $300k
For people more used to the SI system, 230 acre is about 93ha.
gjadi··on Why does 0.1 and 0.2 = 0.30000000000000004?
You can use Herbie to increase the accuracy of your floating point operations.

From the tutorial:

Herbie rewrites floating point expressions to make them more accurate. Floating point arithmetic is inaccurate; even 0.1 + 0.2 ≠ 0.3 for a computer. Herbie helps find and fix these mysterious inaccuracies.

https://herbie.uwplse.org/

gjadi··on The fertilizer shortage will persist in 2023
This kind of robot are already being developed and tested.

See https://www.youtube.com/watch?v=sV0cR_Nhac0 Sniper robot treats 500k plants per hour with 95% less chemicals | Challengers

gjadi··on Ask HN: I'm 40 and feel my mental ability declining. Programming seems harder.
As a lot of other people mentioned here, it's probably have nothing to do with your cognitive abilities, but rather with your emotional state.

Recently, I found out that stressing my body can "reset" my mental and emotional state when I'm in a bad spot (similar to what you described).

I stress my body by doing a physical activity (like running or cycling) or going on a diet (skipping 1 or more lunch). I'm trying to do the opposite of what I feel I want to do (eating more sugar-stuff and doing nothing).

gjadi··on Coinbase cuts staff by a further 20%
I don't have data nor an opinion on this matter, but maybe most FAANGs are successful despite their hiring practice, not because of it.
gjadi··on Read this post ‘unless’ you’re not a Ruby developer
In Common Lisp, there is `unless' and `when' but they don't allow `else' branch.

(when CONDITION BODY)

(unless CONDITION BODY)

The value of the statement is BODY or NIL if it wasn't executed.

I can't remember a time when it wasn't clear (though you can always build usage that are unclear).

gjadi··on Is Dark Mode Good for Your Eyes? (2020)
Changes are good!

Sometime, when I want a change of perspective, I switch to different theme for a couple of days/weeks/months and then change again, and again, and again...

I've noticed just changing the theme can help refocus.

It is a bit like changing the layout of your house to bring changes to your life.

(only it's so much easier with M-x customize-theme)

gjadi··on What's Great about Julia?
What about nim for an alternative to Julia?

(disclaimer: I've used neither of them)

gjadi··on Fast midpoint between two integers without overflow
> A good engineer should know how the computers work, and I don't know why this should be even questioned.

I am not disputing this point, I agree with it.

I am saying there is a difference between knowing int can overflow or knowing that floating point numbers are imprecise, and being attentive when you read `a + b` or `a == b` with float. I believe only experience can teach that (such experience may or should be provided by school).

gjadi··on Tor Browser 12.0
In France, an ONG collect funds to run exit nodes: https://nos-oignons.net/
gjadi··on Fast midpoint between two integers without overflow
I wonder.

IMHE this is the kind of edge that you know only because you've been bitten by a bug once.

It's the same with floating point numbers. You may know that the representation is not absolute, that you can end up with NaN. But I found that I only knew it viscerally after I banged my head on bugs related to these.

Of course, that could be provided by Comp Sci ou Comp Eng curriculum, but time is finite...

In the 5-10% of engineers who saw the problem, how many had experienced it once themselves before?

gjadi··on A homework question in someone’s 11th grade statistics class
It is not critical but I think it is interesting.

For example, I've read Code Complete 2, and while browsing online I found that some of the claims in the book was not solid.

- https://www.sicpers.info/2012/09/an-apology-to-readers-of-te...

- https://www.lesswrong.com/posts/4ACmfJkXQxkYacdLt/diseased-d...

The point made in the above links are interesting but, because I remember reading this particular book, they are sticking more deeply in me.

Also it probably depends heavily on the topic.

For example in economic or philosophy, there are different schools of thoughts and I think it is valuable to know from which school a "fact" is attached to. And before learning about every school, it is probably easier to just remember where you first read it.

This is not critical, but maybe having this information can help you create new insights.

gjadi··on A homework question in someone’s 11th grade statistics class
Yes, thank you for the discussion!
gjadi··on A homework question in someone’s 11th grade statistics class
Yes, rereading the thread, I think I'm going too far.

My main and original point is the following: tests that only test memorization are good on their own ("Tests to help you retain information.").

You need both memorization and understanding to learn. Yes, some tests can improve both; but focusing on only one aspect - here memorization - is fine too.

gjadi··on A homework question in someone’s 11th grade statistics class
On the first part of your post:

We don't have the full test, so maybe the teacher had a preface saying "In the context of book XYZ...". That is what I do when I create flashcards for myself. I specify what knowledge I am testing. We may also assume it was implicit for the students.

I could also imagine that forcing the student to make one choice is a feature, not bug. For example this decision may teach the student that (1) not everything is binary and a single book has no absolute truth, (2) to move forward, you need to make a choice.

Regarding the second part:

> That, to me, is testing information without knowledge.

Memorization vs. Understanding is a false dichotomy. Both are required for proper learning. See https://www.coursera.org/learn/learning-how-to-learn.

gjadi··on A homework question in someone’s 11th grade statistics class
They can but:

- it's more time-consuming to create good evaluation questions.

- it's more time-consuming to provide a nuanced answer.

- it's more time-consuming to evaluate nuanced answers.

If the purpose of the tests is to help students retain the knowledge they've been recently exposed to, then the first kind of tests are more effective. That is, the teacher will be able to provide students with more tests, thus helping them retain more in a shorter amount of time for everyone.

It's a compromise.

gjadi··on A homework question in someone’s 11th grade statistics class
Tests are one of the best technique to retain knowledge. It's called active learning, as opposed to passive learning.

Space Time Repetition systems such as Anki or Mnemosyne or SuperMemo are based on 2 concepts: (1) knowledge fades overtime unless reactivated and (2) asking questions is very effective to activate knowledge

gjadi··on A homework question in someone’s 11th grade statistics class
I used to fully agree with that feeling but not anymore.

IMO they are two kinds of tests:

1. Tests to help you retain information.

2. Tests to evaluate your knowledge.

Assuming this question belongs to the first kind (memorization) and the answer is in a textbook being studied, then this is a good question.

gjadi··on Tell HN: Copying and pasting from ChatGPT unsolicited sucks
I'm probably in the minority, but I prefer C-f through a FAQ rather than writing with a chatbot, trying to explain what I'm looking for.

It probably doesn't help that most of the current chatbots suck like hell (ehlo bank & insurance).

gjadi··on Sign Everything
Nope, I just thought of it because I stumbled on https://news.ycombinator.com/item?id=33855950 yesterday.

So stupid idea because I didn't put a lot of thought in it :)

gjadi··on Sign Everything
Stupid idea for signing: use invisible characters to embed GPG signature (or signify(1) or whatever) inside any text you publish. This way, when the text is copy/pasted, your signature is still attached.

You can even make browser and text editor plugins to make it ubiquitous.

(yes you can make a screenshot, remove invisible chars, etc.)

gjadi··on FreeBSD 12.4
Thanks, I didn't know about capsicum(4) and I completely overlooked the mention of sandboxing in the impact section.
gjadi··on FreeBSD 12.4
Congrats to the team.

I looked briefly at the relnotes[1], there is some scary stuff, such as this vulnerability in ping(1): https://www.freebsd.org/security/advisories/FreeBSD-SA-22:15...

Since a lot of code is shared between BSDs, I wonder if others have the same vulnerabilities.

1: https://www.freebsd.org/releases/12.4R/relnotes/

gjadi··on Emacs should become a Wayland compositor
If you're looking for a minimalist lisp, checkout Shen: https://www.shenlanguage.org/
gjadi··on Memory Safe Languages in Android 13
The usefulness of checklist in medical and the resistance to it is mentioned several times in The Checklist Manifesto.

https://en.wikipedia.org/wiki/The_Checklist_Manifesto

← PreviousPage 5 of 7Next →