Giter Club home page Giter Club logo

Comments (19)

edvin avatar edvin commented on May 13, 2024

To get rid of the null check you would declare it as lateinit var myButton: Button. That doesn't ensure you don't reassign it though, and lateinit is sadly disallowed on val. Your solution would prevent that, at the cost of synchronization.

I see the value in this, but I think the most annoying bit is the null check, and that's easily avoided. On the other hand, I can't see any harm in adding it, it's up to the user to use it :)

from tornadofx.

thomasnield avatar thomasnield commented on May 13, 2024

I did not know about lateinit modifier and you are right, that solves most of the problem. You could also make the setter private, but that could be verbose. In a multithreaded application, would you still in theory need a volatile modifier on any var property?

I'm a bit biased towards immutability and I was surprised there wasn't a feature like this already in Kotlin library.

Would you see value in making synchronized and non-synchronized versions, just like lazy()?

from tornadofx.

edvin avatar edvin commented on May 13, 2024

You're right, and an immutable single assign property could be useful to avoid certain bugs related to builders. I think it would make sense to implement sync/non-sync in the same manner as lazy, good call. Will you give it a crack? (I won't be able to get much done before next week myself).

from tornadofx.

thomasnield avatar thomasnield commented on May 13, 2024

For sure, I'd love to.

from tornadofx.

thomasnield avatar thomasnield commented on May 13, 2024

And if you need helping document this stuff before next release please let me know. I'm a writer so I kind of like those tasks.

from tornadofx.

edvin avatar edvin commented on May 13, 2024

Cool! I'd love some help with documentation. My english isn't all that good, so it would be a great improvement if you'd get involved there as well! I granted you collaborator access to the project now, I think you should be able to edit the wiki directly.

With each release I plan on adding documentation for all the entries in the changelog, including builder examples for all new builders, and some notes where needed, like the vbox thing on the borderpane builder etc.

If you'd give it a go, I'll be forever grateful :) In the meantime, I'll look for forum software, preferably something with github integration.

from tornadofx.

thomasnield avatar thomasnield commented on May 13, 2024

Thanks! I'll definitely help out where I can. In a warped way, I like technical writing. It relaxes me. One of my "documentation projects" without any planning became a book, so this is down my alley.

from tornadofx.

edvin avatar edvin commented on May 13, 2024

Wow! That's so cool. That's the ultimate goal - a book for TornadoFX :) hehe

from tornadofx.

thomasnield avatar thomasnield commented on May 13, 2024

haha! Who knows we might get there, and we will be electing an animal for the cover before you know it.

from tornadofx.

edvin avatar edvin commented on May 13, 2024

Long term plan - check! :)

from tornadofx.

edvin avatar edvin commented on May 13, 2024

Your book looks really nice, btw. What software did you use to write it? Was it hard/expensive to get it published?

from tornadofx.

thomasnield avatar thomasnield commented on May 13, 2024

Thanks! I wrote it in Word but in hindsight I wish I used a Markdown editor. It cost me nothing other than my time and energy which was not bad since I like writing. O'Reilly picked up all the expenses and provided a great editor.

Richard Hipp (creator of SQLite) randomly reached out to me on Twitter and joined the project too, which was enormously helpful since the book uses SQLite heavily for the hands-on stuff.

I wrote the first draft as a guide to help unemployed business professionals in the Dallas area. The other volunteers insisted I publish it, and I'm really glad they talked me into it.

from tornadofx.

edvin avatar edvin commented on May 13, 2024

Interesting... When the framework has matured a little and we have tested all concepts more thoroughly I'd like to discuss this further with you :)

from tornadofx.

thomasnield avatar thomasnield commented on May 13, 2024

Sure! I look forward to it : )

from tornadofx.

thomasnield avatar thomasnield commented on May 13, 2024

FYI, there is a very similar proposal to implement something like singleAssign() into Kotlin officially. Feel free to upvote!

from tornadofx.

edvin avatar edvin commented on May 13, 2024

Cool :) Just voted!

from tornadofx.

edvin avatar edvin commented on May 13, 2024

.. and saw your comment :))

from tornadofx.

thomasnield avatar thomasnield commented on May 13, 2024

I'm a sucker for product placement haha

from tornadofx.

edvin avatar edvin commented on May 13, 2024

Haha 👍

from tornadofx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.