Slava Mednonogov ([info]copperfeet) wrote,
@ 2006-02-10 19:46:00
Previous Entry  Add to memories!  Tell a Friend!  Next Entry
Всё, С++ больше не актуален..

The March of Progress
------------------------

1980: C
printf("%10.2f", x);

1988: C++
cout << setw(10) << setprecision(2) << showpoint << x;

1996: Java
java.text.NumberFormat formatter =
java.text.NumberFormat.getNumberInstance();
formatter.setMinimumFractionDigits(2);
formatter.setMaximumFractionDigits(2);
String s = formatter.format(x);
for (int i = s.length(); i < 10; i++)
System.out.print(' ');
System.out.print(s);

2004: Java
System.out.printf("%10.2f", x);



(Post a new comment)


[info]_wat_
2006-02-10 04:50 pm UTC (link)
Си++ поддерживает форамат 1980 года, который всё ещё "эффекивнее" Джавы 2004-го :)

(Reply to this) (Thread)


[info]copperfeet
2006-02-10 05:02 pm UTC (link)
Просто основное преимущество С/C++ теперь появилось и в Java :)
p.s. а про аромат 1980-ого - это ты хорошо сказал :))

(Reply to this) (Parent)


[info]aruslan
2006-02-10 06:18 pm UTC (link)
Неужто Java уже умеет и так:
int i;
sscanf(mtext+n,"%[^a-zA-Z0-9 ]%[a-zA-Z0-9 ]%n",buf0,buf1,&i);
?!

(Reply to this) (Parent)(Thread)


[info]copperfeet
2006-02-13 09:48 am UTC (link)
Обработка регулярных выражений входит в стандарт языка с 2002 года, вроде бы (v1.4). Так что тут С++ вообще не при делах :)
http://itc.ua/article.phtml?ID=12683

(Reply to this) (Parent)(Thread)


[info]aruslan
2006-02-13 06:43 pm UTC (link)
Слав, ты прям как неродной.
Регэкспы это легко и непринуждённо.
Речь шла именно о scanfах ;)

(Reply to this) (Parent)


[info]di_halt
2006-02-10 06:52 pm UTC (link)
Бгыгыы :)))))))) Точно точно!

(Reply to this)


[info]tepexob
2006-02-10 07:26 pm UTC (link)
гы :))

(Reply to this)


[info]iskatel
2006-02-10 08:59 pm UTC (link)
Настаиваю, что ява на десктопе - жуткое извращение.
Совершенно дикий расход памяти ява-машиной (100-150М даже на скромное приложение) вкупе с проблемностью разграничения доступа в системе и на выход в сеть, если ява-программ больше одной.

(Reply to this)


[info]thims
2006-02-14 02:58 pm UTC (link)
2002: .NET
System.Console.Write("{0:f2}", x);

(Reply to this) (Thread)


[info]copperfeet
2006-02-14 03:01 pm UTC (link)
Угу. В С++ больше нет необходимости.

(Reply to this) (Parent)


Create an Account
Forgot your login or password?
Login w/ OpenID
English • Español • Deutsch • Русский…