« first day (3667 days earlier)      last day (1263 days later) » 
00:00 - 19:0019:00 - 23:00

12:01 AM
I guess thinking about it there's not many alternatives to defining nested elements with different attributes that doesn't depend on indentation
 
* And can be validated in a sane way
 
...
 
Good evening everyone. I have a doubt. What is the correct way to name the tables? Example:

column_name or columnName?

One using the _ and the other all together, just capitalizing the first letter.

Thank you.
 
You're welcome
 
@Tiago it's preference
@Tiago depends on the coding style enacted at your employer
 
12:06 AM
@Tiffany If I'm doing a project from scratch. What format do the vast majority use or what do large companies default to?
 
don't worry about it
just use what you prefer
but stay consistent
 
When you create projects, how do you prefer to use?
 
@Tiago I would prefer snake case, just to not have to deal with case sensitivity
 
@PeeHaa snake...rsrs?
_ ?
 
In computer programming, a naming convention is a set of rules for choosing the character sequence to be used for identifiers which denote variables, types, functions, and other entities in source code and documentation. Reasons for using a naming convention (as opposed to allowing programmers to choose any character sequence) include the following: To reduce the effort needed to read and understand source code; To enable code reviews to focus on more important issues than arguing over syntax and naming standards. To enable code quality review tools to focus their reporting mainly on significant...
 
12:09 AM
If you wanna see other people's opinions
I generally agree with and use the stuff in the blog post
But it is most important to be consistent no matter what you choose
 
Thank you, I will use the underline as default. Thank you all.
 
TIL: pothole_case and SCREAMING-KEBAB-CASE
possibly superficial names, but still hilarious
 
12:27 AM
Just read the clean code book. He really hammers the topic of naming things.
 
 
4 hours later…
4:22 AM
@Wes where is the new version please?
 
Wes
@Danack y u backstab me in the middle of the night
i thought we were friends :B
 
...
 
Wes
:D
 
so it's not quite ready?
 
Wes
it is, sorta
needs just the finishing touches
 
4:30 AM
"how to sell things" Step 1) make it available to buy...
 
Wes
right
wasn't really a success the first time :B
 
Step 2) tell people about it....
...
 
Wes
4:50 AM
:B
 
 
3 hours later…
7:55 AM
morns
 
8:24 AM
\o
 
8:52 AM
o/
 
9:38 AM
yawn
 
9:53 AM
truth
 
10:16 AM
is it the weekend yet?
 
Afraid not :(
 
10:28 AM
In a little less than 12 hours
 
10:54 AM
@NikiC I'm unhappy that I had to make this commit in Xdebug github.com/xdebug/xdebug/commit/…, because a header in PHP started adding declarations after statements after an RC had been made (github.com/php/php-src/blob/master/Zend/zend_generators.h#L115) — would you mind if I "fixed" that in php-src again?
 
@Derick yes, I would mind
 
I don't really care that it is in .C files, but .h files are a public API that you've just changed. I would also argue that also declarations after statements can have some benefit (in long functions), but I don't believe that's the case here.
 
@Derick PHP allows declarations after statements since PHP 8.0 -- the fact that they have not appeared in a header before this RC is pure coincidence.
 
11:15 AM
@cmb Wondering if we should render nullable types using ?Foo
 
cmb
@NikiC I think that would be nice improvement.
 
11:36 AM
sup bitches
 
cmb
@NikiC regarding github.com/php/php-src/pull/6391#issuecomment-719494930: omit the result var, or cast to void?
 
@cmb omitting is fine
 
cmb
ta
 
12:34 PM
Wat, who added the hacktoberfest label to the php repo?
And I was wondering why we're getting those spam PRs
 
@NikiC Salathe did for Levi after he asked for his SPL PR
 
lo all
 
Morning o/
 
anyone here a symfony user ?
good day statik
 
> Don't ask to ask, just ask
assuming you have a question, anyway
 
12:47 PM
well before i start talking about symfony things it would be nice if people knew what i was talking about :D
yeah i was wondering how to get id from a new entity without presiting it. and keeping the same id after presisting it.
 
if you need to ask a question that involved symfony, please see sol.gfxile.net/dontask.html
 
makes sense
 
@sliver Is there possibility that entity won't be saved in DB after that line?
 
yes ofcouse, but if press save i dont care.
*dont
but if they dont press save i dont care
 
If final intention is to store that object into DB why avoid persist? Also, check this answer.
 
1:01 PM
yes was thinking of that too. so its not weird for you that if the user does not press save there will be still a entity in the database ?
so presist is not something i like to do untill iam sure that what was put in needs to be saved.
maybe i should led go of the save and cancel idea...
 
Little more code of context would be helpful. You are creating entity in method that is called by form sumbitting.
You don't do that in method that shows form (except if update is in matter).
 
iam extreamly new and got nobody to guide me in choises so maybe iam doing things wrong.
i got a page and it loads forms with javascript/jquery. i submit forms to the add/edit functions. they return a new for for error corrections.
 
Use pastebin.com and show add/edit function code sample.
 
okay give me a moment :P
its a messy code because iam changeing things as i go
learning symfony as i go
entity at the bottom but it does nothign special.
 
1:22 PM
AJAX and non-AJAX are valid requests for /invoice/add route?
 
its work in progress :) i will make a choice later. eighter gone go full ajax or ajax and non-ajax to support none js users. ( depends on how good i can fix non-ajax) but for now the non-ajax is usefull for testing. to actualy see what the result is, thats why its there.
 
