« first day (2684 days earlier)      last day (2258 days later) » 

6:00 PM
Oh... I see ahah
I wrote it very bad
I meant... how does continuous integration works?
 
user3018350
@pmmaga Bad joke indeed :D
 
:P
 
developer pushed code to the repository, the code gets deployed on the staging environment, the tests get executed on that environment and, if all tests pass, the the branch gets marked as "correct" and is ready to be deployed to production ... some companies automate the process further, by doing the deployment to production automatically
 
I see, thanks!
But actually before pushing the code to repository developers still need to check everytime they change code on their local machine to see if it works... right?
This is my problem, actually, my local machine is veeery slow, and the project is veery heavy
 
user3018350
@pmmaga Definitely not helping my self with editing of that, such irony
 
6:07 PM
@SilvioMarijic what is wrong with accessors on a class without mutators?
 
user3018350
@Bonner웃 absolutely nothing
 
what problem are you trying to solve?
you are just creating an API that is confusing in the word of magic typecasting
$file = new File(fopen('file.txt'));
so many people will be caught out by that
what we really need is this:
https://wiki.php.net/rfc/readonly_properties
 
Or maybe what we need are structs which are copy-on-write.
 
structs are different to readonly properties
 
1) They don't have silly overhead for local scope modifications
2) When passed to other functions they won't be changed
 
user3018350
6:16 PM
@Bonner웃 Well that is also part of the RFC and that was general feedback that people want immutable properties not objects
 
Ironically, we had them in PHP 4 lol
 
so what is the point of an RFC for immutable objects then lol
 
Because we changed object semantics in PHP 5 and don't have them anymore.
 
user3018350
I can strip down whole thing regarding the classes. FML
 
readonly properties make sense in the world of unit testing, immutable objects don't make sense in any world, structs as Levi says along with readonly properties makes more sense
so the immutable keyword is designed to replace 2 existing programming theories instead of just allowing us to do the two theories separately, separation of concerns anyone?
 
user3018350
6:21 PM
Syntax we can discuss
 
syntax?
I'm talking about the basic concept
 
user3018350
Did you actually said that immutable objects don't make sense?
 
user3018350
Seriously
 
not in the world of readonly properties
other than speed, I can't see what immutable objects give us
I said earlier, structs and readonly properties are the way forwards
in that world, you can create immutable objects, with the granular control that a programmer needs
 
night ppl
 
6:29 PM
To be honest I don't think readonly properties make sense, at least by name a "read-only" property is basically a "write-once" variable. All of the times I can think of using this I'd rather just have pass-by-value instead.
 
To me they just provide a way of avoiding getter overhead
 
anyone here from South Africa?
 
Levi, what about DI?
and IoC?
 
Mutability is not evil and shared data is not evil either. It's mixing them that is problematic.
 
if you pass in a dependency, the last thing you want is some overloading method to change it
this creates a debugging nightmare, a readonly property would prevent this from being possible
mixing them is what people do in C# every day
to great success may I add
 
6:32 PM
I don't follow. If inheritors shouldn't touch it then make it private instead of protected?
 
even if protected, they can still be changed, if they were private, how would the inheriting class use the dependency, the clue is in the name, the class depends on that functionality being made available
 
No, not protected. Make it private if it shouldn't be changed.
 
do you know what a protected and private property is?
 
... yes.
 
a protected property can still be changed by an inheriting class
 
6:35 PM
I said, not protected. Make it private.
 
and a private property is not visible in an inheriting class
 
Yes, expose it via a protected method.
 
if you make it private, then the inheriting class can't use it
do you mean exposed via an accessor?
which is generally what you would do anyway
but a readonly property serves as a nice shorthand
 
Give an API to inheritors. Protected variables seem like a total code smell.
 
that is because PHP is one big bad code smell
 
6:37 PM
lol.
fuck readonly properties I mean hi
 
lol
 
