DOI: https://doi.org/10.1038/s41598-026-50946-9
PMID: https://pubmed.ncbi.nlm.nih.gov/42225689
تاريخ النشر: 2026-06-01
المؤلف: Annabelle Bergum وآخرون
الموضوع الرئيسي: علم الأعصاب للغة ثنائية اللغة
نظرة عامة
تبحث هذه الدراسة في الآليات العصبية المعرفية التي تكمن وراء معالجة المبرمجين لأنماط الشيفرة المربكة، والتي تُسمى “ذرات الارتباك”. باستخدام إمكانات مرتبطة بالتثبيت (FRPs)، تكشف الدراسة أن هذه الشيفرة المربكة تثير إيجابية جبهية متأخرة (400 إلى 700 مللي ثانية) عند مقارنتها بالشيفرة الأكثر وضوحًا. هذه الاستجابة مشابهة لمكون إمكانات مرتبطة بالحدث (ERP) التي تُلاحظ في معالجة اللغة الطبيعية، والتي تحدث ردًا على كلمات غير متوقعة ولكنها معقولة سياقيًا.
تشير النتائج إلى أن العمليات المعرفية المعنية في تفسير الشيفرة البرمجية المربكة مشابهة لتلك المستخدمة في فهم اللغة الطبيعية، حيث يتطلب كلاهما تحديث نموذج الوضع للمستوعب لاستخراج المعلومات بشكل فعال. تعزز هذه الدراسة فهمنا لعلم الإدراك البرمجي، كما تبرز الفرص المحتملة بين هندسة البرمجيات وعلم النفس اللغوي.
الطرق
في هذه الدراسة، بحث الباحثون في تأثير نوع المقتطفات على نتائج معرفية وسلوكية متنوعة. تم تصنيف المتغير المستقل إلى حالتين: “مربكة” و”نظيفة”. لتقييم تأثير هذه الحالات، تم قياس عدة متغيرات تابعة، بما في ذلك وقت الفهم، صحة الإجابات، تقييمات الصعوبة الذاتية، حركات العين التي تتبعها جهاز تتبع العين، ونشاط الدماغ الذي تم مراقبته من خلال نظام EEG. كانت هذه القياسات تهدف إلى تقديم فهم شامل لكيفية تأثير وضوح المقتطفات على المعالجة المعرفية والأداء.
النتائج
في هذه الدراسة، نقدم أول تحليل لتصوير الرنين الوظيفي (FRP) يركز على فهم البرنامج، مع التركيز بشكل خاص على الاستجابات العصبية لعناصر الشيفرة المربكة. تشير نتائجنا إلى أن الشيفرة المربكة تولد إيجابية جبهية ملحوظة في الإمكانات المرتبطة بالحدث (ERP) بين 390 و660 مللي ثانية بعد التثبيت الأول على الجزء المربك، مما يتناقض مع الشيفرة النظيفة. هذا المكون مشابه للإيجابية الجبهية المتأخرة التي تُلاحظ في معالجة اللغة الطبيعية، والتي ترتبط بتحديث معرفي لنموذج الوضع استجابةً لمدخلات غير متوقعة ولكنها معقولة.
تؤكد التحليلات السلوكية، باستخدام نماذج الانحدار المختلط العام (GLMER)، هذه النتائج العصبية. تكشف البيانات أن فهم مقتطفات الشيفرة المربكة يتطلب وقتًا أطول، ويؤدي إلى إجابات صحيحة أقل، وكان يتم تقييمه بشكل أقل تكرارًا على أنه سهل مقارنةً بالشيفرة النظيفة. على وجه التحديد، كان متوسط وقت الفهم لمقتطفات الشيفرة المربكة 12.2 ثانية، مقارنةً بـ 11.2 ثانية للشيفرة النظيفة، مع وجود فرق ملحوظ (p < 0.001). بالإضافة إلى ذلك، كانت دقة الإجابات للشيفرة النظيفة 88%، بينما حققت المقتطفات المربكة أداءً أقل، مما يبرز التأثير الضار للارتباك على فهم البرنامج. النتائج الإحصائية التفصيلية متاحة في المعلومات التكميلية، الملحق C.
المناقشة
تسلط قسم المناقشة في الدراسة الضوء على تطبيق نهج الإمكانات المرتبطة بالتثبيت (FRP) للتحقيق في العمليات العصبية المعرفية المعنية في قراءة الشيفرة البرمجية المربكة، مع التركيز بشكل خاص على “ذرات الارتباك”. تكشف النتائج أن الشيفرة المربكة تثير إيجابية جبهية متأخرة ملحوظة، يمكن ملاحظتها بعد حوالي 400 مللي ثانية من التثبيت الأول على المنطقة التي تحتوي على ذرة الارتباك. هذا المكون مشابه للإيجابيات الجبهية المتأخرة التي تم تحديدها في معالجة اللغة الطبيعية، مما يشير إلى أن آليات معرفية مشابهة تُستخدم عند معالجة عناصر غير متوقعة ولكنها معقولة في كلا المجالين. تفترض الدراسة أن الإيجابية الجبهية المتأخرة تعكس معالجة عدم تطابق التوقعات، حيث يؤدي عدم اليقين الأولي بشأن تأثير الذرة على تنفيذ البرنامج إلى استرجاع من الذاكرة طويلة المدى، مما يسمح للمستوعب بتحديث نموذج وضعه بثقة.
تمتلك النتائج آثارًا أوسع على هندسة البرمجيات، مما يشير إلى أن فهم كيفية معالجة المبرمجين للشيفرة المربكة يمكن أن يُعلم تقاليد الترميز وتصميم اللغة لتقليل الارتباك. علاوة على ذلك، تؤكد الدراسة على الإمكانية لدمج النتائج من أبحاث فهم البرنامج مع المنهجيات المعتمدة في معالجة اللغة الطبيعية، مما يعزز الصلاحية البيئية للدراسات المستقبلية. يدعو المؤلفون إلى مزيد من البحث لاستكشاف الظروف التي تظهر فيها الإيجابية الجبهية المتأخرة، خاصة فيما يتعلق بقدرة المستوعب على حل الغموض وتحديث نموذج وضعه بشكل فعال.
DOI: https://doi.org/10.1038/s41598-026-50946-9
PMID: https://pubmed.ncbi.nlm.nih.gov/42225689
Publication Date: 2026-06-01
Author(s): Annabelle Bergum et al.
Primary Topic: Neurobiology of Language and Bilingualism
Overview
This research investigates the neurocognitive mechanisms underlying programmers’ processing of confusing code patterns, termed “atoms of confusion.” Utilizing fixation-related potentials (FRPs), the study reveals that such confusing code elicits a late frontal positivity (400 to 700 ms) when compared to clearer code. This response is analogous to an event-related potential (ERP) component observed in natural language processing, which occurs in reaction to unexpected yet contextually plausible words.
The findings suggest that the cognitive processes involved in interpreting confusing program code are similar to those used in understanding natural language, as both require updating a comprehender’s situation model for effective information extraction. This research not only enhances our understanding of programming cognition but also highlights potential interdisciplinary opportunities between software engineering and psycholinguistics.
Methods
In this study, the researchers investigated the effects of snippet type on various cognitive and behavioral outcomes. The independent variable was categorized into two conditions: “confusing” and “clean” snippets. To assess the impact of these conditions, several dependent variables were measured, including comprehension time, answer correctness, subjective difficulty ratings, eye movements tracked by an eye tracker, and brain activity monitored through an EEG system. These measurements aimed to provide a comprehensive understanding of how snippet clarity influences cognitive processing and performance.
Results
In this study, we present the first functional resonance imaging (FRP) analysis focused on program comprehension, specifically examining the neural responses to confusing code elements. Our findings indicate that confusing code generates a significant frontal positivity in the event-related potential (ERP) between 390 and 660 ms following the initial fixation on the confusing segment, contrasting with clean code. This component is analogous to the late frontal positivity observed in natural language processing, which is associated with the cognitive updating of a situation model in response to unexpected yet plausible inputs.
Behavioral analyses, utilizing general linear mixed-effects regression (GLMER) models, corroborate these neural findings. The data reveal that comprehension of confusing code snippets required more time, resulted in fewer correct answers, and was less frequently rated as easy compared to clean code. Specifically, the average comprehension time for confusing snippets was 12.2 seconds, compared to 11.2 seconds for clean code, with a significant difference (p < 0.001). Additionally, the accuracy of responses for clean code was 88%, while confusing snippets yielded a lower performance, further emphasizing the detrimental impact of confusion on program comprehension. Detailed statistical results are available in the supplementary information, Appendix C.
Discussion
The discussion section of the study highlights the application of a fixation-related potential (FRP) approach to investigate the neurocognitive processes involved in reading confusing program code, specifically focusing on “atoms of confusion.” The findings reveal that confusing code elicits a significant late frontal positivity, observable approximately 400 ms after the first fixation on the area containing the atom of confusion. This component is analogous to late frontal positivities identified in natural language processing, suggesting that similar cognitive mechanisms are engaged when processing unexpected but plausible elements in both domains. The study posits that the late frontal positivity reflects expectancy mismatch processing, where initial uncertainty about the atom’s effect on program execution prompts retrieval from long-term memory, allowing the comprehender to update their situation model confidently.
The results have broader implications for software engineering, indicating that understanding how programmers process confusing code can inform coding conventions and language design to minimize confusion. Furthermore, the study emphasizes the potential for integrating findings from program comprehension research with established methodologies in natural language processing, thereby enhancing the ecological validity of future studies. The authors advocate for further research to explore the conditions under which the late frontal positivity appears, particularly in relation to the comprehender’s ability to resolve ambiguity and update their situation model effectively.
