PrintTable now sorts its keys #707

Merged
merged 2 commits into from Jul 14, 2014

Projects

None yet
@0tt
Contributor
0tt commented May 25, 2014

For greater readability/consistency between prints

@0tt 0tt PrintTable now sorts its keys
For greater readability/consistency between prints
8933b79
@Divran
Contributor
Divran commented Jun 2, 2014

This will break if you use anything other than strings or numbers as keys, which is not unheard of.

@0tt
Contributor
0tt commented Jun 2, 2014

That's what tostring is for ;)

@robotboy655
Collaborator

It won't work, table.sort can't sort anything other than string or number:
image

@0tt
Contributor
0tt commented Jun 2, 2014

Heh, oops. Fixing now.

@robotboy655
Collaborator

You also fail to keep consistency with the rest of the code.

@robotboy655
Collaborator

I am talking about this:
image

@0tt
Contributor
0tt commented Jun 2, 2014

Didn't know that was a rule but okay.
On Jun 2, 2014 4:04 PM, "robotboy655" notifications@github.com wrote:

You also fail to keep consistency with the rest of the code.


Reply to this email directly or view it on GitHub
#707 (comment).

@HandsomeMatt
Contributor

Its not a rule, it's actually actively encouraged to replace C operators
with pure Lua operators.

You know who uses C operators? Acecool that's who.
On 3 Jun 2014 00:06, "DaaOtt" notifications@github.com wrote:

Didn't know that was a rule but okay.
On Jun 2, 2014 4:04 PM, "robotboy655" notifications@github.com wrote:

You also fail to keep consistency with the rest of the code.


Reply to this email directly or view it on GitHub
#707 (comment).


Reply to this email directly or view it on GitHub
#707 (comment).

@robotboy655
Collaborator

It's encouraged to keep the code consistent with the rest of the code. Since Garry used C operators everywhere, so should you in your PRs.

@HandsomeMatt
Contributor

Are you threatening me?
On 3 Jun 2014 10:18, "robotboy655" notifications@github.com wrote:

It's encouraged to keep the code consistent with the rest of the code.
Since Garry used C operators everywhere, so should you in your PRs.


Reply to this email directly or view it on GitHub
#707 (comment).

@robotboy655
Collaborator

Are you an idiot?

@Acecool
Contributor
Acecool commented Jun 3, 2014

And Garry used semi-colons which you're removing everywhere Robot; you're changing the coding standard to one you "like" the most. Don't call others names, you have many faults of your own...

You even delete others pull-requests so that you can submit them under your name; don't start...

@robotboy655
Collaborator

They are placed on random lines that were edited with Visual Studio, which I believe has a setting to automatically put a semicolon at line ending, he didn't put any semicolons before, and having them on random lines in random places isn't the best idea. They are unnecessary, just like all the whitespace.

@neico
Contributor
neico commented Jun 3, 2014

Whitespaces do help with the general overview, so those aren't unnecessary at all, but I think a syntax guideline on the repo using the CONTRIBUTING file could help eliminate any further discussions like that :x

@Bo98
Contributor
Bo98 commented Jun 4, 2014

I'm just going to leave this here:

#438 (comment)

@HandsomeMatt
Contributor

Yeah but Garry's not in charge and most the time wrong about everything.
On 4 Jun 2014 23:14, "Bo Anderson" notifications@github.com wrote:

I'm just going to leave this here:

#438 (comment)
#438 (comment)


Reply to this email directly or view it on GitHub
#707 (comment).

@Noiwex
Contributor
Noiwex commented Jul 12, 2014

C-like operators suck, why leave them, make code nicer, replace it with lua.

@Noiwex
Contributor
Noiwex commented Jul 12, 2014

We all know how garry is always right.

@robotboy655
Collaborator

@Noiwex, Garry uses C-style operators, so every PR should use them too. Make the code consistent with code base.

@HandsomeMatt
Contributor

@robotboy655 the code base is already inconsistent, so let's make it consistent with Lua operators.