You should better make two routes: one for showing form and another for form action. It will make things way easier for you.
 
realy wonder what you mean because most symfony examples have the isSubmitted() isValid() thing. makeing both showing form and form actions together.
and symfony does not realy easly allow for the action to go to another route when it generates the form...
How do you do form handeling ?
you use js and chose what function handles the action ?
 
@BogdanUngureanu Hey :) Sorry, I was busy yesterday. I will respond to your e-mail in the ML. I think adding literal types would be great, although probably more useful if we also had type aliases. Those two don't necessarily have to be introduced at the same time though.
 
1:40 PM
still heavly thinking of your first idea to presist the data right away. Because i want to add allot of extra entitys to the invoice entity. and to make 1 big form handeling it all is way to complex. its easyer to make forms for each seperate entity.
 
@sliver Arbitrary selecting action method. I separate class::methods by request methods. get /invoice/create and post /invoice/store I found good way of separation. I have to admit that I am trying to grasp Symfony these days too.
 
it does sound much beter to be honest to split everything nicely.
 
Then, for instance in [POST] /invoice/store you know it is posting to that endpoint/route.
Avoiding if, switch blocks.
So in [post] route you would definitely want to persist entity.
 
2:01 PM
Can anyone suggest a practical example where two keys might be same that will be overridden when array_merge() is used?
 
sorry back
 
@Exception Here.
 
do you have a example code tpojka ?
 
@sliver Still trying to make triage of good tutors from YT. Also making somewhat of testing mini-app here. Not using crud in it but some actions with third party services. I think this guy explains nicely as much as I've seen it.
 
2:09 PM
@Tpojka @cmb not such examples. I mean real life practical examples which comes while working in the project.
 
You are actually asking us to provide you an example of how people did it wrong?
 
probably.
 
no how other symfony developer do something. because i have seen many examples but none of them actualy show a good application
a big application*
 
@Exception 3v4l.org/6ATMY
 
2:23 PM
@sliver Every of those tutorials are fragments of good-ish practice in coding. You have to combine best parts to make your code. Everything more than that requires case study of requirements (i.e. business logic expected) for your application.
 
2:35 PM
Morning
 
iam still not sure how to handel the combining things.
like for example i have invoice entity and invoice lines. they are handled with entity collection because symfony and examples show this. But iam thinking why not make seperate invoice entity and lines entity and handle them seperately.
the implementation of the view will be mostly js and easyer to maintain.
but the invoice id is not know when i create the new invoice entity. so i have no idea where to add the lines.
i can undestand that symfony likes the data model to match the form entity collection but its for me sometimes a bit complex.
the more you link to your invoice the more complex it all gets.
the first idea of presisting the data right away might be the best. but its not pritty way of going
 
