- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
<ul class="news-list">
<?php
global $news_list_toc;
foreach ($news_list_toc as $i => $d) {
echo <<<NI_ITEM
<li class="news-list-item">
<div class="news-list-item-date">
{$d['date']}
</div>
<div class="news-list-item-title">
<a href="?fetch=news&with=the&id={$i}">{$d['title']}</a>
</div>
</li>
NI_ITEM;
} ?>
</ul>
Нашел при рефакторинге своего проекта. Чем, чем я думал, когда писал это? У нормальных людей такого органа кажется и нету...
Показывать на собеседованиях с вопросом "что вам нравится в этом коде?"
Arris 02.08.2018 13:28 # −1
HighVoltageCock 02.08.2018 13:56 # −2
guest8 02.08.2018 14:28 # −999
guest8 02.08.2018 14:32 # −999
vistefan 02.08.2018 14:35 # −1
“<?php” and “echo”
guest8 02.08.2018 14:50 # −999
guest8 02.08.2018 14:53 # −999
vistefan 02.08.2018 14:55 # −1
roskomgovno 03.08.2018 02:30 # 0
I have strong feeling that view should be UI-agnostic as much, as possible. One may use REST or HTML or PDF to "render" stuff, so you should not have HTML hardcoded into your templaes
vistefan 20.08.2018 11:02 # 0
roman-kashitsyn 20.08.2018 11:04 # 0
vistefan 20.08.2018 11:10 # 0
I told more about web programming, what is a bright example for html-independent templating. All DSL's and templaters I know only allows programmer to express his thoughts in terms of html tags and subtemplates.
roman-kashitsyn 22.08.2018 15:51 # 0
In real life almost nobody cares about this when developing a website. Because when you print something, you don't want to include most of the stuff you usually see on the webpage, so you'll need a customized view of the page anyway. I don't see any problem with having specific templates for different presentations of the same data.
See also: Pandoc[6]
vistefan 22.08.2018 15:57 # 0
¹ like this (isn't it pretty?)
² https://en.wikipedia.org/wiki/Compose_key
roman-kashitsyn 22.08.2018 16:09 # 0
À bientôt.
guest8 23.08.2018 01:51 # −999
guest8 23.08.2018 13:25 # −999
guest8 22.08.2018 16:28 # −999
CHayT 23.08.2018 00:17 # +1
Stefan 23.08.2018 00:33 # 0
guest8 23.08.2018 00:41 # −999
1024-- 23.08.2018 11:12 # +1
> highest standard for typographic and readability
> like this (isn't it pretty?)
Footnotes, references and bibliography items decrease readability. They add extra symbols to read and prevent one from straigthforward reading. One can't focus on reading and has to traversing a book graph.
Moving focus point for a reader is like random access reading for a HDD. Sequentional reading is easier and faster.
I believe authors should think about their readers' experiences and make the linearest book they can. (e.g. "Learn You a Haskell for Great Good")
The only case the graph text structure is appropriate is wiki pages and stackoverflow-like sites for fast googling.
roman-kashitsyn 23.08.2018 11:30 # 0
You're not obligated to read footnotes, they just provide additional information that will distract you from the main idea if you inline this information in the main sentence. You don't need to read the footnotes in order to understand the topic.
> Sequentional reading is easier and faster.
You must be enjoying reading minimized JS files. So sequental, very readable.
No, it's not. One huge blob of text is the hardest thing to read and navigate. That's why we have tables of contents, headers, paragraphs and bullets. That's why we build filesystems to use our HDDs. When you have a list of bullets, you can skip through them quickly and understand boundaries of ideas better.
The optimal structure really depends on what you read though.
• If it's fiction, simple chapters filled with blobs will do just fine.
• If it's a man page, you'll use a lot of headers, lists and small paragraphs.
• If it's a technical book, you'll have to use a lot references, indices, and a proper table of contents.
1024-- 23.08.2018 12:18 # 0
> No, it's not. One huge blob of text is the hardest thing to read and navigate. That's why we have tables of contents, headers, paragraphs and bullets.
> That's why we build filesystems to use our HDDs.
Sequentional reading does not require lack of structure. Reading the file you want to read is a typical action.
Headers and chapters do increase readability. But they are also printed in a certain order that provides one the ability of reading sequentionally. So one can read arbitrary subsequences.
It's bad when the order of printing is not enough. The number of these cases should be decreased.
> You're not obligated
> If it's a technical book, you'll have to use a lot references
A lot of references make it unreadable. It's a torture when the author kindly asks one to turn 100500 pages to see some formulae they could print several times. The book "Learn You a Haskell for Great Good" mentioned above could have a lot of cross references to some code snippets. But they just printed them again that makes the book great.
vistefan 23.08.2018 14:10 # 0
1024-- 23.08.2018 14:55 # 0
You time is still linear. So you have to choose your personal order if there is no one.
There are two ways: to traverse it piece after piece (beginning -> end) and to learn some basics and go deeper and deeper (top -> bottom). The author could choose one of the ways and provide us some default order.
The second way is OK for complicated things. 5 minute tutorial + a linear book + a huge highly referenced database for occasional access would be enough. The book could be just an ordered subset of the database.
1024-- 23.08.2018 12:40 # 0
I would like to mention that the numbers we use are 0% of all the numbers having finite representation that in turn are 0% of real numbers. But we still don't reject mathematics.
Books are meant to be readable and educating. One should consider going beyond the standards to make reading simpler.
guest8 23.08.2018 13:18 # −999
1024-- 23.08.2018 14:59 # 0
guest8 23.08.2018 20:29 # −999
guest8 23.08.2018 20:53 # −999
guest8 23.08.2018 21:09 # −999
guest8 23.08.2018 22:09 # −999
Barak_Obama 23.08.2018 23:09 # 0
guest8 24.08.2018 01:47 # −999
vistefan 23.08.2018 13:02 # 0
Such things like hyperlinks are never a part of linear text. Nobody reads them. They just interrupt you while reading and you're in good luck if link is something you need, else it is just a mess in the middle of text. Unlike it, list of references gives you linearity of reading and completeness of information at the same time. It also gives you ability to return back later and see all links in common, without of searching it all over the text.
A couple of weeks ago here we discussed videos vs. blog-posts, mentioning that videos are hard to link and poorly structured and searchable.
> The only case…
Probably, you're right, and I think one should make this kind of text. What is more informative, reusable, relevant, searchable and instructive, pretty linear “What a boat-hook)))” or a post full of references combined in list?
1024-- 23.08.2018 14:36 # 0
The order of references list results from the order of their appearance in the text. You cannot use either when reading the whole books or when reading only the quoted text.
> What is more informative, reusable, relevant, searchable and instructive, pretty linear “What a boat-hook)))” or a post full of references combined in list?
I'm sure the first one is better. It's understandable, fast to read, the linearest possible. It's being unambiguous makes it easier to find.
Desktop 23.08.2018 14:13 # 0
roskomgovno 02.08.2018 18:27 # −1
guest8 02.08.2018 18:34 # −999
roskomgovno 02.08.2018 18:37 # −1
зы: была слаба на хередок
guest8 02.08.2018 18:45 # −999
roskomgovno 02.08.2018 18:46 # −1
HighVoltageCock 02.08.2018 18:54 # +2
LinuxGovno 02.08.2018 19:06 # −1
HighVoltageCock 02.08.2018 19:09 # 0
roskomgovno 02.08.2018 19:09 # −1
зы: что такое context?
HighVoltageCock 02.08.2018 19:17 # 0
Ну, а нахуй мне "Android Studio" с её перегруженным интерфейсом?
>>>"что такое context?"
Пёс его знает. Для меня, не смыслящего в "Java", это некая поебень, которая мешает компилировать проект и проблемы с которой решаются путём прописывания "getApplicationContext()", ничего для меня не значащего.
roskomgovno 02.08.2018 19:21 # −1
>>getApplicationContext
Это часть Android SDK, а не джавы как таковой
HighVoltageCock 02.08.2018 19:29 # 0
roskomgovno 02.08.2018 19:32 # −1
HighVoltageCock 02.08.2018 19:34 # 0
roskomgovno 02.08.2018 19:35 # −1
XYPO3BO3 16.11.2019 18:42 # 0
Но почему тогда ты плачешь? Почему тогда ты плачешь?
guest8 16.11.2019 21:22 # −999
roskomgovno 02.08.2018 19:15 # −1
Вообще язык пхп старается всегда быть максимально вербозным, чтобы программисту надо было писать как можно больше букв.
Сравни, например, с питоном
пых
HighVoltageCock 02.08.2018 19:19 # 0
roskomgovno 02.08.2018 19:19 # −1
Сразу могу сказать что не нужно. Ненужны
1) слово function
2) слово extends
3) доллар
4) оператор new
5) стрелочка
HighVoltageCock 02.08.2018 19:21 # 0
Вам, быдлу, насчёт ООП хорошо промыли черепицу.
roskomgovno 03.08.2018 02:31 # 0
This example has nothing to do with OOP, it is about how PHP is verbose without of any good reason.
guest8 02.08.2018 19:22 # −999
guest8 02.08.2018 19:23 # −999
guest8 02.08.2018 19:34 # −999
roskomgovno 02.08.2018 19:55 # −1
Для программы из двух файлов
foo.html
foo.py
guest8 02.08.2018 20:05 # −999
HighVoltageCock 02.08.2018 20:15 # 0
roskomgovno 02.08.2018 20:37 # −1
roskomgovno 02.08.2018 20:37 # −1
guest8 02.08.2018 21:12 # −999
roskomgovno 03.08.2018 02:27 # 0
Even with Py2 you may use format, which is good enough to solve this problem.
666_N33D135 02.08.2018 19:27 # −1
roskomgovno 02.08.2018 19:35 # −1
HighVoltageCock 02.08.2018 19:38 # 0
roskomgovno 02.08.2018 19:40 # −1
guest8 02.08.2018 19:38 # −999
guest8 02.08.2018 19:40 # −999
guest8 02.08.2018 19:40 # −999
roskomgovno 02.08.2018 19:40 # −1
guest8 02.08.2018 19:41 # −999
roskomgovno 02.08.2018 19:55 # −1
guest8 02.08.2018 19:42 # −999
HighVoltageCock 02.08.2018 19:43 # 0
guest8 02.08.2018 19:38 # −999
roskomgovno 02.08.2018 20:38 # −1
vadik 25.08.2021 21:15 # 0