Загрузка страницы

Justified Programming — Reason Parameters That Answer “Why”

Programmers usually bark commands at computers. Never does the computer ask “why”, and never does the programmer explain themselves. What if we did? Annotate the purpose of your function calls. It may save your day!

This is one of my few lessons that is not tied to any particular programming language. I do use C and C++ in these examples, but it would work just as well in nearly any other programming language.

Twitter: https://twitter.com/RealBisqwit
Liberapay: https://liberapay.com/Bisqwit (alternatives at https://iki.fi/bisqwit/donate.html)
Twitch: https://twitch.tv/RealBisqwit
Homepage: https://iki.fi/bisqwit/

You can contribute subtitles/captions at: https://www.youtube.com/timedtext_video?v=OrQ9swvm_VA Or to any video on my channel at:
https://www.youtube.com/timedtext_cs_panel?tab=2&c=UCKTehwyGCKF-b2wo0RKwrcg

Music:
- Tales of Phantasia :: Retaliation :: Motoi Sakuraba (converted into MIDI and played through OPL3 emulation through homebrew software)
- Famicom Tantei Club Part II: Ushiro ni Tatsu Shōjo :: Dean’s Room :: Kenji Yamamoto (SPC-OPL3 conversion)¹
- Onita Atsushi FMW :: Staff Roll (SPC-OPL3 conversion)

¹) This is probably an adaptation from a concert/fugue/toccata/something by Bach. If you are someone who knows classical music and you recognize this song, please clarify this in the comments! You can listen to the full song at: https://www.youtube.com/watch?v=Xa61vkTf3Vw
The first song can be listened here: https://www.youtube.com/watch?v=Ey10UDi1liE

ERRATA
There is a typo in the strchr code shown at 1:20, my bad! The (~0ul - 1) should be just ~0ul. Coincidentally it does not cause the function to return incorrect values, it just tanks the performance. Without the bug, the dummied out code is 50% faster than the short code, but with the bug, it is 50% slower instead. Note that the SIMD-optimized assembler-coded strchr in glibc for x86_64 is still almost four times faster than the corrected code.
But there is also an actual bug in the strchr code on screen, that causes it to return incorrect values. Can you spot it?

#Bisqwit #Programming #ProgrammingPhilosophy #SelfDocumentingCode

Видео Justified Programming — Reason Parameters That Answer “Why” канала Bisqwit
Показать
Комментарии отсутствуют
Введите заголовок:

Введите адрес ссылки:

Введите адрес видео с YouTube:

Зарегистрируйтесь или войдите с
Информация о видео
10 августа 2017 г. 23:36:13
00:10:11
Яндекс.Метрика