On Tuesday, 13 March 2018 at 12:23:06 UTC, Ozan Süel wrote:
if (source?pool?repository?directory?users) // do something
That type of chain is sometimes referred to as a "train wreck"
(see Law of Demeter).
If this is a common lookup it could be:
if (source && source.GotSomeUsers() )
On Tuesday, 13 March 2018 at 12:23:06 UTC, Ozan Süel wrote:
Hi
I have a construction like the following
if (source) {
if (source.pool) {
if (source.pool.repository) {
if (source.pool.repository.directory) {
if (source.pool.repository.directory.users) {
// do someth
On Friday, 16 March 2018 at 09:34:38 UTC, Satoshi wrote:
null conditional operators are not implemented in D because, as
a (I think Walter) said, D is not language designed to work
with classes or advanced OOP stuff. Nobody uses it, so please,
if you are using it, stop and use structs and meta
On 16.03.2018 09:34, Satoshi wrote:
On Tuesday, 13 March 2018 at 12:23:06 UTC, Ozan Süel wrote:
Hi
I have a construction like the following
if (source) {
if (source.pool) {
if (source.pool.repository) {
if (source.pool.repository.directory) {
if (source.pool.repository.director
On 16.03.2018 09:51, drug wrote:
I think that null conditional operator is intended for OOP only. It's
really useful if your data field may be nullable. May be start review
about this?
Oops. I mean *isn't intended for OOP only*
On Tuesday, 13 March 2018 at 12:23:06 UTC, Ozan Süel wrote:
Hi
I have a construction like the following
if (source) {
if (source.pool) {
if (source.pool.repository) {
if (source.pool.repository.directory) {
if (source.pool.repository.directory.users) {
// do someth
On Tuesday, 13 March 2018 at 13:13:07 UTC, rumbu wrote:
On Tuesday, 13 March 2018 at 12:23:06 UTC, Ozan Süel wrote:
Hi
I have a construction like the following
if (source) {
if (source.pool) {
if (source.pool.repository) {
if (source.pool.repository.directory) {
if (source.
On Tuesday, 13 March 2018 at 12:23:06 UTC, Ozan Süel wrote:
Hi
I have a construction like the following
if (source) {
if (source.pool) {
if (source.pool.repository) {
if (source.pool.repository.directory) {
if (source.pool.repository.directory.users) {
// do someth
On 14/03/2018 1:23 AM, Ozan Süel wrote:
Hi
I have a construction like the following
if (source) {
if (source.pool) {
if (source.pool.repository) {
if (source.pool.repository.directory) {
if (source.pool.repository.directory.users) {
// do something
Any chance to simp
Hi
I have a construction like the following
if (source) {
if (source.pool) {
if (source.pool.repository) {
if (source.pool.repository.directory) {
if (source.pool.repository.directory.users) {
// do something
Any chance to simplify this nested ifs?
I know some lang
Hi
I have a construction like the following
if (source) {
if (source.pool) {
if (source.pool.repository) {
if (source.pool.repository.directory) {
if (source.pool.repository.directory.users) {
return source.pool.repository.directory.users[ownerID];
11 matches
Mail list logo