I can point you that you should take old answers (i.e. from 2013 Symfony2) with caution. Symfony4 differs from Symfony3 and now is Symfony5 actual (you are using 5?). In code you provided there is use of global which is discouraged. For example, you have doctrine already in $this of AbstractController but also you should get any wanted interface/class/service through dependency injection. These are just things you should go with on beginning of framework learning.
 
to be the best way would be to generate the id of the entity when the entity is created. i know this is hard to main relations when entitys with id's might not be saved afterall. thats why i wonder how others do this.
iam using 5
i upgrade everything to newest standards.
yes because i want to generate my id . and symfony does not allow it. its extreamly idiotic why this is.
i can undestand you should not go do entitymanager stuff in your entity but i want to generate a id.
if i check out the id generator the first thing it gets handed is the damn entity manager.
my generating the id with sql did not work btw... symfony removes the sequence from postgresql when i remove the id generator.
and when i add the id generator it overwrites my id with a new one.
 
@Trowski well, boo … I think CLIENT_PLUGIN_AUTH capability may be missing?
 
2:50 PM
@sliver So clearly that part shouldn't go into constructor, right?
 
@bwoebi I did see some TODOs related to that I think.
 
entitymanger in controller is easy because its allowed
entity manager in entity is also okay if you add some stuff...
entity manager in _constructor only way is the global $kernal code
entity* _constructor
 
@sliver I am pointing way of how to get it there. I linked you latest code example from docs.
 
yes the code i commented out :)
its tests i did
it grabs the sequence id from pgsql
ah yes i saw some examles of generating the new id in the controller or add the em in constructor param. but its not the way to go to be honest.
 
2:56 PM
entity should generate the id... For example if i have a collection of invoice in another entity then i want to add new ones without using controller stuff
some things iam willing to do in controller. but some things i realy thing model should handel.
 
Next thing, (this is abstraction talk not concrete your code) id should be either autoincremented by DB engine either made through some function logic (uuid maybe?) just before persisting entity. Best place would be observer/event prePersist.
 
UUID i have implemented in users
its great it works.
 
Here. If you need to hash password for example best place would be here.
 
nice thing of uuid is that you get the uuid directly. its not generated by outside db.
 
Would this be considered a bug? stackoverflow.com/questions/64530814/…
 
3:01 PM
i would love to use the nextval function of postgresql to generate my id. thats why i used global $kernel.
i dont care if the sequence does not folow perfectly. as long as i get a simple uniqe id.
 
@sliver I am telling you about place where some (part of) code should live. Setting password to entity for example or setting id if manually set on creation. Other places could be rather considered wrong. You don't want to have some routines and code execution between place where you set id and when it is saved in DB. Controller belongs to that kind of places.
 
i feel like iam breaking design of symfony. and i realy wonder what iam doing wrong.
 
Again, you don't need global kernel.
exclude word global from your code. Like ever.
 
ow yes i know. password generation is in controller.
 
@sliver That is wrong.
Should be in prePersist doctrine event.
 
3:03 PM
like i sayed. doctrin is allowed to use Entity manager to generate an id.... and your telling me iam not ?...
okay so more event driven
 
@Dharman there was a brief discussion here: en.reddit.com/r/PHP/comments/ji6oge/… which is a shitshow to read as the author has deleted a load of his own posts...
 
is that a new password generation or based on form data ?
 
@sliver We can call it how ever you want (although event driven is pretty accurate in this case), but more important is place or time in execution to avoid hardly debugged errors/cases. prePersist event is probably last line of userland code where something "shouldn't be changed/should be set" can be changed. That's all I mind here.
 
ah you try to save the password as plain text and the prepresist changes it to a hash.
 
@sliver Not before. That.
Similar logic for identifier if possible and usually is.
 
3:08 PM
yeah when you call presist the prepresist changes it.
 
