IT And ApplicationsUnit 818 min read
Programming Languages & Contemporary Tech: Types, Evolution & Business Use
Unit 8 of IT And Applications covers programming language classifications (procedural, OOP, scripting), contemporary technologies (AI, blockchain, IoT), and their real-world applications in Nepalese businesses like eSewa (APIs) and Daraz (cloud computing). Includes syntax examples, comparison tables, and exam-focused w
TAKEAWAYS:
- Programming languages are classified by paradigm (procedural, OOP, functional) and generation (low-level to high-level), each suited for specific tasks (e.g., C for systems, Python for scripting).
- Contemporary technologies like AI, blockchain, and cloud computing solve real business problems (e.g., Ncell’s chatbots use NLP, Daraz’s inventory uses IoT sensors).
- Syntax differences matter:
printf()in C vs.print()in Python highlight how language design affects readability and performance. - Worked examples tie theory to practice (e.g., calculating loan interest in Python vs. SQL for a bank’s TPS).
- Exam focus: Define terms precisely (e.g., "scripting language" vs. "compiled language") and link technologies to business cases (e.g., "How does blockchain secure eSewa transactions?").
- Visuals first: Every concept has a diagram—from language evolution timelines to blockchain transaction flows.
1. Programming Languages: Definitions and Classifications
Programming languages are the instructions computers follow to perform tasks. They are classified based on:
- Paradigm (how code is structured),
- Generation (level of abstraction),
- Usage (general-purpose vs. domain-specific).
1.1 Classification by Paradigm
Programming paradigms define how a program is structured and executed. The three primary paradigms are:
| Paradigm | Key Feature | Example Languages | Use Case | Advantages | Disadvantages |
|---|---|---|---|---|---|
| Procedural | Code organized as procedures/functions | C, Pascal, Fortran | System programming, embedded systems | Fast execution, low-level control | Hard to maintain for large projects |
| Object-Oriented (OOP) | Code organized as objects (data + methods) | Java, Python, C++ | GUI apps, large-scale systems | Modularity, reusability, scalability | Steeper learning curve |
| Functional | Code as mathematical functions (no state changes) | Haskell, Lisp, Scala | Data processing, concurrent systems | Predictability, easier testing | Limited for I/O-heavy tasks |
| Scripting | Interpreted, glue code for other tools | Python, JavaScript, Bash | Automation, web development | Rapid prototyping, easy to learn | Slower execution |
1.2 Classification by Generation
Languages are also categorized by their abstraction level from machine code:
| Generation | Type | Example | Key Traits | Business Use |
|---|---|---|---|---|
| 1st Gen | Machine Code | Binary (0s/1s) | Direct CPU instructions | Rarely used today (embedded systems) |
| 2nd Gen | Assembly | x86 Assembly | Mnemonic codes (e.g., MOV, ADD) |
Firmware, OS kernels |
| 3rd Gen | High-Level | C, Java, Python | English-like syntax, compiled/interpreted | Most business applications |
| 4th Gen | Very High-Level | SQL, Python | Problem-oriented (e.g., SELECT *) |
Database queries, automation |
| 5th Gen | Natural Language | Prolog, AI tools | Understands human-like commands | Chatbots, expert systems |
Worked Example: Procedural vs. OOP in a Bank Loan Calculator
Procedural (C):
float calculateInterest(float principal, float rate, int years) { return principal * rate * years / 100; }Used in legacy banking systems for speed.
OOP (Python):
class Loan: def __init__(self, principal, rate): self.principal = principal self.rate = rate def calculate_interest(self, years): return self.principal * self.rate * years / 100Used in modern apps like NMB Bank’s mobile app for modularity.
2. Contemporary Technologies Enhancing Business Performance
These technologies automate, secure, or optimize business operations. Nepalese companies use them in creative ways:
2.1 Artificial Intelligence (AI) and Machine Learning (ML)
Definition: AI enables machines to learn and make decisions like humans. ML is a subset where systems improve with data.
Real-World Examples in Nepal:
- eSewa: Uses NLP (Natural Language Processing) to understand voice commands for bill payments.
- Ncell: Deploys chatbots (AI-powered) to handle customer queries 24/7.
- Daraz: Recommends products using collaborative filtering (ML algorithm).
How It Works:
sequenceDiagram
participant User
participant AI_Model
participant Database
User->>AI_Model: "Ask: What’s my loan eligibility?"
AI_Model->>Database: Fetch user data (income, credit score)
Database-->>AI_Model: Data
AI_Model->>AI_Model: Run ML algorithm
AI_Model-->>User: "Eligible for Rs. 5,00,000 at 8% interest"Advantages:
- Reduces human error (e.g., fraud detection in Khalti).
- Personalizes user experience (e.g., Pathao’s dynamic pricing).
Disadvantages:
- High initial cost (e.g., training ML models for NTC’s traffic prediction).
- Requires large datasets (challenging for small Nepalese firms).
2.2 Blockchain Technology
Definition: A decentralized, tamper-proof ledger that records transactions across multiple computers.
Real-World Example in Nepal:
- eSewa: Uses blockchain to secure payment transactions between users and service providers (e.g., electricity bills).
- Nepal Rastra Bank (NRB): Exploring blockchain for cross-border remittances (e.g., money sent from India to Nepal).
How It Works:
flowchart TD
A["Transaction Initiated<br/>(e.g., Rs. 1000 to NTC)"] --> B["Block Created<br/>(Contains data + timestamp)"]
B --> C["Broadcast to Network<br/>(Nodes validate)"]
C --> D["Consensus Achieved<br/>(Proof-of-Work/Stake)"]
D --> E["Block Added to Chain<br/>(Permanent record)"]
E --> F["Transaction Confirmed<br/>(eSewa updates balance)"]Advantages:
- Immutable: Cannot alter past transactions (prevents fraud in NEPSE).
- Transparent: All parties see the same data (useful for supply chain tracking in Daraz).
Disadvantages:
- Slow transaction speeds (not ideal for high-frequency trading).
- High energy consumption (environmental concerns).
Worked Example: eSewa’s Blockchain for Bill Payments
- User pays Rs. 500 for electricity via eSewa app.
- Transaction is grouped into a block with other payments.
- Nodes (computers) validate the block using cryptographic hashing.
- Block is added to the eSewa blockchain, and NTC’s system updates the user’s bill status.
2.3 Internet of Things (IoT)
Definition: A network of physical devices embedded with sensors, software, and connectivity to exchange data.
Real-World Example in Nepal:
- NTC Smart Meters: IoT-enabled meters automatically send electricity usage data to NTC, reducing manual reading errors.
- Daraz Warehouses: IoT sensors track inventory levels in real-time (e.g., low stock alerts for "iPhone 15").
How It Works:
flowchart LR
A["IoT Device<br/>(e.g., Smart Meter)"] -->|"Sensors"| B["Collect Data<br/>(Temperature, Usage)"]
B --> C["Send to Cloud<br/>(NTC Server)"]
C --> D["Analyze<br/>(ML predicts demand)"]
D --> E["Trigger Action<br/>(Send bill or restock)"]Advantages:
- Real-time monitoring (e.g., Ncell’s network towers adjust traffic dynamically).
- Cost savings (e.g., NTC reduces wastage by detecting power theft via IoT).
Disadvantages:
- Privacy risks (e.g., hacking smart home devices in Kathmandu).
- High setup cost for small businesses.
2.4 Cloud Computing
Definition: On-demand access to computing resources (servers, storage, databases) over the internet.
Real-World Example in Nepal:
- Daraz: Uses AWS cloud to handle Black Friday traffic (scales servers automatically).
- Khalti: Stores customer data on Google Cloud for security and backup.
Service Models:
| Model | Description | Example Use in Nepal |
|---|---|---|
| IaaS | Rent virtual machines (e.g., AWS EC2) | Hosting a Pathao driver app server |
| PaaS | Platform for app development (e.g., Heroku) | eSewa’s backend services |
| SaaS | Ready-to-use software (e.g., Google Workspace) | NMB Bank’s online banking |
Advantages:
- Scalability: Daraz’s cloud servers add capacity during sales.
- Cost-effective: No need to buy physical servers (saves money for small fintech startups).
Disadvantages:
- Dependence on internet (problematic in rural Nepal).
- Data security concerns (e.g., Khalti’s customer data must be encrypted).
Worked Example: Daraz’s Cloud Strategy During Black Friday
- Normal Day: Uses 100 servers.
- Black Friday: Cloud auto-scales to 1000 servers to handle 10x traffic.
- Post-Sale: Servers scale down to save costs.
2.5 Big Data Analytics
Definition: Processing large datasets to extract insights for decision-making.
Real-World Example in Nepal:
- NTC: Uses big data to predict power outages based on weather and usage patterns.
- Ncell: Analyzes call data to optimize network towers in Kathmandu.
How It Works:
flowchart TD
A["Data Sources<br/>(Calls, Bills, Social Media)"] --> B["Data Storage<br/>(Hadoop, AWS S3)"]
B --> C["Data Processing<br/>(Spark, Hive)"]
C --> C["Data Analysis<br/>(Machine Learning)"]
C --> D["Visualization<br/>(Dashboards)"]
D --> E["Business Decisions<br/>(e.g., 'Build a tower in Lalitpur')"]Advantages:
- Predictive insights (e.g., NEPSE forecasts stock trends).
- Customer personalization (e.g., Daraz recommends products).
Disadvantages:
- High expertise required (few Nepalese firms have data scientists).
- Privacy laws (e.g., Khalti must comply with Nepal’s data protection act).
3. Programming Languages in Contemporary Technologies
Each technology prefers specific languages based on performance, ease of use, and scalability.
| Technology | Preferred Languages | Why? | Nepalese Example |
|---|---|---|---|
| AI/ML | Python, R | Rich libraries (TensorFlow, PyTorch) | Ncell’s chatbot (Python) |
| Blockchain | Solidity (Ethereum), Python | Smart contracts, cryptography | eSewa’s payment ledger (Python) |
| IoT | C, Python, JavaScript | Low power consumption, ease of prototyping | NTC smart meters (C) |
| Cloud Computing | Python, Java, Node.js | Scalability, serverless functions | Daraz’s AWS backend (Node.js) |
| Big Data | Java, Scala, Python | High performance for large datasets | NTC’s Hadoop cluster (Java) |
Worked Example: Writing a Blockchain in Python
import hashlib
class Block:
def __init__(self, data, previous_hash):
self.data = data
self.previous_hash = previous_hash
self.hash = self.calculate_hash()
def calculate_hash(self):
return hashlib.sha256(f"{self.data}{self.previous_hash}".encode()).hexdigest()
# Create a blockchain
blockchain = []
blockchain.append(Block("Transaction 1: Rs. 1000 to NTC", "0"))
# Add a new block
new_block = Block("Transaction 2: Rs. 500 to Khalti", blockchain[-1].hash)
blockchain.append(new_block)
print("Blockchain:", [block.hash for block in blockchain])
Output:
Blockchain: ['a1b2c3...', 'd4e5f6...']
Used in eSewa’s prototype for secure transactions.
4. Choosing the Right Technology for Business Needs
Not all technologies fit every business. Here’s how to decide:
Decision Factors:
- Budget: IoT sensors (Rs. 50,000+) vs. cloud (pay-as-you-go).
- Expertise: Python for AI is easier than Solidity for blockchain.
- Use Case:
- Small business (e.g., local shop): Use Python + cloud for inventory.
- Bank (e.g., NMB): Use blockchain + Java for secure loans.
## In the Real World
eSewa’s API Integration
- Technology: Programming Languages (Python, JavaScript) + Cloud (AWS)
- How it works: eSewa’s backend uses Python (Django) to handle payments and JavaScript (React) for the frontend. When you pay a bill, the API calls NTC’s server (via REST API) to update records.
- Why it matters: Without APIs, eSewa couldn’t connect to NTC, Ncell, or Khalti systems.
Daraz’s Inventory Management with IoT
- Technology: IoT Sensors + Python (for data processing)
- How it works: Warehouses use RFID tags (IoT) to track stock. When inventory drops below a threshold, a Python script auto-generates a restock order.
- Why it matters: Reduces stockouts (e.g., during Diwali sales) and overstocking (saves Rs. millions).
Ncell’s AI-Powered Customer Support
- Technology: NLP (Python) + Cloud (Google Cloud)
- How it works: When you call Ncell’s toll-free number, an AI chatbot (built with Python’s NLTK library) first tries to resolve your query. If it fails, it routes you to a human agent.
- Why it matters: Cuts customer wait time by 40% and reduces costs (fewer agents needed).
NTC’s Smart Grid with Big Data
- Technology: IoT Meters + Hadoop (Java) + Python (for analytics)
- How it works: Smart meters send real-time data to NTC’s servers. A Python script analyzes usage patterns to predict peak hours and adjust power distribution.
- Why it matters: Prevents blackouts during festivals (e.g., Dashain) and reduces power theft.
Khalti’s Blockchain for Secure Transactions
- Technology: Blockchain (Python) + Smart Contracts
- How it works: When you transfer Rs. 5000 to a friend, the transaction is recorded in a block and added to Khalti’s blockchain. This ensures no fraud (e.g., double-spending).
- Why it matters: Builds trust in digital payments (critical for Nepal’s cash-heavy economy).
## Exam Tip
This unit is conceptual but applied. Examiners test:
- Definitions: Know the exact difference between:
- Procedural vs. OOP languages.
- Compiled vs. interpreted languages.
- AI vs. ML vs. Deep Learning.
- Real-World Links: Always connect theory to Nepalese examples:
- "How does Daraz use cloud computing?" → Auto-scaling during sales.
- "Explain blockchain in eSewa." → Secure, tamper-proof payment records.
- Code Snippets: Be ready to write short code examples (e.g., a Python class for OOP or a blockchain block).
- Comparison Tables: Memorize advantages/disadvantages of technologies (e.g., IoT vs. cloud for NTC).
- Diagrams: Draw flowcharts for:
- How AI chatbots work (Ncell).
- Blockchain transaction steps (eSewa).
- Cloud service models (Daraz).
Common Mistakes to Avoid:
- ❌ Saying "AI is the same as ML" (ML is a subset of AI).
- ❌ Forgetting Nepalese examples (examiners love eSewa, Ncell, Daraz).
- ❌ Writing long essays without bullet points or diagrams (use tables for comparisons).
Sample Exam Question & Answer: Q: "Explain any five contemporary technologies used in Nepalese businesses, highlighting their programming language requirements." A:
AI in Ncell Chatbots
- Tech: NLP (Python with libraries like
NLTKorspaCy). - Use: Handles 60% of customer queries automatically.
- Code Example:
from nltk.chat.util import Chat chatbot = Chat([("hi", ["Hello!", "Hey there!"])]) print(chatbot.respond("hi")) # Output: "Hello!"
- Tech: NLP (Python with libraries like
Blockchain in eSewa
- Tech: Python (for smart contracts) + Solidity (for Ethereum-based ledgers).
- Use: Secures transactions between users and service providers.
- Diagram: Draw a blockchain flow (as shown earlier).
IoT in NTC Smart Meters
- Tech: C (for embedded systems) + Python (for cloud analytics).
- Use: Reduces manual meter reading by 90%.
Cloud Computing in Daraz
- Tech: Node.js (for backend) + AWS.
- Use: Handles 10x traffic during Black Friday.
Big Data in NEPSE
- Tech: Java (Hadoop) + Python (Pandas).
- Use: Predicts stock market trends.
Marks Distribution:
- Definition (1 mark): Correctly name the tech (e.g., "AI").
- Nepalese Example (2 marks): Link to a real company (e.g., "Ncell").
- Programming Language (1 mark): Specify the language (e.g., "Python").
- Use Case (2 marks): Explain how it’s applied (e.g., "chatbots").
- Diagram/Code (2 marks): Draw a flowchart or write a snippet.
Final Checklist Before Exam: ✅ Can you define procedural, OOP, and functional languages? ✅ Can you compare AI, ML, and blockchain with a table? ✅ Can you draw a blockchain transaction flow? ✅ Can you write a Python class for OOP or a simple blockchain block? ✅ Can you link every tech to a Nepalese business (eSewa, Ncell, Daraz, etc.)?
Based on the TU BBA syllabus for IT And Applications (IT231), unit 8.
Discussion
Loading…