@Bonner웃 s/a nice shorthand/a shorthand/
 
class Example {
private $_foo;

public __construct ($foo) {
$this->_foo = $foo;
}

public getFoo() {
return $this->_foo;
}
}

vs

class Example {
public readonly $foo;

public __construct ($foo) {
$this->foo = $foo;
}
}
 
Which imo makes it that much less explicit. I prefer the protected accessor way, or no inheritance at all and composited objects
 
^
 
6:41 PM
See, this is where a struct with copy semantics would be better.
struct Example {
    var $foo;
}
 
this is in a limited scope, what if you want to process $foo?
which is the whole point of a class
 
that and a few other million viewpoints ;)
 
how much experience do you guys have using other languages?
 
A lot :D
 
namely?
 
6:43 PM
I do a lot of C, C++, and bash but know many other languages.
Swift is my language of choice for programming puzzles, at least at the moment.
 
c++, which standard is that?
as there are so many standards now in C++ it is a mess
 
@Bonner웃 I use 14.
 
so you are comparing my idea of a nice language with a mess?
 
@Bonner웃 That's kind of like saying PHP is a mess because we have multiple versions?
 
it is a mess
 
6:45 PM
Sure, but not because of that.
 
> my idea of a nice language
 
it is missing basic features
 
pedantic anon is pedantic
 
what does that mean?
 
C is pretty fixed. I mean, the most widely used versions of C are C89/C90 (same thing) and C99...
You saying Swift is a mess too?
 
6:46 PM
never used it
so can't comment
hence why I didnt say anything
 
Objective-C is a mess
 
never used it
 
I mean, if you want to posit that all languages are a mess and terrible I can probably agree.
 
C# isn't
name one thing you don't like about C#
 
The .NET bit
 
6:48 PM
that everything has to go through a VM, or the framework or what?
saying .NET is like saying I don't like the universe
 
@Bonner웃 Any competent programmer in language X should be able to name plenty of things about language X they don't like.
Not even sure why you are asking.
 
there are things I don't like about .NET, but C# as a language is really nice
 
.NET has always been a pain to debug
 
has it?
 
Usually because I don't have the source code to the thing I'm debugging
 
6:49 PM
did you not know that the .NET Framework is open source?
 
@Bonner웃 Stop trolling. A few seconds ago, you said you wouldn't comment on swift because you don't know it, but then try and prove a language being superior from other people not knowing it?
 
and you can download the symbols too for older versions to make debugging easy
 
have some coherence
 
not trolling
 
Ok let me be specific, compiled programs written in some .NET centric language
 
6:50 PM
my point is that readonly properties are good for a language
you can disassemble .NET apps easily
 
which you try to prove by some appeal to authority
 
Did you know read-only properties are implemented via getter/setter in C#?
 
did you know they aren't?
 
Well, you can certainly have a getter for them
 
6:51 PM
@FélixGagnon-Grenier My dad said appeals to authority aren't logical fallacies.
 
you can but by choice
 
@Bonner웃 That describes the semantics, not the implementation.
 
it describes what I type with my hands
which unfortunately takes more effort with PHP
 
... maybe you are less experienced than you'd admit with it?
 
I use readonly properties on a daily basis in C#
 
6:52 PM
@Bonner웃 So I actually know more about C# than you do, apparently.
 
do you really?
 
Indeed; I just demonstrated one point about it you did not know.
 
I am well versed in C# as developer writing ASP.NET Core
I think you will find roslyn works different to how you've described
I just couldn't be bothered arguing
 
knowing an language api !== knowing a language
 
your point being?
lol
should have left it, was funny
it's a bit like knowing "an language" instead of "a language"
yet on the same point, the same mistake wasn't made twice :D
 
6:58 PM
i speak english good
 
I'm not sure if it makes any difference but I'm Zend Certified too
so when I ask for a language feature, or question one, it is with great experience my points are made
and great knowledge to that matter
so my question still stands, other than confusing developers, how is an immutable object going to help?
 