@robotboy655
Collaborator

No. That's a wrong attitude.

@Lexicality
Contributor

@HandsomeMatt The codebase is now considerably less inconsistent than it was before. Thus all new code added should match the current trend, even if it is shit. Consistency > *

@Noiwex
Contributor
Noiwex commented Jul 13, 2014

C-style is wrong, Garry is not the only contributor there, fuck garry.

On Sun, Jul 13, 2014 at 7:52 PM, Lex Robinson notifications@github.com
wrote:

@HandsomeMatt https://github.com/HandsomeMatt The codebase is now
considerably less inconsistent than it was before. Thus all new code added
should match the current trend, even if it is shit. Consistency > *


Reply to this email directly or view it on GitHub
#707 (comment).

@robotboy655
Collaborator

It's wrong in your mind, it's not wrong in Garry's. End of story.

@Noiwex
Contributor
Noiwex commented Jul 13, 2014

Да Гарри болван, влепил дохуя бесполезный синтакс из C. Нахуя, зачем? Пусть идёт дрочить свой раст и не лезет со своим синтаксисом, убожество. Давайте ещё <<, >>, ++, --, влепим, хули, ещё фигурные скобки, обязательные семиколоны! Роботбой, хватит подсасывать у гарри, это выглядит убого.

@Divran
Contributor
Divran commented Jul 13, 2014

Google translate is as helpful as ever

Yes Harry blockhead punched Doha useless syntax of C. Naha, why? Let him go and masturbate your stretch climbs to its syntax, squalor. Let's <<, >>, +, -, punched, fuck, even braces mandatory semikolony! Robotboy enough drain Harry, it looks pathetic.

@Noiwex
Contributor
Noiwex commented Jul 13, 2014

That's intended only for robotboy

@robotboy655
Collaborator

I don't know why he did it, but I like it more than Lua default syntax personally, and it's not about reasoning for the C-style stuff to exist, it's about keeping the code in PRs consistent with code base.

@Noiwex
Contributor
Noiwex commented Jul 13, 2014

Don't be a prick and don't force.

@robotboy655
Collaborator

That how collaborative coding works, I am sorry if you don't like it, but you'll have to comply.

@Noiwex
Contributor
Noiwex commented Jul 13, 2014

You're turning away from the topic.

@robotboy655
Collaborator

Stop, nothing is going to change.

@Noiwex
Contributor
Noiwex commented Jul 13, 2014

There's no document stating that THIS EXACT CODE STYLE should be maintained. Work of committers is free and it shouldn't be rejected by vague reasons. Are we trying to make mod better or just bitch around like "gArRy'S PrEciOuS sYnTaX oMG iM SO LOVIN IT". Wake up.

@robotboy655
Collaborator

I guess if matters THAT much to you, I should add contributing.md that specifically states which coding style your PRs should use.

@Noiwex
Contributor
Noiwex commented Jul 13, 2014

That would be a document made by you, you're only moderator here and have no authority.

@HandsomeMatt
Contributor

Vinh should make the contributing.md
On 13 Jul 2014 22:08, "Noah W." notifications@github.com wrote:

That would be a document made by you, you're only moderator here and have
no authority.


Reply to this email directly or view it on GitHub
#707 (comment).

@robotboy655
Collaborator

@Noiwex, You are wrong.
@HandsomeMatt, Does it matter? He can always make changes to it.

@HandsomeMatt
Contributor

Changing coding styles in the contributing.MD would completely defeat the
purpose of it.
On 13 Jul 2014 22:10, "robotboy655" notifications@github.com wrote:

@Noiwex https://github.com/Noiwex, You are wrong.
@HandsomeMatt https://github.com/HandsomeMatt, Does it matter? He can
always make changes to it.


Reply to this email directly or view it on GitHub
#707 (comment).

@Noiwex
Contributor
Noiwex commented Jul 13, 2014

@robotboy655, one sentence with no real evidence of you carrying exclusive privilege on deciding what kind of code there should be

@Noiwex
Contributor
Noiwex commented Jul 13, 2014

