# NPEs are handled differently between instructions

**URL:** <https://forum.makecode.com/t/npes-are-handled-differently-between-instructions/2485>\
**Category:** Arcade\
**Created:** [June 21, 2020, 4:05am UTC](https://forum.makecode.com/t/npes-are-handled-differently-between-instructions/2485 "2020-06-21T04:05:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![felixtsu](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/felixtsu/32/12024_2.png) [@felixtsu](https://forum.makecode.com/u/felixtsu)\
**Post date:** [June 21, 2020, 4:05am UTC](https://forum.makecode.com/t/npes-are-handled-differently-between-instructions/2485/1 "2020-06-21T04:05:54Z")

</div>

Looks like NPEs are handled differently between instructions, some fail silently while some immediately raise a programming error, is it possible a consistent Fail Fast, Fail Early behavior is kept across all instructions?

The following program runs, but sprite cannot be moved with buttons.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/6/6db2556246973ce7e9327cb3ca6a004eaa6decdc.png)

The following program eagerly raise an NPE.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/c/cf233c778f03fe0ee4cc65c8fa9e83cc42eef5d7.png)

---

<div class="post-metadata">

**Author:** ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)\
**Post date:** [June 22, 2020, 4:19pm UTC](https://forum.makecode.com/t/npes-are-handled-differently-between-instructions/2485/2 "2020-06-22T16:19:31Z")

</div>

Could you file this [on github](https://github.com/microsoft/pxt-arcade/issues)?

---

<div class="post-metadata">

**Author:** ![felixtsu](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/felixtsu/32/12024_2.png) [@felixtsu](https://forum.makecode.com/u/felixtsu)\
**Post date:** [June 23, 2020, 4:12am UTC](https://forum.makecode.com/t/npes-are-handled-differently-between-instructions/2485/3 "2020-06-23T04:12:26Z")

</div>

Yup, here it is.

> <https://github.com/microsoft/pxt-arcade/issues/2007>
>
> Describe the bug
> NPEs are handled differently between instructions, some fail silently while some immediately raise a programming error, is it possible...

I’m suggesting the change for it gives the students an immediate feedback on ‘Variables need initialization before usage’ violation, which is mentioned in [2016 MA Digital Literacy and Computer Science Curriculum](https://campussuite-storage.s3.amazonaws.com/prod/1558554/bd663f84-57ae-11e8-92d9-124581a691ce/1804101/9908dc9e-8ff0-11e8-9b47-127584b34f70/file/3-5_DLCS.pdf).

 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/d/df9a27e6908aa45b488cfd0f1ea3e6cf39fa1515.png)