I haven't taken the exam but based on the ZCE study guide isn't it more about libraries than language features? Meaning, it asks way more questions about libraries than the language features?
 
If you hang around here a bit more, I believe you will realize that the level of skill in this room (many of its members actually writing the language you are "certified" in) is well beyond that of Zend or any online certification.
4
 
@Bonner웃 Have you ever implemented any programming language, even a toy?
 
that is like saying all people who build cars can drive them lol
or all people who design road layouts can drive
when that is simply not the case
ask me a relevant question
 
7:03 PM
so, how was your question about other languages relevant then?
like, you get to ask about field expertise form other people, but reject having to answer when asked yourself?
 
I was trying to get an idea of whether people have used readonly properties or not, maybe I should have just asked that instead
so have you ever used readonly properties before?
 
and Levi is trying to get an idea if you have any experience with languages structure, implementation and design
 
no I have no idea, I just write programs blindly
I have no idea what they do or how I manage to make them work
 
@Bonner웃 why do I get the impression that you would somehow reject the opinion of anyone not having used read only properties all days for two years?
 
would I?
I made a point, whether you want to accept it or not is your choice
do you think the idea of readonly properties is something that the PHP language should not have?
and if so why?
 
7:08 PM
I think that readonly properties is something that OOP does not need
 
maybe you don't need it.
 
Felix, why do you think that?
 
Because I have never been in a situation where I would need it; examples I see expressing the need for it smell to heavens and would almost always be solved through better design
 
do you use DI?
 
7:13 PM
so how do you resolve dependencies?
 
What does that even mean?
 
how do you pass in dependencies into a class
 
with a DIC
 
via a constructor, or property?
or do you do it in line?
 
constructor, most of the time
what's your question?
 
7:14 PM
let me get there
so you set a private property to the value of the dependency right?
in the constructor?
 
do you write unit tests?
 
so at some point you want to expose the dependency, and you would write an accessor to do so, which would take maybe 3 or 4 lines when you could just write one?
 
> so at some point you want to expose the dependency
why would that happen?
 
7:17 PM
and not only that, your class can still break the dependency if you make a boo boo
 
The real question is
 
so that you can test the state of the dependency
 
How is unit testing related :P
 
use a mock / stub
 
7:17 PM
it all ties in
 
... not really
 
what if the class you are injecting doesn't have an interface?
 
you went from readonly properties to DI to unit test
 
like a crappy 3rd party API
to make a point
 
I rarely test Google_Service
 
7:18 PM
You don't unit test 3rd party apis
 
you might include them in your unit tests
 
No you don't
That's not a unit test
 
seriously?
 
Yes
 
7:19 PM
so you don't use dependencies in a unit test?
 
Barely
 
yes you do lol
 
I do?
 
the answer is yes
 
How do you know?
 
7:19 PM
everyone does
 
Not 3rd party
Nobody sane does
 
PHP itself is a 3rd party framework
 
And you don't test that
Nor do you test the behavior of the .net farmework
 
but you include its functionality in unit tests
otherwise there would not be a test
 
But you don't test it
Which was your point
 
7:21 PM
you might want to check the state of something
 
Mock it
Don't expose things just to be able to test
 
CHM – #75988
 
You code is bad and you should feel bad
 
what about integration tests then?
 
What about it?
 
7:22 PM
how is that fucking related to readonly properties?
 
why are you swearing?
the point of mocking was raised, so I thought I'd raise the point of integration testing, which tests actual code
 
something about being led in circle from someone posing as oh so very experienced when they probably have no idea that the people they are talking with are most probably as experienced as they are
 
not just mocked objects
again more personal insults from the script god
 
25 mins ago, by Bonner 웃
so when I ask for a language feature, or question one, it is with great experience my points are made
 
when you can't win an argument, you resort to insults
 
