Recent

Author Topic: Where is the implementation of WriteLn()  (Read 16347 times)

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11453
  • FPC developer.
Re: Where is the implementation of WriteLn()
« Reply #45 on: January 16, 2018, 11:06:38 pm »
Personally, I like the writeln-to-stream construct. The concatenation syntax  (and required conversion calls like inttostr and padding) is a nuisance.

rvk

  • Hero Member
  • *****
  • Posts: 6163
Re: Where is the implementation of WriteLn()
« Reply #46 on: January 16, 2018, 11:13:00 pm »
Personally, I like the writeln-to-stream construct. The concatenation syntax  (and required conversion calls like inttostr and padding) is a nuisance.
Me too. But you don't need inttostr and padding if you use the format function. That's the only upside of converting it. With format and it's variable replacement it is sometimes more readable. Sometimes :)

Thaddy

  • Hero Member
  • *****
  • Posts: 14373
  • Sensorship about opinions does not belong here.
Re: Where is the implementation of WriteLn()
« Reply #47 on: January 17, 2018, 08:14:24 am »
Note headconv (by Bob Swart, a.k.a. drBob) has always been open source. The only difference with the JEDI version is that that version is open source licensed...whereas the original is just copyrighted freeware.
Note 2: cpp-E -> h2paspp-> h2pas gives better results in most cases.

In general I use either the new formatting helpers (see my example, this is delphi compatible) or indeed writestr and lately refrain from actual classic formatting functions in newer code. Dunno why, so don't ask  O:-)
« Last Edit: January 17, 2018, 10:10:54 am by Thaddy »
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11453
  • FPC developer.
Re: Where is the implementation of WriteLn()
« Reply #48 on: January 17, 2018, 09:55:52 am »
Personally, I like the writeln-to-stream construct. The concatenation syntax  (and required conversion calls like inttostr and padding) is a nuisance.
Me too. But you don't need inttostr and padding if you use the format function. That's the only upside of converting it. With format and it's variable replacement it is sometimes more readable. Sometimes :)

I like interpretive I/O even less than concatenation, so I mostly use format only for locale strings and occasional formatting numbers in the way writeln doesn't allow.

Thaddy

  • Hero Member
  • *****
  • Posts: 14373
  • Sensorship about opinions does not belong here.
Re: Where is the implementation of WriteLn()
« Reply #49 on: January 17, 2018, 10:16:58 am »
But you don't need inttostr and padding if you use the format function. That's the only upside of converting it. With format and it's variable replacement it is sometimes more readable. Sometimes :)
Hm. that's probably why I use the type helpers for simple types so much: I like boxing (not everybody does, it is an acquired taste, like Brussels sprouts), especially the series of ToString overloads.
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

 

TinyPortal © 2005-2018