If you want/need/should to change it. Right.
 
i added comment for myself to change that part of code to prepresist.
the symfony id thing is done in prepresit. but you would not do it in other way ?
 
I usually use autoincrement (of MySQL) and leave that to DB.
 
so for example you have the invoice and you want to add a document as reference.
you add the invoice and lines with the document in 1 form post ?
or do u make 2 forms ?
one for invoice + lines and one for documents to add ?
 
One form is enough and then I extract data from request and assign different arrays with those data. Then each entity gets it's array of data to be saved in DB.
 
3:15 PM
okay so 1 big form like what symfony explains.
like the examples.
styling of a form like that must be insane or not ?
 
That is arbitrary regarding frontend/client need. Sometimes it is several forms through steps. Whatever use case requires.
 
> okay so 1 big form like what symfony explains
 
yeah the examples on the symfony website.
 
for the record, avoiding following how symfony forms work is generally a good idea.
whatever they do...don't do that.
 
the more entities you add to your form the more complex it gets
what do you do danack ?
 
3:19 PM
I make an api in PHP, and use JS on the frontend, so that the form and processing the data are completely separate.
 
yeah i was thinking the same. but symfony way is what you expect others to use.
i want the entity id before commiting it to the database.
but with symfony entity and its relations have no idea of the id of an entity untill its saved to database.
makeing it extreamly hard for me to do any js forms without knowing the id.
 
> i want the entity id before commiting it to the database.
I avoid doing that also....I separate data types that are heading to the DB, from types that represent entities that have been persisted.
(to be clear, the way I do stuff might not actually be appropriate for you.)
 
i atleast want to know and evaluate all options.
 
But if you're finding it doing it the symfony way, you could just do it a different way.
@Dharman oh, apparently it's the same person there as on reddit. cracks knuckles.
@DaveRandom I just noticed this. That is copyright theft of a joke.
 
can u explain to me what you avoid with the id thing ?
 
3:23 PM
@Danack I got it from tpb
 
@sliver yes, but need to go to other computer, so will take a few mins.
 
in my defence I am a terrible person
 
not as bad as this guy: stackoverflow.com/users/5999372/rain
> I much prefer the sharpest downvote of a single intelligent person to the thoughtless upvote of the masses.
 
take your time. i spend 3 days googling on the entity id thing so happy with any info you can give me on how you would do it.
 
@Danack Maverick!
 
3:27 PM
The gentlemen just mass deleted a load of his comments on reddit after I said I disagreed with his approach to solving a problem...
@StatikStasis "I'll ride your tail!" "You can ride my tail anytime!"
 
@Tpojka thanks for all your advice ! i will defenetly fix some stuff in my code based on your advice.
 
is a good practice to use try catch block in laravel controller, so include all inside method in controller in try and then catch or no?
 
@sliver I am glad if anything was helpful. I shared some good practice I found on internet and use myself.
 
@MarinarioAgalliu I wouldn't say it's good. It might sometimes be necessary, but I'd be kind of concerned if it was in every controller. For things like "the DB can't be reached", rather than catching each of those in every controller, I imagine there would be catching them with a global handler, so that they same error response can be generated for all the controllers.
 
i dont know laravel but from all the diferent languages i have used its generaly beter to let the framework deal with error handeling. i add some error handeling here and there. but generaly if you want your own way of error handeling then you have to make a strategy you want to apply to your whole application. and then its beter to use the framework.
my boss made a nice global handler... if any error is not caught it would show messages "Unknown error, try restarting application"
 
3:41 PM
@Danack thanks for reply, In fact that was the request from my team leader and doing try and catch the idea was to catch specific errors if smth goes wrong and catch that specific eroor, but I can go max to global error like you said "the DB can't be reached"
@sliver thanks for reply, the idea was if i can catch error for each line/function or whatever goes wrong inside method
I want to explain also that this is made so the error can be showed somehow to the user and not for in-development purpose
 
i dont know how laravel works but in symfony if i generate a error framework handles it.
i much rather throw more errors then to go and handle them.
avoiding errors is ofcouse best.
 
