|
| 01 May 2016 11:56 PM |
I dislike PHP's . and Lua's ..
I like the simple standard +
|
|
|
| Report Abuse |
|
|
|
| 02 May 2016 04:09 AM |
My least favourite is defiantly JS.
var Text1 = "Hello " var Text2 = "World" var End = Text1.concat(Text2)
console.log(End)
>Hello World
That seems stupid to me. Lua's .. is probably my favourite as I learnt it first. IDK PHP so I can't comment, however I don't like the plus sign either. But I've only ever seen it in Swift and C# |
|
|
| Report Abuse |
|
|
|
| 02 May 2016 05:01 AM |
| You could use + in JS dude. |
|
|
| Report Abuse |
|
|
|
| 02 May 2016 05:37 AM |
| You're right. I've only ever used JS to do the CodeCademy course. In terms of actual use, I've only ever use Lua, Swift and limited (Very limited) amounts of C# |
|
|
| Report Abuse |
|
|
|
| 02 May 2016 06:57 AM |
I believe this to be a double edged sword. The + operator is the most common concatenation operator used across languages (that I've seen, personal anecdote here). But does it make as much sense to use + for both concatenation and addition?
Personally I like the split with a seperate operator for each, as working out the order of operations when doing arithmatic and adding to a string in a single line is a bother.
I mean, it's a very rare case which you would find issues with this (mainly when debugging sums etc.) but I still believe seperate operators is best. Unfortunately I always default to trying to just use + all the time still |
|
|
| Report Abuse |
|
|
robocu3
|
  |
| Joined: 13 Mar 2009 |
| Total Posts: 6485 |
|
|
| 02 May 2016 08:18 AM |
Probably .. Not because it's attractive, just force of habit lol
-=Robo=- |
|
|
| Report Abuse |
|
|
|
| 02 May 2016 03:35 PM |
Fair points - but I hope everyone can agree ".." is better than "." and considerably so.
|
|
|
| Report Abuse |
|
|
|
| 02 May 2016 04:49 PM |
| I think you're missing the point of preference |
|
|
| Report Abuse |
|
|
|
| 02 May 2016 04:54 PM |
| To me .. just seems cleaner than . or + |
|
|
| Report Abuse |
|
|
|
| 02 May 2016 04:56 PM |
@RightLegRed
.. is much more visible than . tho
|
|
|
| Report Abuse |
|
|
|
| 02 May 2016 05:17 PM |
Right, and I agree with you! But that is our preference, and does not reflect fact. Something like this cannot really be quanitifed to which idea is better because they can be argued from both sides sufficiently.
It is similar to arguments about case, brace spacing (to newline, or not to newline?) and variable naming conventions. Like you can say it's more visible, but someone could say why use 2 symbols to reflect one operation? Etc. Etc. |
|
|
| Report Abuse |
|
|
|
| 03 May 2016 04:17 AM |
Also . looks like you're going workspace.part
WolfgangVonPrinz for President! |
|
|
| Report Abuse |
|
|
|
| 03 May 2016 04:40 AM |
| Right that is your opinion keep it to yourself. |
|
|
| Report Abuse |
|
|
|
| 03 May 2016 07:17 AM |
>Is asked for opinion >Gives opinion >NOOOOOOB
WolfgangVonPrinz for President! |
|
|
| Report Abuse |
|
|
BanTech
|
  |
| Joined: 31 Dec 2015 |
| Total Posts: 886 |
|
|
| 03 May 2016 07:21 AM |
| php's . is best but obviously not suitable for Lua and object-oriented languages that use it to access children, properties and sub classes. |
|
|
| Report Abuse |
|
|
chimmihc
|
  |
| Joined: 01 Sep 2014 |
| Total Posts: 17143 |
|
|
| 03 May 2016 07:27 AM |
I am fine with anything that isn't already an operator in the language. I disapprove of languages that use +.
|
|
|
| Report Abuse |
|
|
KapKing47
|
  |
| Joined: 09 Sep 2012 |
| Total Posts: 5522 |
|
|
| 03 May 2016 09:36 AM |
| I personally prefer using ',' as it looks somewhat cool, but most times I need to do concatenation in tricky situations so I use '..' instead. |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 03 May 2016 10:52 AM |
+ is a terrible concatenation operator. Thats suppose to be a plus sign not an operator for strings. ".." makes much more sense. Javascript is horrible for that.
What i also find an annoying difference btween javascript and lua is that table values in js are indexed by a 0 first instead of a 1 in lua. such a pain..
|
|
|
| Report Abuse |
|
|
LockFocus
|
  |
| Joined: 31 Aug 2013 |
| Total Posts: 1044 |
|
|
| 03 May 2016 10:54 AM |
| I personally like Lua's "..". It's simple and easy to use |
|
|
| Report Abuse |
|
|
| |
|