@robotboy655 are you 13 or something

@Capster
Capster commented Jul 13, 2014

@robotboy655 You're just a fool, how can you try to pose yourself as hot shit so hard? You have one job — sort issues and requests. You even fail at that! Stop being so arrogant. Why can't you just do it - fix all that shit, that garry made and make it look nice? I'm also informed about you saying that having a bit more FPS is not important anymore ._. Despite the game (where you have 10-15 FPS at most btw), how can you fuck up Lua, uglify it into CPP? Alright, let's also introduce constructors and destructors (GLib style).

P.S. Your counter-arguments are piece of turd.

@robotboy655
Collaborator

@Noiwex , Just shut up already.
@HandsomeMatt, Fair enough.
@Capster, I am not posing as anybody, I am trying to tell you that you gotta keep the code consistent with code base, is that too hard to understand? I didn't make the changes to Lua, don't blame me for it.

I never said "having a bit more FPS is not important". And I think I know a little better how much FPS I have.

@TylerB260

@robotboy655 "Are you an idiot?"

oh boy

@Capster
Capster commented Jul 13, 2014

@robotboy655, really?
[12.07.2014 15:41:25] Rubat: [12 июля 2014 г. 15:39] XXX:

<<< local _R = debug.getregistry() local Forward = _R.Angle.Forward
мягко говоря это по шустрее будетна улице 2014, вы серьёзно досих пор гоняетесь за каждым кадром?

@robotboy655
Collaborator

Really, that wouldn't give a few FPS.

@Capster
Capster commented Jul 13, 2014

@robotboy655
Nevertheless, it doesn't change one fact: you strongly think, that code optimization is unnecessary.

@Bo98
Contributor
Bo98 commented Jul 13, 2014

How did we get from code style to code optimisation?

@neico
Contributor
neico commented Jul 14, 2014

How about closing this PR or merging it already ( seeing as the PR creator didn't do anything to satisfy your requirement I'd say close it, simple as that ), this entire conversation is way out of bounds for this little PR, get this kind of stuff on the FP forums if you have the desire to continue with this, please...

@0tt
Contributor
0tt commented Jul 14, 2014

What was the requirement? I believe I fixed everything Robotboy demanded. The garrycode was re-added when I fixed the flaw with keys.

@neico
Contributor
neico commented Jul 14, 2014

Then I can't understand why this hasn't be merged yet and closed off this senseless conversation...

@garrynewman
Owner

Daddy is home. I'm banning everyone that was a prick to Robot. He has authority here. Pull Requests should obviously match the style of the existing codebase, this is day 1 shit. If you want to argue about that, do it on the forums where it probably won't get you banned.

@garrynewman garrynewman merged commit 72ffb70 into garrynewman:master Jul 14, 2014
@0tt 0tt deleted the unknown repository branch Jul 18, 2014
@Divran
Contributor
Divran commented Dec 25, 2014

This doesn't work for numerical arrays. Reason:

local t = {} for i=1,100 do t[i] = i end PrintTable(t)

The results (results shortened)

1   =   1
10  =   10
100 =   100
11  =   11
[...]
19  =   19
2   =   2
20  =   20
[...]
59  =   59
6   =   6
60  =   60
[...]
69  =   69
7   =   7
70  =   70
[...]
@Divran
Contributor
Divran commented Dec 25, 2014

Revert this pull request: #845

EDIT: Robot has a better solution.

@0tt
Contributor
0tt commented Dec 25, 2014

You could've fixed the 1 offending line instead of nuking the whole thing
without warning.
if type(a) == "number" and type(b) == "number" then return a < b else return tostring(a) < tostring(b) end

@robotboy655
Collaborator

@DaaOtt, it is being taken care of, don't worry.

@Divran
Contributor
Divran commented Dec 25, 2014

@DaaOtt it's a pull request, nothing was nuked. Also what Robot said

@0tt
Contributor
0tt commented Dec 25, 2014

Yeah sorry I just woke up

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment