Jun 16 | 8:20 AM |
Mark M. | has entered the room |
Jun 16 | 8:25 AM |
Mark M. | turned on guest access |
Kai H. | has entered the room |
Kai H. |
Hello
|
Mark M. |
sorry for the delay -- hello!
|
Mark M. |
how can I help you today?
|
Jun 16 | 8:30 AM |
Kai H. |
When importing an SVG into Android, can't I load it programmatically? (It's an XML after import)
|
Mark M. |
if you mean that you used the Vector Asset Wizard, you should have gotten a drawable resource as a result
|
Kai H. |
Yes, I mean that
|
Kai H. |
And I can load that drawable?
|
Mark M. |
yes, like any other drawable resource
|
Mark M. |
so, @drawable/whatever or R.drawable.whatever
|
Kai H. |
Thansk :D
|
Jun 16 | 8:35 AM |
Kai H. |
I think I'm a bit confused as we use glide to load some images/drawables and that doesn't work anymore after we started to use imported .svg, as glide doesn't know what to do with the .xml. But I guess I can either teach it to do so or not load the images via glide at that place, right?
|
Mark M. |
presumably
|
Mark M. |
I forget whether Glide can load resources or not
|
Mark M. |
I mean, I know it can for placeholders and errors
|
Mark M. |
I haven't ever used Glide + resources for loading the "real" image content
|
Kai H. |
It can load resources, but it cannot load .svgs or .xml as a standard
|
Kai H. |
iirc
|
Mark M. |
OK, you lost me there
|
Kai H. |
I think I have to go back and look at my code to see what is done exactly :D
|
Kai H. |
But I'd have a question about Kotlin
|
Jun 16 | 8:40 AM |
Kai H. |
You state that Kotlin is one of the most complex programming languages. I wondered why it designed that way, as it feels like a pretty big disadvantage for me.
|
Mark M. |
~80% of the functionality developers need can come from ~20% of the language syntax (all percentages very approximate)
|
Kai H. |
But you have to be really disciplined to stick to the 20 %, it feels.
|
Mark M. |
no, you just ignore stuff that looks weird :-)
|
Kai H. |
I fear doing a project in Kotlin and handing it over to someone else who doesn't understand squat.
|
Mark M. |
so, if you see some code snippet somewhere that refers to a tailrec keyword, that's probably not something ordinary developers need
|
Kai H. |
Something which isn't as big of a thing with Java for example.
|
Jun 16 | 8:45 AM |
Mark M. |
eh, developers are able to not understand squat in any programming language :-)
|
Mark M. |
I agree that it is easier to create confusing Kotlin code than it is to create confusing Java code
|
Kai H. |
Sure, you can write it that way. It just seems that it's easier in Kotlin, as it can be part of the syntax, not how the developer uses it.
|
Kai H. |
I have read through your Kotlin book, hence the questions ;-)
|
Mark M. |
getting back to your root question, Kotlin is written that way to maximize how much of Kotlin can be in a standard library (itself written in Kotlin) compared to being part of an actual core language engine
|
Mark M. |
the smaller the engine, the easier it is to rewrite that engine for other environments (Kotlin/JVM, Kotlin/JS, Kotlin/Native)
|
Mark M. |
a side benefit is that it gives that expressive power to library developers, so libraries can have streamlined APIs that resemble core language features
|
Kai H. |
That is why Kotlin is complex?
|
Mark M. |
however, that side benefit comes at a cost: a lot of the syntax for enabling that expressive power can be fairly arcane
|
Mark M. |
and so you run the risk of ordinary developers using that stuff in ordinary apps and causing problems for the "doesn't understand squat" crowd
|
Jun 16 | 8:50 AM |
Mark M. |
this is not unique to Kotlin -- Ruby has some of the same traits
|
Mark M. |
basically, rather than the language itself putting up guardrails to protect the "doesn't understand squat" group, the onus is on intermediate and advanced developers to clearly separate their code
|
Mark M. |
so that a library might be easy to use (for the "doesn't understand squat" group) but require more Kotlin experience to maintain
|
Mark M. |
only time will tell how well this approach works in practice
|
Kai H. |
Only time will tell...
|
Mark M. |
it was a bit of a problem for Ruby, but there it gets exacerbated by the language being interpreted and duck-typed rather than compiled and statically-typed
|
Mark M. |
programming languages are experiments in how to get humans to teach computers what to do
|
Mark M. |
we don't know how the experiments will turn out until we go through them
|
Mark M. |
which is why we have lots and lots and lots and lots of programming languages
|
Mark M. |
of course, eventually, computers will just program themselves, leading inevitably to SkyNet, muscle-bound Austrians stating "I'll be back", etc.
|
Jun 16 | 8:55 AM |
Kai H. |
But it's gonna be a couple of years before we're out of a job like that.
|
Kai H. |
Let's see if it's before or after I picked up Android ;-)
|
Mark M. |
it's more that languages succeed or fail in "the marketplace of ideas", and their successors sometimes learn from the mistakes
|
Mark M. |
so, 15 years ago, Ruby was "where it's at", and nowadays it is far less favored
|
Mark M. |
this does not make Ruby evil, nor does it mean that all Ruby code written is an unmaintainable mess, or anything
|
Mark M. |
it means that Ruby had its issues, which affected the team that use it
|
Mark M. |
all languages do the same thing, to varying degrees based on popularity and problem density
|
Mark M. |
languages are also a bit of a fashion statement, so Ruby went from "all the cool kids are using Ruby" to "Ruby? ugh" in a decade
|
Mark M. |
we may be using Kotlin in 20 years, or we may not
|
Jun 16 | 9:00 AM |
Kai H. |
What's your take on why Python seems to be kinda stable in that regard?
|
Mark M. |
frankly, I have no idea
|
Mark M. |
while some languages I understand their unexpected longevity (Objective-C, I'm looking at you), I haven't quite understood how Python has hung around
|
Mark M. |
'cause Python is pretty old
|
Mark M. |
not C old, but up there
|
Kai H. |
That's what makes it interesting for me. Could mean that Python has done something very right
|
Mark M. |
possibly, but syntactically-relevant whitespace makes me cringe
|
Mark M. |
or, more accurately, syntactically-relevant indent levels
|
Mark M. |
a lot of the time, what drives the "fashion statement" aspect of the language is some specific use of that language
|
Mark M. |
for Ruby, it was Rails
|
Mark M. |
for Kotlin, in many respects, it is Android
|
Mark M. |
for Objective-C, it was Steve Jobs
|
Kai H. |
The hope is that Kotlin can do more
|
Mark M. |
yes, and it is already used for more, just as Ruby was used for more than Rails
|
Mark M. |
my book generation scripts are all in Ruby, for example
|
Mark M. |
(with some slow migrations in a Kotlin-y direction)
|
Jun 16 | 9:05 AM |
Mark M. |
in some cases, it doesn't really have "legs" beyond the primary use case -- I don't know of Objective-C being used for a ton outside of Mac/iOS development
|
Mark M. |
and so once the primary use case moves on, the popularity can change in heartbeat
|
Mark M. |
in the case of Objective-C, the introduction of Swift tanked Objective-C's popularity, because Mac/iOS moved en masse to Swift
|
Kai H. |
Especially nowadays with so many languages. For a lot of the purposes you could use Kotlin besides Android there is a language that does it better.
|
Mark M. |
in many ways, I think that there are actually fewer languages now than, say, 25 years ago
|
Mark M. |
I think that there are more languages being used "for realz" now, though
|
Kai H. |
How are there actually fewer languages?
|
Mark M. |
oh, there were tons and tons of languages in the 80's and 90's that either had their heyday (BASIC, Pascal) or were more experimental (Forth)
|
Mark M. |
some have lived on (BASIC -> Visual Basic, LISP), while others died off (SNOBOL)
|
Mark M. |
back then, if you were a computer science major, writing a programming language was almost a rite of passage
|
Mark M. |
most of those never made it past homework assignments, but some did
|
Jun 16 | 9:10 AM |
Mark M. |
nowadays, creating a programming language is in some ways easier, due to better tools
|
Mark M. |
but creating a programming language that people will try is harder, because we have a lot more history with a lot more languages that we did 25-30 years ago
|
Mark M. |
(er, "than we did")
|
Mark M. |
and a lot of the use cases for a programming language might be handled in other ways today (e.g., XML/JSON data structures processed by a regular programming language, or a DSL written in a regular programming language)
|
Kai H. |
I see.
|
Jun 16 | 9:30 AM |
Mark M. |
OK, that's a wrap for today's chat
|
Mark M. |
next one is Thursday in the 7:30pm US Eastern time slot
|
Kai H. |
thank you
|
Mark M. |
have a pleasant day, and stay healthy!
|
Kai H. |
Have a good time
|
Kai H. | has left the room |
Mark M. | turned off guest access |