mononcqc, avatar

Good blog post from the team on optimizations coming in Erlang/OTP 27:

henrikjernevad, avatar

Why should you unit test? What should you unit test? And how much?

Today's blog post answers these questions and provides some helpful guidelines.

The post is actually a lightly edited extract of a book on unit testing that I started about 10 years ago but never finished. Still, it has aged reasonably well.

underlap, avatar

@henrikjernevad I really enjoyed your post and thought it deserved a response.

bluGill avatar

@henrikjernevad Every test you listed there is the type that should be deleted when you are done.

Which is to say you are missing something critical: to ensure when someone in the future makes a change they don't introduce bugs. Any test that will never alert you to a bug in your code by failing should not be kept. (that is about 80% of all tests, but I don't know how to figure out the difference)


I think some of the early designers of languages will burn in hell for making the index of the first element in a list/array/vector be 0....

yeti, avatar


For someone who had assembler as 1st language 0 as offset from the array base address to the array's first member makes the most sense.
I'm one of these fossils.

davidbisset, avatar

Developers you cannot complain about debugging your code unless you work at NASA. New rule.

vascorsd, avatar

After hearing good things about scalatags, reading the readme I almost walked away when I saw the changelog with latest version being 0.7.0 adding support for scala 2.13. I was literally thinking it was dead and nobody worked on it for 3 for example... 😮‍💨

Well turns out that if you open github you see that it actually was tagged a version 0.13.1 and the changelog hidden in a file is getting updated.

But the official docs website doesn't have any recent updates! 😨

Always check the code!

alexelcu, avatar

@vascorsd I like using Scaladex because finding the latest library versions can be challenging, as there's no standard (GitHub vs. homepage, README vs. tags vs. releases on GitHub).

vascorsd, avatar

@alexelcu true, very true. It's highly inconsistent where to find the latest release and also the changelog.

I'll have to keep in mind to check it, since it never crosses my mind.

joelanman, avatar

has anyone used Jest and Knex in Node? I've been banging my head against this issue for ages, and googling gets me nowhere. I just get Unable to acquire a connection every time.

My actual code works fine, it's just in Jest that it fails.

joelanman, avatar

sigh, I wasn't using dotenv correctly with Jest, you have to add it to the config like this:

setupFiles: ["dotenv/config"]  
AverageDog, avatar

This may very well be the most useless book I have ever written, and I don't even know why I did. I guess it is still better than getting drunk in a bar.
Anyway, it defines the #T3X programming language formally in terms of basic functions (zero, successor, identity, mu) and naive set theory. I have no idea why anybody would read such a book. Maybe you can give me some hints? :)
Or, in case you want to prove me wrong:
#programming, #semantics, #math, #futility

nil, avatar

@AverageDog this was an immediate purchase!

nilesh, avatar

Have a strong urge to invent a new cloud-native, AI-native, dependent-typed language.

nilesh, avatar

@deshipu I don't want to live in a world where Python and Javascript are our default choices. 😃

deshipu, avatar

@nilesh Could have been worse, could be CGI in C++ and Java applets.

joelanman, avatar

I'm using Playwright to do end to end testing and very happy with it. How do I now add unit testing? Googling isnt giving very useful results. I'm imagining something like

npm test  

triggering Jest, then Playwright, but they both look for test.js files so that seems not correct?

Can/should Playwright be used for unit testing?

floehopper, avatar

@joelanman I'm using Playwright's testDir config option to limit the tests it runs to a specific directory:

And similarly using the Jest CLI to point at the unit test directory:

I've wrapped them both up in scripts in package.json and called them from the test script.

joelanman, avatar

@floehopper perfect thanks!

bits, avatar

My definition of an expert in any field is a person who knows enough about what’s really going on to be scared.

-- P. J. Plauger, Computer Language, March 1983

