# Should Different-Typed Comparisons Be Less Friendly?

**URL:** <https://revolt.metaeducation.com/forum/t/should-different-typed-comparisons-be-less-friendly/1726>\
**Category:** Datatypes\
**Created:** [September 23, 2021, 11:17am UTC](https://revolt.metaeducation.com/forum/t/should-different-typed-comparisons-be-less-friendly/1726 "2021-09-23T11:17:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![hostilefork](https://revolt.metaeducation.com/forum/user_avatar/revolt.metaeducation.com/hostilefork/32/421_2.png) [@hostilefork](https://revolt.metaeducation.com/forum/u/hostilefork)\
**Post date:** [September 23, 2021, 11:17am UTC](https://revolt.metaeducation.com/forum/t/should-different-typed-comparisons-be-less-friendly/1726/1 "2021-09-23T11:17:29Z")

</div>

I've historically been on the side of saying that I don't think it's good for types of different categories to compare equally, e.g. **`<foo> = "foo"`** being true can cause some headaches.

But these headaches can work the other way as well. I just had a bug where I was passing something as a string, but the caller was comparing it as a WORD!.

```
 if info.name = 'startup* [
     ... ; it was a string, so actually "startup*"
 ]

```

This makes me wonder if different-typed comparisons need some distinction in the comparison, to help say that you know the type you're comparing against is completely different.

```
if info.name =T 'startup* [
   ;
   ; ugly example... but imagine =T is a way of saying "I know the type
   ; should be the type on the right (e.g. WORD!), so tell me if it is
   ; not...
]

>> 'foo =T 'bar
== #[false]

>> "foo" =T 'bar
** Error: =T expected a WORD! on the left but got a TEXT!

```

It's always the latest such bug to bite you in languages of this nature that make you wish for stricter typing policies. ☹