yeah same thing in laravel, generally and most of the errors are already handled by the framework
 
if i catch a error its usaly to fix the problem rather then to show the user.
 
but the purpose is showing a special message to user if an error is generated so the user can manage the situation and complete the precedure successfully
 
i dont know laravel and i dont know symfony but i hope in the future i can change symfony error handeling style to something i want
 
3:47 PM
yeah thanks anyway guys
 
@MarinarioAgalliu if that's specific to that controller, then it probably should be in the controller.
 
@Danack =D
 
@Danack yeah always in that specific controller
 
@PeeHaa This new position is keeping from having time to stream video games. I may have to quit... the job =P
 
:D
 
3:56 PM
iam not sure but can you not create your own exception handel and catch only the specific exceptions ones your code creates. let the other framework exceptions be handled by the framework ?
 
This is not sql room lol
jk
 
your selection should be inside the 2 queries.
* the last whare conditions should be added to each of the other 2 where conditions
you can not do where on union
 
3 mins ago, by Sal Orozco
This is not sql room lol
it's also not a room for people to only use as a debugging tool.
 
add quotes around the string and your php vars and it will be accepted.
 
@Tiago it's nice that you get help here, but you're acting as a help vampire.
 
4:06 PM
@Danack Brazilians, you know them :p
 
it wasnt that complicated of a query
 
@sliver he's been getting annoying and dumping his stuff that he can't/won't debug for a long time.
 
Happy checklist day ..!
 
ah just like me ;)
 
@Tiago create a dam gist and paste it into a sql room. Ask your question there.
 
4:11 PM
its a great idea actualy. paste my errors here :P
 
@Tiago Dude, I'm Brazilian, chill out
 
Thank you those who helped me.
 
@tiago you need to listen to room owner feedback, and not be a dick back to people who are trying to point you to how to avoid being annoying.
 
4:12 PM
i should apply for dba jobs :D
 
Doctor of Business Administration? @sliver
 
doctor is not a good job... all those old people with complaints all day.
:D
 
:-)
 
I can't imagine being a DBA is much better :P
 
yeah i should have become garbage collector. much more relax and beter pay
my mom sayed it so many times... you can always become garbage collector
 
4:16 PM
ReflectionFunction->invokeArgs confused in arguments ・ Reflection related ・ #80299
 
danack iam still wondering about your aprouch with the datatypes, so i wonder if you have something like a system that tracks changed datatypes from other already presisted datatypes.
 
@GabrielCaruso random question that you should feel free to tell me to fuck off as an answer; would you say that a 'caste system' is still present in modern day Brazil or is that a relic of the past? The reason I'm asking is that the same sense of "I came here for help so you guys are expected to help me" seems to come from not just brazillians, but also people from other countries that have caste systems.
 
@Danack Mind to elaborate more on what a caste system is, please?
 
its not a php related system :)
 
"I came here for help so you guys are expected to help me"

Regardless of the definition, yeah, that's pretty common back there :(
 
4:27 PM
@GabrielCaruso I'm more familiar with the Indian one - bbc.co.uk/news/world-asia-india-35650616 but my understanding is that the social system in Brazil is ...... not as equitable as it could be.
 
@Danack Another thing that is common: if you've helped a Brazilian once, you will help him forever. There's an expression that we use "You can't give someone a hand, it will want an arm"
 
"give an inch and they'll take a mile" is the equivalent in Britain.
 
Nice, TIL
 
give a finger take hole hand :P
 
Give a finger and they take your hand
@sliver ha
 
4:29 PM
And I was thinking that was a Brazilian thing, poor boy 😂
 
we also say "comeing on the coffee..." so dont know how translations are sometimes interpeted...
 
Gross
Well at least you are not coming in the coffee I guess :P
 