ดูหนัง! Exhuma (ขุดมันขึ้นมาจากหลุม 2024) ออนไลน์ฟรี HD พากย์ไทย [TV-THAI] พากย์ไท 1080p ( Indonesian

ดูหนัง! Exhuma (ขุดมันขึ้นมาจากหลุม 2024) ออนไลน์ฟรี HD พากย์ไทย [TV-THAI] พากย์ไท 1080p ดู>[หนัง] ขุดมันขึ้นมาจากหลุม | Exhuma (2024) พาก ไทย –...

davemark, avatar


  • BRAND NEW edition of "Programming: Principles and Practice Using C++"
  • This is the guy who created C++
#Programming #Development #C #CPlusPlus

davemark, avatar

@Drwave 😄

Fan of C++ or not, as a long time dev book writer, it warms my heart to see this book still have life.

Drwave, avatar

@davemark Fair.

dentangle, avatar

What a frustrating little bug! 🐞 Fine on Linux, FreeBSD and OpenBSD - failing on NetBSD only.

I was convinced it was some weird memory ordering bug or perhaps something to do with NetBSD using gcc instead of clang. After digging through the asm and finding nothing I was tearing my beard out.

The actual problem? A usleep() in a test.

On the argument to usleep() must be less than 1,000,000µs. It was, in fact, exactly 1,000,000 == 1sec.



riastradh, avatar

@dentangle Before it was removed from POSIX, the specification in 2004 explicitly forbid arguments >=1e6:

> The useconds argument shall be less than one million.

And listed EINVAL for this case:

> The time interval specified one million or more microseconds.

sqlite3 had this bug too:

But maybe at this point it's not worth keeping that persnickety quirk in NetBSD. So I filed a PR to reconsider it:

jspath55, avatar

@riastradh @dentangle "nobody expects the Spanish usleepition"‐-nice one.

atoponce, avatar

Writing good code > your choice of IDE


vwbusguy, avatar

@atoponce Having a clean git repo > your favorite IDE Indonesian

dentangle, avatar

Modern Stoneage Debugging

Debuggers are great and they have their place, but never underestimate the power of simply printing "Barney was here" when tracing code.

Barney often needs some help from Wilma and Betty and his mate Fred, but if you have to bring out Dino and Bam Bam it's probably gone wrong. Maybe you should put the Flintstones away and break out that debugger now. 😉

Important: don't forget to remove them before deploying into production.

🦖 + 🧑‍💻 => 😀

revk, avatar

@dentangle yes, don’t forget to remove them….

Xem Phim Mai Vietsub 2024 Full HD-4K - Bio Site ( Indonesian

Xem Phim Mai Vietsub 2024 Full HD-4K · Xem Phim Mai(2024) Vietsub Thuyết Minh Trọn Bộ. Phim Mai(2024) Vietsub HD. Maixoay quanh câu chuyện về anh chàng cảnh sát Mai(2024) là một nhân vật đến từ bộ phim hoạt hình Toy Story nổi tiếng. 【Xem phim】Mai「Full HD Vietsub」Bộ phim đầy đủ...

codebyjeff, avatar

If you're one of those programmers who leaves out any vertical whitespace between functions or blocks of code

wtf is it that motivates you?

kboyd, avatar

@codebyjeff they must save so many kilobytes per file in newline characters

syntaxseed, avatar

@codebyjeff And here I am sprinkling in extra blank lines like they're chapter breaks or something. 😆

I like lots of space for visual grouping.

SergKoren, avatar

I think I want to get back into BeOS/Haiku. Why? Why not? Maybe I’m feeling nostalgic.

#programming #os #beos #haiku

eugenialoli, avatar

@SergKoren Love it too, but it's not ready. Many bugs with usb support, and it can't sleep.

SergKoren, avatar

@eugenialoli Minor problems. I don't want to use it as a daily OS, but more for programming/development.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • programming
  • rosin
  • Backrooms
  • GTA5RPClips
  • magazineikmin
  • mdbf
  • Youngstown
  • slotface
  • tacticalgear
  • hgfsjryuu7
  • Durango
  • ngwrru68w68
  • kavyap
  • InstantRegret
  • DreamBathrooms
  • provamag3
  • thenastyranch
  • cisconetworking
  • tester
  • cubers
  • modclub
  • khanakhh
  • everett
  • ethstaker
  • Leos
  • normalnudes
  • osvaldo12
  • anitta
  • JUstTest
  • All magazines