7:25 PM
25 mins ago, by Bonner 웃
and great knowledge to that matter
it's called, factual evaluation of what is literally written in the chat transcript
 
to insult someone?
 
you, are posing as someone oh so very experienced. that's no insult.
it's, literally, what you are writing about yourself.
 
an insult shows a lack of intelligence because you have no other way of expressing what you want to say
 
so back to my point about writing one line to ensure dependencies are visible in unit tests, and we can be sure that after being satisfied in the constructor the depndency can be accessed, IN ONE LINE
 
7:31 PM
Sorry was on the phone
 
@PeeHaa I bet you were, slut.
Also, evening everyone :D
 
The point is that you should not expose things just for testing purposes
 
You don't broaden your API for testing
That is just madness
@MadaraUchiha Hey sexy
 
@MadaraUchiha We were making phone love
 
7:32 PM
how else do you unit test then?
 
By testing the unit
 
@Bonner웃 You test all relevant code paths of your units, generally the public methods, if you're in an OO system.
 
Once you broaden your API you cannot take it back
There will always be an asshole relying on it
 
Hi p/
 
Your API should generally be as tight as possible, just like @PeeHaa's tush.
 
7:36 PM
:P Hey bro
 
I was referring to PeeHaa's point of not exposing things for unit testing purposes, I think the point made is valid, in that mocking can be used
but why is my point of using one line opposed to many being ignored
 
posted on February 20, 2018

New Cyanide and Happiness Comic

 
@Bonner웃 Generally speaking, getters and setters are a practice that came from Java, and it sucks.
 
unlike Java, though, they actually serve a purpose in PHP
 
I hate them too, hence my point about readonly properties, which is a much nicer API
 
7:40 PM
It basically means, "I don't know if in the future I would like to restrict and/or do stuff to change the visibility of this property, so I'll implement a whole bunch of pointless methods that do nothing to help me now, but might (0.001%) help me in the far future"
What's really missing is getters and setters of which the API is identical to directly accessing a property, like C# and JS
 
that was one of the reasons I turned to C#
and static constructors which I no longer like the idea of
 
class Foo {
  private $bar { set; get; }
}

$foo = new Foo();
echo $foo->bar; // went through the getter, no boilerplate
And you can implement a more specialized getter in the 0.001% of cases where you actually need them
 
it should be:
public $bar { private set; get; }
I think thats what you mean
 
I was demonstrating the general thing, and I don't remember the syntax by heart (I'm more of the JS guy)
 
and yup I agree that would be nice
 
7:43 PM
But sure
@DaveRandom What purpose do the current getters and setters serve in PHP?
 
Guaranteeing types
and putting properties in interfaces
 
^^^
 
@DaveRandom So just add properties to interfaces
And add types to properties
 
I was just wondering how we would do that otherwise.
 
Why the weird workarounds?
@Allenph Easy
 
7:44 PM
yes, but right now you can't do that
 
interface Foo {
  $bar: int;
}
 
and realistically you won't be able to do that any time soon
 
typed properties would change a lot of things, for the better assuredly.
 
:shrug: realistically, I'm not using PHP for your realistic reasons, to be fair.
 
@MadaraUchiha You'd end up writing completely superfluous interfaces.
 
7:45 PM
but yeah, before that properties in interfaces really have no purpose
 
In order to force types to one class which will never have siblings.
 
@Allenph Not if you'd also have property types
In which case it wouldn't be the only way you can achieve property type checking
i.e class Foo { private $foo: int; }
 
not being funny but if you need type safety, why not just use a type safe language?
 
trying to use async stuff with an action loop. That is what I think would be nice to use. Have you put some thought on using amp @Danack?
\Amp\Loop::run(function() use ($app, $injector) {
    while($app->running()) {
        $action = $app->getCurrent();
        $next = yield $injector->execute($action);
        $app->receive($next);
    }
    $response = $app->makeResponse();
    yield $response->send();
});
 