@IluTov yeah, I fully agree. My idea was to first implement type literals and then continue with aliases in a separate rfc (mainly because I think it's a bit more complex)
 
4:48 PM
@IluTov @FrankdeJonge What are your thoughts on these two options, from either a usability or implementation perspective:
Enum Suit {
  case Clubs = 'C';
  case Hearts = 'H';
}

Enum Suit {
  case Clubs('C');
  case Hearts('H');
}
Both meaning "if used as a scalar, use this value instead of stringifying the case name." The former seems more obvious, but the latter feels like it would be better if combined with case-specific methods.
It would feel less weird.
 
@Crell instant gut reaction, the bottom one feels like it would be easier to expand to support other stuff, in case that was ever needed...
 
enum Suit {
  case Clubs('C') {
    public function humanLabel() { ... }
  };
}
I'd agree. My concern is if that becomes confusing with using a variable name there, in which case it becomes an associable case and you can't mix associable cases and primitive-equivalent cases in the same enumeration.
 
@Crell You need to specifically mention the scalar backing, IMO:
 
uh, I understood some of those words...
 
That's the primitive-equivalent I'm talking about. Like, literally the thing I'm asking about. :-)
 
4:53 PM
enum Suit: string {
  case Clubs = 'C';
  case Hearts = 'H';
}

enum Suit: string {
  case Clubs('C');
  case Hearts('H');
}
 
OH! Interesting.
So that would disallow mixed-primitive-type enums? Or, I suppose union types would work there.
thinking.gif
 
In my experience this specific kind of thing is really common.
I would dare say up to 80% of uses...
 
Right, I'm still trying to square the circle of primitive equivalency and ADTs/associable values in the same syntax.
 
> Yes! But no, sorry :-(
lol
 
So... if we had the following:

1) By default, enum values have no primitive equivalent. They just "are". You get a values() method that returns an array of case values in lexical order.
2) IFF you specify a "return type" on the enum, then all values MUST have an associated primitive that's compatible with that type. You then get a from() method auto-generated that up-casts from the primitive to the enum. (The primitive is NOT sufficient to match an enum type check.)
3) If you specify no return type, you MAY add associable parameters to one or more cases. If you do, the values() method
So Suit::from('H') == Suit::Heart
strlen(Suit::Heart) == 1
 
5:39 PM
@sliver so, here is a typo ridden example. The input type of UserCreateParams is separate from the user entity that has been persisted to the DB.
If you're using an orm, I put all of the details of that inside the 'repo' layer, so it is hidden away from the controllers, so that the controllers never see a 'virtual' user object that hasn't come from the DB.
 
@BogdanUngureanu Cool :) What was the other conversation in this chat you mentioned? Does somebody see reasons against adding literal types?
@Crell The former looks more obvious to me, especially given that associated values have a similar syntax (the parens).
@LeviMorrison I'm probably most in favor of that one. There are probably no valid reasons to mix types of different cases, right?
 
Not that I have thought of, anyway.
 
@LeviMorrison And if you do, you can always create a non-scalar backed enum and create your own conversion methods manually.
One note though. Differentiating between scalar backed and non-scalar backed enums doesn't necessarily solve the problem of knowing when methods like values() are available. Your enum could be non-scalar backed but contain no cases with associated values where values() would still be valuable.
 
6:04 PM
@IluTov @Crell and @Girgias from what I remember mainly because of enums
 
@BogdanUngureanu I see. I'd argue FOR literal types for the same reason I'd argue for T|false, many existing APIs depend on constant literals and a ways of expressing that is always better than an inability to express that IMO.
 
I was watching something :( But yeah I don't really see the point, if we have Enums (well I suppose that needs the scalar backing sorted out before and maybe I'll change my mind after)
 
Sorry about that :D
 
@IluTov values() would be available/meaningful for scalared or non-scalared enums. It's only on associable enums that it breaks down.
 
@Crell I later saw that you mentioned the same thing in the message above ^^
 
6:11 PM
:-)
 
> I don't really see the point, if we have Enums
 
So should I try updating the RFC with the 4 points above?
 
I share that emotion.
The problem for me is, if it's just bare strings then it makes it hard to reason about whether two functions are returning the same types, or if there are two different types that just so happen to have the same string values.
aka, I think naming things is better than not naming things.
 
