# \[BSL\] Would it be considered bad practice to name custom function with the same pattern as selectors?

**URL:** <https://racket.discourse.group/t/bsl-would-it-be-considered-bad-practice-to-name-custom-function-with-the-same-pattern-as-selectors/1251>\
**Category:** Questions & Answers\
**Tags:** question\
**Created:** [August 23, 2022, 10:26pm UTC](https://racket.discourse.group/t/bsl-would-it-be-considered-bad-practice-to-name-custom-function-with-the-same-pattern-as-selectors/1251 "2022-08-23T22:26:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jgomo3](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/jgomo3/32/496_2.png) [@jgomo3](https://racket.discourse.group/u/jgomo3)\
**Post date:** [August 23, 2022, 10:26pm UTC](https://racket.discourse.group/t/bsl-would-it-be-considered-bad-practice-to-name-custom-function-with-the-same-pattern-as-selectors/1251/1 "2022-08-23T22:26:42Z")

</div>

I'm reading How to Design Programs.  
This question is about the Beginning Student Language.

Doing the exercise of the Graphical Editor, we define an structure like this:

```nohighlight
(define-struct editor [pre post])

```

Which implies the following selectors:

- `editor-pre`
- `editor-post`

So I was attempting to do the exersice 87 where basically we have to repeat the development of the graphical editor.

The new structure is:

```nohighlight
(define-struct editor [text cursor])

```

So we don't have in this case the selectors `editor-pre` and `editor-post`, so I could create a function called `editor-pre` if I want (which is the case 😃 ).

But I'm wondering if that is bad practice, making it more difficult future extensions to the editor structure, i.e. I couldn't rewrite it easily like:

```nohighlight
(define-struct editor [text cursor pre])

```

(For whatever reason).

---

<div class="post-metadata">

**Author:** ![EmEf](https://avatars.discourse-cdn.com/v4/letter/e/53a042/32.png) [@EmEf](https://racket.discourse.group/u/EmEf)\
**Post date:** [August 24, 2022, 12:08am UTC](https://racket.discourse.group/t/bsl-would-it-be-considered-bad-practice-to-name-custom-function-with-the-same-pattern-as-selectors/1251/2 "2022-08-24T00:08:02Z")

</div>

The point of the exercise is to understand how different choices of data representation affect your programming. Changing the data representation (struct plus interpretation) would defeat the goal.