@MadaraUchiha So is PHP just going to become strongly typed while maintaining all of this legacy stuff that isn't?
 
7:47 PM
@Allenph Nah, typing was always optional in PHP
That's a good thing
I really like TypeScript's approach to this, "I will warn you about obvious flaws, but you can pretty much back out whenever you want with any. If you activate strict mode however, Imma bust your ass and you'll have a completely type-safe project"
 
TS is an awesome language
 
Oh BTW @DaveRandom I am so soo sooo sorry
2018-02-20 19:04:56     Connection: opening to localhost:8025, timeout=300, options=array()
2018-02-20 19:04:57     Connection: opened
2018-02-20 19:04:57     SMTP INBOUND: "200 Welcome to MailGrab SMTP server"
2018-02-20 19:04:57     SERVER -> CLIENT: 200 Welcome to MailGrab SMTP server
2018-02-20 19:04:57     CLIENT -> SERVER: EHLO MSIGL72M7RDX
2018-02-20 19:04:58     SMTP INBOUND: "250 hello MSIGL72M7RDX @ 127.0.0.1:53962"
2018-02-20 19:04:58     SERVER -> CLIENT: 250 hello MSIGL72M7RDX @ 127.0.0.1:53962
:P
 
Optional typing means that you can put the extra work to get more sanity, and back off of it if it becomes too much of a bother to you
Also, it means you can gradually migrate existing projects, which is the real winner.
 
if you use it extensively, you get used to type safety and then make use of type casting and type converstion along with sugar syntax when you fancy a bit of shorthanding
 
@MadaraUchiha I've never seen code where this is the case.
 
7:50 PM
@Allenph Our project at work is like that.
When we started, it was all JS files and no types
 
It's the actual structure of the code that will end up being the problem.
 
Now it's more than 80% typed.
 
it is needed for TypeScript which can compile both JavaScript and TypeScript
 
Hmmm. I digress.
 
To be fair, TypeScript is a bit different
The concept of "types" is not tied directly to classes
 
7:51 PM
that is the same in C#
 
i.e. you don't have "either primitives, or instances of classes"
 
eg not really types ;)
 
types and values
 
You have "types" which are shapes, interfaces that even primitives can implement (For example, I can ask for anything with a length: number and get both arrays and strings
 
typescript can be used with an isapi in apache too to serve up websites ;)
I think the syntax is a ott though to be honest, let and var (I know the difference btw)
 
7:54 PM
@Allenph My point being that you can take an existing project, and add types to it when it suits you, and when you're sure of the type validity
@Bonner웃 I basically treat var as a compilation error nowadays, and most of our project uses const, with let being considered a smell.
 
they have a different meaning though in TS
 
@Bonner웃 What do you mean?
let vs const?
 
var is global, the visibility of a let is only within scope
 
@Bonner웃 No...
 
Just seems like a lot of complexity.
 
7:56 PM
var is scoped to the function, while let is scoped to the block.
@Allenph What does? Optional typing?
 
And a useful tool for destroying the minds of new engineers, like it did to mine.
Yes.
 
the function is the block?
I'm still learning TS btw lol
 
if (true) {
  var x = 5;
}

x; // 5

// vs

if (true) {
  let x = 5;
}
x; // ReferenceError
That is true for both TS and JS
 
I learn something new every day :)
is that the latest ECMA standard
 
@Allenph I think what you were missing is type inference
 
7:58 PM
@Bonner웃 VIMs standard
 
i.e. function foo() { return "hello"; } you don't need to tell PHP that the function returns a string, it could infer that statically.
It could then warn you in advance that foo() + 5; was going to fail.
 
@PeeHaa fixed the typo had to google it lol
 
@Bonner웃 It has been like that since ES2015
 
@MadaraUchiha I suppose.
 
@Bonner웃 :P
 

« first day (2684 days earlier)      last day (2258 days later) »