I'd agree that for new APIs an enum would be better. The main benefit I see are existing APIs like preg_match(...): 0|1|false {} (instead of int|false).
 
"Adding features to document code you already know is bad" doesn't seem like the most compelling argument, when it could lead to confusion about which to use in new code.
 
6:16 PM
It's the same reason we added T|false.
 
I also wasn't in favor of that. :-)
@IluTov so is the above plan for handling primitives workable for you? Should I try updating the RFC for it?
I have no idea what that does for your implementation side.
 
@Crell Sure, that would work. Do we settle on string/int only? float/bool seem marginally useful. Probably also no union types.
 
I can't see a use for bool, but also no particular reason to block it unless that's easier. float... I don't know when I'd use that, but again I can't see a reason to forbid it.
 
@IluTov I mean we don't have true, and arguably a bunch of function only return true, and I was also not really keen on just adding false
 
@Girgias I was under the impression this was mostly not to mix other language features with the union type RFC.
 
6:23 PM
Same argument could be made for false tho? Or am I missing something
 
@Crell I'm not a specialist on floating points but could there be potential issues with precision? Especially if you're trying to store it in other systems like a database.
 
My knee-jerk thought was "any valid type is cool", but on reflection (no pun intended) there's a lot of combinations that would make zero sense.
 
@Girgias False is surely much more common than other constants like 0 or 1 and thus more relevant to the union type RFC.
 
@IluTov pretty sure most platforms are ieee compatible....at least for all 'sane' values that would be used. Also, that's a problem for userland/the DB layer to solve.
 
@Girgias Very little code returns "true or something random." But a lot of the standard library returns "something meaningful, or false if something went wrong and we don't know what." That was Nikita's argument, since he wanted it for the stubs.
 
6:25 PM
@IluTov Right but trueis not a valid return value
I know that, but it is still dumb IMHO to only have one of them
 
@Girgias Yeah, again because it's not common in APIs to only return true but never false.
 
Either you have both either you only have bool not this weirdo false
 
/shrug
@IluTov Let me ask this: What's easiest for you to implement? Only allow int or string, allow int, string, or float, or "any value, and if it doesn't make sense it's your own damned fault"?
 
@IluTov I mean, I've got a bazillion todo comment's I added during Warning promotion which go like this: "TODO: Make void?" after removing all the false returns
Sure it's not common but it exists
 
@Crell I don't think implementation wise it makes any difference at all.
 
6:27 PM
And purely on the engine level true and false are both types where bool is "union" of them
 
Then let's say int, float, string, or a union of those for now. If discussion or implementation forces it a different direction we can cross that bridge when we come to it.
 
All in all, I'm not convinced, but I'm not convinced by many things and people still want them so
 
About enums, primitive-backed enums, or the false type? :-)
 
The literal types
 
I'm not convinced of them either.
 
6:30 PM
Enums I'm clearly convinced, primitives backed ones are necessary at times but I'll let you sort out the details :D
 
But I've got enough on my plate to help other people do this version. :-)
 
And the false type well... we have it so can't do much about it now, can we :')
 
@IluTov for primitive enums, I'm thinking they can auto-convert for a param/return in weak mode, but not in strict mode. Logical?
 
They should have programmed it in Rust.
 
6:33 PM
And that's why you don't use Matlab
Matlab is never the answer
 
@Crell Good question. Object to int casts are still valid today (even though it emits a warning) and return 1. With a string cast, do we get the underlying string value or do we call __toString?
 
I have no idea what a string-backed enum with a __tostring method would do.
Would you still implement a primitive-backed case as an object? Does this effectively mean we are going to have a __toInt() method one way or another?
Or __toFloat?
 
@Crell Yeah, preferably all enum variations are objects (otherwise methods and other object features are lost). I'm not sure how to handle casting yet... Either we make is special for enum objects or we forbid it and always use the conversion methods (and potentially even disallowing implicit conversion in non-strict mode).
 
00:00 - 19:0019:00 - 23:00

« first day (3667 days earlier)      last day (1263 days later) »