Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
プログラムのスタート地点はどこなのか?
Search
Satoshi Kaneyasu
May 29, 2024
Programming
1
120
プログラムのスタート地点はどこなのか?
すごい広島 IT初心者の会[86]
https://pycon-hiroshima.connpass.com/event/318329/
でのLT資料です。
Satoshi Kaneyasu
May 29, 2024
Tweet
Share
More Decks by Satoshi Kaneyasu
See All by Satoshi Kaneyasu
変化の激しい時代における、こだわりのないエンジニアの強さ
satoshi256kbyte
1
1.2k
密集、ドキュメントのコロケーション with AWS Lambda
satoshi256kbyte
1
250
【PHP】破壊的バージョンアップと戦った話〜決断と説得
satoshi256kbyte
0
190
今更聞けないセキュリティ用語の基礎知識 2025新春
satoshi256kbyte
0
150
AWS re:Invent 2024個人的まとめ
satoshi256kbyte
0
280
今年一番支援させていただいたのは認証系サービスでした
satoshi256kbyte
1
530
おもにクラウドの話してます#4 OPスライド
satoshi256kbyte
0
68
AWS認定資格を勉強した先に何があったか
satoshi256kbyte
2
280
Amazon Aurora Serverless v2のアプデと、Amazon Aurora PostgreSQL Limitless DatabaseのGAについて
satoshi256kbyte
0
210
Other Decks in Programming
See All in Programming
Signal-Based Data FetchingWith the New httpResource
manfredsteyer
PRO
0
170
ComposeでWebアプリを作る技術
tbsten
0
110
メモリウォールを超えて:キャッシュメモリ技術の進歩
kawayu
0
1.9k
サービスクラスのありがたみを発見したときの思い出 #phpcon_odawara
77web
4
640
MCP調べてみました! / Exploring MCP
uhzz
2
2.3k
Coding Experience Cpp vs Csharp - meetup app osaka@9
harukasao
0
740
Building Scalable Mobile Projects: Fast Builds, High Reusability and Clear Ownership
cyrilmottier
2
280
Rollupのビルド時間高速化によるプレビュー表示速度改善とバンドラとASTを駆使したプロダクト開発の難しさ
plaidtech
PRO
1
170
DomainException と Result 型で作る型安全なエラーハンドリング
karszawa
0
910
AI時代の開発者評価について
ayumuu
0
140
地域ITコミュニティの活性化とAWSに移行してみた話
yuukis
0
240
Youtube Lofier - Chrome拡張開発
ninikoko
0
2.4k
Featured
See All Featured
Code Reviewing Like a Champion
maltzj
522
40k
Fontdeck: Realign not Redesign
paulrobertlloyd
83
5.5k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
VelocityConf: Rendering Performance Case Studies
addyosmani
328
24k
Building Better People: How to give real-time feedback that sticks.
wjessup
367
19k
The Invisible Side of Design
smashingmag
299
50k
It's Worth the Effort
3n
184
28k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
29
9.4k
[RailsConf 2023] Rails as a piece of cake
palkan
54
5.4k
Designing for Performance
lara
608
69k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
47
2.5k
How to Ace a Technical Interview
jacobian
276
23k
Transcript
プログラムのスタート地点は どこなのか︖ 2024.05.29 SATOSHI KANEYASU
⾃⼰紹介 ⽒名︓兼安 聡 所属︓株式会社サーバーワークス 在住︓広島(フルリモート) 担当︓DevOps、プロジェクトマネージャー 資格︓ 最近よく触るDB: Amazon DynamoDB、Amazon
Timestream、Amazon Neptune など
•⼤きなプログラムの修正はできるが、 ⼩さなプログラムをゼロから作ることはできない •エンジニアの皆様、そんなことはないでしょうか︖ •検証⽤プログラムをサッと作ってくださいと⾔われた らできますか︖ •これができるかできないかは、 エンジニアの成⻑の分岐点かもしれません はじめに
•ゼロから作れるようにはどうしたらよいか︖ •第⼀歩は 「プログラムのスタート地点はどこなのか︖」 を理解することでは︖ はじめに
•⼀定のルールがあるパターン •単純に上から流れていくパターン コンソールアプリ
•VB.Net、Javaでシンプルなコンソールアプリを書い た場合がこれにあたります。 •VB.Netでシンプルなコンソールアプリを作る場合、 Sub Mainが起点になります。 ⼀定のルールがあるパターン 厳密には.Net系はEXEを作る設定で、 起動時の関数は変えれます。 (これ変える⼈⾒たことないけど)
•起点はmain固定というわけではありません。 上から流れてmainを呼んでいるだけです。 単純に上から流れていくパターン def main(): print("Hello, World!") if __name__ ==
"__main__": main() hello.py python hello.py
•ルートページ •ルーティング Webサイトの場合
•ディレクトリ(フォルダー)にアクセスされた時、最 初に表⽰されるデフォルトのファイル •http://example.com なら、 http://example.com/index.html のこと •⼤体Webサーバーの設定依存 ルートページ
ルートページの設定 Apache <IfModule dir_module> DirectoryIndex index.html </IfModule> •複数指定したら左側が優先 <IfModule dir_module>
DirectoryIndex index.php index.html </IfModule>
•クライアントからのリクエスト(通常はURL)を 受け取り、そのリクエストに応じてサーバー上で適切 なページを返す仕組み •WordpressならどのURLを呼び出しても⼀旦⼀箇所 に集まる •その後、リクエストされたURLに応じて適切なページ を起動 ルーティング
•どのURLだとしても全てのリクエストを⼀旦 /index.phpに集約 •/index.php以降でURLに応じたページを起動 ルーティングの設定 Apacheの.htaccess RewriteEngine On RewriteBase / RewriteRule
^index¥.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L]
AWS Lambda
どうやってこういう知識を得るのか︖ •とりあえずやってみるを忘れない •写経で終わらない •新しいものに⾶びついてHello worldすることを忘れ ない •できる限りプロジェクトの初期に絡む
ありがとうございました