Author Topic: deleted  (Read 9427 times)

acbaile

  • Newbie
  • *
  • Posts: 22
    • View Profile
deleted
« on: September 22, 2018, 03:54:39 AM »
deleted
« Last Edit: January 27, 2019, 09:14:42 PM by acbaile »

bas

  • Full Member
  • ***
  • Posts: 220
    • View Profile
Re: Cumbersome of struct-functions
« Reply #1 on: September 24, 2018, 12:28:14 PM »
Yes, good one. The choice is between 2 sides:
  • C-style: all arguments are explicitt.
  • C++ style: the 'this' argument is implicit.

Both have advantages:
C: allows developer to name 'this' variable
C: does not beak C model of implicit stuff
C++: less typing

In the end, the not breaking of the C model was the most important one..

lerno

  • Full Member
  • ***
  • Posts: 247
    • View Profile
Re: Cumbersome of struct-functions
« Reply #2 on: October 17, 2018, 11:34:28 PM »
The explicit argument is fine, the only thing I'm not sure of is the dot separator because at a glance I read that as accessing a variable.

I've thought of using the :: separator of C++:
Code: [Select]
func void Point::add(Point* p, i32 x) {
   p.x = x;
}

This adds quite a bit of readability for me.

bas

  • Full Member
  • ***
  • Posts: 220
    • View Profile
Re: Cumbersome of struct-functions
« Reply #3 on: October 18, 2018, 08:56:12 PM »
What did you study? Arts? A + is simply a +.