Showing posts with label Programming. Show all posts
Showing posts with label Programming. Show all posts

14 Aug 2026

The AI Code-Spitter: Why Teenagers Still Need to Learn Programming Under the Hood

you can only really use AI if you understand how code works

Everywhere you look online, people are saying programming is dead. They show you slick videos of an Artificial Intelligence (AI) model or a Large Language Model (LLM) instantly spitting out hundreds of lines of working code.
You think: "Why should a teenager or young aspirant spend years learning syntax, data types, and logic when a prompt can do it in three seconds?"
It's a fair question. But it hides a dangerous mistake.
If you only learn how to type prompts into an LLM, you are just memorizing commands and wondering why things work—or why they suddenly break. To build software that actually matters, you need to understand what happens under the hood.

The "Intern" in Your Computer

Think of an AI code generator like a highly energetic, super-fast junior intern.
The intern has read every programming book on earth, but they have zero common sense, no context about your specific project, and they suffer from extreme overconfidence. They will hand you 50 lines of code with a smile, even if that code contains catastrophic bugs or leaves your user database completely open to hackers.
An AI code-spitter does two things exceptionally well:
  • Speeds up repetitive boilerplate setup.
  • Automatically handles tricky syntax formatting (brackets, indentation, colons).
But it cannot think structurally. That is where a trained human mind comes in.

The 3 Things AI Cannot Do for You

If you don't understand programming fundamentals, you are completely at the mercy of whatever the AI spits out. Here is why code-level literacy is the ultimate power move for young developers:

1. Debugging Hallucinations

AI models don't think; they predict the next most likely word or character. Because of this, they frequently "hallucinate" functions, libraries, or logic structures that do not exist. When the code crashes with a cryptic error message, an AI-only prompter will just re-prompt helplessly. A true programmer looks at the trace log, tracks down the faulty logic path, and fixes it.

2. System Architecture

An LLM is fantastic at writing isolated functions—like a script to sort a list or generate a single web button. But software isn't just one file. It is a complex ecosystem. Connecting databases, ensuring smooth API communication over networks, and maintaining an organized Git version control tree requires systemic human architecture.

3. Security Auditing

AI will blindly write code that works on the surface but is fundamentally insecure underneath. If you don't know the basics of variables, sanitization, and encryption, you won't realize that your AI-generated app is leaking user passwords to the open web.

How to Approach Learning Right Now

The answer isn't to ignore AI, nor is it to ignore coding. It is about understanding the basic building blocks so you can direct the AI effectively.
┌────────────────────────────────────────────────────────┐
│             THE MODERN SYMBIO-DEVELOPER               │
├────────────────────────────────────────────────────────┤
│   Your Brain: Logic, Architecture, System Design       │
├────────────────────────────────────────────────────────┤
│   The AI Tool: Fast Syntax, Heavy Lifting, Boilerplate │
└────────────────────────────────────────────────────────┘
When you are starting out, use this simple workflow to stay ahead of the curve:
  • Write first, prompt second: Try to map out the problem logic using your own brain before asking a tool for a shortcut.
  • Ask the AI to teach, not just execute: Instead of prompting "Write me a login script", try prompting "Explain to me conceptually how a secure login flow works step-by-step".
  • Code review everything: Never copy-paste code you do not fully comprehend. Read every line the AI gives you, decode it, and ensure you know exactly what it is trying to achieve.
The future doesn't belong to people who can type clever prompts. The future belongs to system thinkers who look under the hood.

21 Oct 2025

Whispering to the Server: The Magic of AJAX

This is part 3. Part 2 is here

The traditional form submission we just discussed is powerful, but it feels a bit clunky by modern standards. Every time you submit, the entire page reloads. What if you just want to "like" a post, check if a username is available, or add an item to a shopping cart without losing your place on the page?

This is where AJAX comes in. 🚀

AJAX stands for Asynchronous JavaScript And XML. That's a mouthful, but let's simplify:

  • Asynchronous: It means your code can send a request to the server and not wait around for the response. It continues doing other things, and when the server replies, a function you've defined will handle it. It doesn't block the user.

  • JavaScript: Instead of the browser automatically building the request from an HTML form, you write JavaScript code to build and send the request. You have full control.

  • XML: This is a bit of a historical name. While you can use XML, today we almost exclusively use JSON for sending and receiving data with AJAX.

The key takeaway is this: AJAX lets you send and receive data from the server in the background, without a full page reload.


## How It Works: JavaScript Takes the Wheel

Let's revisit our login form, but this time, we'll supercharge it with JavaScript using the modern fetch() API.

The HTML (with a small addition):

HTML

<form id="ajax-form" action="/login" method="POST">

  <label for="username-input">Username:</label>
  <input type="text" id="username-input" name="username">

  <label for="password-input">Password:</label>
  <input type="password" id="password-input" name="password">

  <button type="submit">Log In</button>

</form>

<div id="response-message"></div>

The JavaScript Magic ✨:

JavaScript

// Get the form element from the page
const loginForm = document.getElementById('ajax-form');

// Listen for the form's 'submit' event
loginForm.addEventListener('submit', function (event) {

  // VERY IMPORTANT: Stop the default form submission (the page reload)!
  event.preventDefault();

  // Create a FormData object to easily grab the form's data
  const formData = new FormData(loginForm);
  // Convert the data to a plain JavaScript object
  const data = Object.fromEntries(formData.entries());

  // Use the fetch API to send the request
  fetch('/login', {
    method: 'POST', // We still specify the method
    headers: {
      // Tell the server we're sending JSON data
      'Content-Type': 'application/json',
    },
    // Convert our JS object into a JSON string for the body
    body: JSON.stringify(data),
  })
  .then(response => response.json()) // Parse the JSON response from the server
  .then(result => {
    // SUCCESS! Now, update the page without a reload
    const messageDiv = document.getElementById('response-message');
    messageDiv.textContent = result.message; // e.g., "Welcome back, dev123!"
  })
  .catch(error => {
    // Handle any errors that occurred during the request
    console.error('Error:', error);
    const messageDiv = document.getElementById('response-message');
    messageDiv.textContent = 'An error occurred. Please try again.';
  });
});

Here's what this JavaScript does:

  1. It "hijacks" the form's submit event.

  2. event.preventDefault(); is the crucial line that stops the browser from doing its normal page reload.

  3. It manually gathers the data from the form.

  4. It uses fetch() to create and send an HTTP request in the background. Note that we're explicitly setting the Content-Type header to application/json and converting our data to a JSON string.

  5. When the server responds (with JSON data like {"message": "Login successful!"}), the .then() block runs.

  6. Instead of reloading, our code simply takes the response message and uses JavaScript to place it inside the <div id="response-message">. The page itself never changed!


## HTML Forms vs. AJAX: The Showdown

FeatureClassic HTML Form SubmissionAJAX Request
TriggerUser clicks <button type="submit">Any JavaScript event (click, keyup, submit, etc.)
Who Builds Request?The Browser (automatically)You (via JavaScript code)
Page BehaviorFull Page Reload. The entire page is replaced.No Page Reload. The page stays, and you use JS to update parts of it.
User ExperienceCan feel slow and disruptive. 뚝딱Smooth, fast, and interactive. ✨
Typical Use CaseInitial site login, multi-page wizard processes.Likes, comments, live search, shopping carts, modern web apps.

By mastering AJAX, you move from building static web pages to creating dynamic, responsive, and modern web applications that feel like desktop software. It's a fundamental skill for any web developer today.

Your First Conversation with a Server: How HTML Forms Work

This is Part 2. Part 1 is here

So, you've learned that browsers and servers talk to each other using a language called HTTP. That's great! But how do you, as a developer, give the user a way to start that conversation? The most classic and fundamental way is by using an HTML form.

Think of an HTML form like filling out a physical postcard. 📝 You have specific fields to fill in (name, address), and when you're done, you drop it in the mailbox to send it off to a specific destination.


## The Anatomy of an HTML <form>

Let's build a simple login form and see how its parts create an HTTP request.

HTML

<form action="/login" method="POST">

  <label for="username-input">Username:</label>
  <input type="text" id="username-input" name="username">

  <label for="password-input">Password:</label>
  <input type="password" id="password-input" name="password">

  <button type="submit">Log In</button>

</form>

Let's break down the key pieces:

  • <form>: This is the main wrapper, our "postcard." It has two crucial attributes:

    • action="/login": This is the destination address. It tells the browser which URL path on the server should receive this information. This corresponds to the path in the HTTP request line (e.g., POST /login HTTP/1.1).

    • method="POST": This is the shipping method. It specifies which HTTP verb to use. The two most common methods for forms are:

      • GET: The data is appended directly to the URL in the address bar (like writing on the outside of the postcard for everyone to see). Good for search queries, but terrible for passwords!

      • POST: The data is placed inside the body of the HTTP request (like putting your message inside a sealed envelope). This is the standard for submitting sensitive or large amounts of data.

  • <input>: These are the fields the user fills out. The most important attribute here is name.

    • name="username": This acts like a label for the data. When the browser packages up the information, it uses this name as the key. The value the user types in becomes, well, the value! This creates a key-value pair.
  • <button type="submit">: This is the "Send" button. When a user clicks this, the browser springs into action.


## The Journey: From Click to Request

Let's say a user types "dev123" into the username field and "p@ssword" into the password field and then clicks "Log In." Here's what the browser does behind the scenes:

  1. Look at the <form> tag: "Okay, the method is POST and the destination is /login."

  2. Gather the data: It finds all <input> elements with a name attribute inside the form.

    • It finds an input with name="username" and its value is "dev123".

    • It finds another with name="password" and its value is "p@ssword".

  3. Build the HTTP Request: The browser now constructs the HTTP request you learned about, automatically. It looks something like this:

    HTTP

    POST /login HTTP/1.1
    Host: yourwebsite.com
    Content-Type: application/x-www-form-urlencoded
    
    username=dev123&password=p%40ssword
    
    • Notice the Content-Type header. This is the default for HTML forms, telling the server how the data in the body is formatted (key-value pairs joined by &).

    • Look at the body! It's the data from our form, neatly packaged. The browser even URL-encoded the @ symbol to %40 to ensure it's transmitted safely.

  4. Wait for the Response: The server processes this request. If the login is successful, it might send back a brand new HTML page (like a welcome dashboard).

  5. Full Page Reload: The browser receives this new HTML page and discards the old one completely. It then renders the new page from scratch. This flash and reload is the classic behavior of a form submission.

That's it! An HTML form is simply a user-friendly tool for constructing a standard HTTP request, which results in a full navigation to a new page.

19 Feb 2018

Conversation between 2 developers in 2016

I bet you won't stop laughing. for front end people ->
https://hackernoon.com/how-it-feels-to-learn-javascript-in-2016-d3a717dd577f

for open stack backend people->
https://circleci.com/blog/its-the-future/

It also made me realise how much I don't know/understand. Again speed at which industry is changing in terms of "new needs after every new solution" and that is a cycle.

22 Aug 2016

Basics of Basics of Web Application Development - Crash Course

I've not made mistake of repeating the words "Basics of" as you might have been thinking. I'm just calling these things so basic and integral to web development that they are basics of "basic concepts of web application development"

1. Protocol - Protocol means,
    • same terms that are understood or agreed by two or more parties (e.g. client browser and server).
    • a language (or call it sign language or code words) that is understood by two or more parties
2. HTTP - is a protocol/language of web. Web clients and web servers talk in this language with each others. For e.g.

Client says (in its code language i.e. HTTP Request) -

POST /v2/sessiontoken HTTP/1.1
Host: app.kashflow.com
Content-Type: application/json
Accept: application/json

{"username":"ismails", "password":"********"}
Interpretation of code language -
  • Firstly, it is said by client which means it is a request - HTTP request.
  • POST - it's an HTTP method. This means it is a request to create a resource (related to REST concepts). More details here.
  • /v2/sessiontoken - it is a part of URL i.e. it will be appended to value of host header which is provided in 2nd line. So whole URL will form like http://app.kashflow.com/v2/sessiontoken. It is address of the recipient of this message i.e. for whom this code worded message is meant for. 
  • HTTP/1.1 - This request is created using HTTP/1.1 version of sign/code language. It's modern. It might contain modern slangs ;-)
  • From 2nd line starts all request headers and their values follow after colon sign i.e. `:`. Each header has a different meaning and the other party understands it's value accordingly. 
    • Host- request will go to this server address. Address of the server for which this message is intended. Client is saying "Hey Mister! I'm talking to you"
    • Content-Type - It is a message for the server that the body of this request that follows (last line), is in JSON format. If you want to interpret it please make a note about this. Client says "I'm talking in Spanish. Use interpreter accordingly ;-)"
    • Accept - means "As a client I will only understand if you return me a response body which is in JSON format (Spanish language)" 
  • After an extra line break comes body of the request. That is actual talk/speech of client to server.
So this is what client has told to the server. Now server gets the request. It understands/interprets/decodes the request. It processes i.e. takes action as per the request. (In this case, client expects the server to verify the username and password, create an authentication token  and respond with the same if username and password are valid. This part is creation/invention of a developer's mind. You as a developer will decide what you want the client to request and program the server to do as per the request.) Finally server informs back (HTTP Response) to the requester (client) about what action it took and/or its results.

Server says (in it's code language i.e. HTTP Response)
HTTP/1.1 201 Created
Content-Length: 829
Content-Type: application/json; charset=utf-8

{"SessionToken":"f3f14a8b-d370-4318-a629-0a124e47c014"}

Interpretation of code language -
  • HTTP/1.1 - it specifies version of sign/code language this request in.
  • 201 Created - It's HTTP status code. This means as per your request authentication token has been created. Different status codes mean differently. Look for more details here, here or here.
  • Then starts HTTP response headers. Similar to request headers, each one has a meaning. 
    • Content-Length specifies how long the content of body is
    • Content-Type specifies format of response in the body (remember JSON format? Yep, It's client's wish answered)
  • After an extra line break comes body of the response
If for example the username and passwords are invalid, the response would have been different

HTTP/1.1 400 Bad Request
Content-Length: 71
Content-Type: application/json; charset=utf-8

{"Message":"Invalid username or password", "Error":"InvalidCredentials"}

Look at HTTP status codes to decode this response.


3. Browser is an HTTP client.
So let's understand how browser talks HTTP.
  1. Fire up chrome 
  2. Hit F12 key to open up chrome dev tools. Context click and select inspect element if you are on Mac
  3. Select network tab on chrome dev tools
  4. Tick "Preserve log" checkbox
  5. Type google.com in address bar (in chrome main window)
  6. Hit enter.
  7. Select the first request from the list in chrome dev tools window. 
This is what I get to see. Let's decode it.



HTTP Request
  • GET request to `/` (it's a forward slash) i.e. root of the host google.com using HTTP 1.1 version of language
  • Browser `Accept`s or understands only one of these "text/html, application/xhtml+xml, application/xml" other certain image formats etc
HTTP Response
  • 302 Found . It means server is saying that "You have reached at correct address and with valid parcel (request), unfortunately, the information (resource) you are looking for has moved to other place (specified in location header)"
  • Look at the 2nd request in the list (chrome dev tools). Is it a request to same URL which is specified in location header? Yes it is. Browser has interpreted the response correctly and requested other URL as per the response it got from the server.
More walk-through
Basic concepts of web applications, how they work and the HTTP protocol
HTTP in depth

Basic HTTP codes for quick reference
  • 2xx - Success codes
    • 200 - Success - OK - this simply means whatever you have requested is served. Meaning differs as per the request method and content.
    • 201 - Created - this is generally a response of POST or PUT requests
    • 204 - No Content - The server has successfully fulfilled the request and that there is no additional content to send in the response payload/body.
    • 3xx - Redirection codes
      • 301 - Redirction - the information you have requested is now available at some other URL which is provided in `location` header of response
      • 302 - Redirection  - same as above. But a newer version. Look for more details on HTTP specs
      • 4xx - Bad Request codes
        • 400 - Simple bad request i.e. something bad with the request body. Change it correct it and send whatever server expects. Detailed explaination should be provided in response body

      7 Apr 2015

      REST - Representational State Transfer

      Below are list of articles about REST Architecture

      Intro to REST
      https://www.youtube.com/watch?v=YCcAE2SCQ6k

      REST - basics
      1. Basics - http://en.wikipedia.org/wiki/Representational_State_Transfer
      2. Basics - http://tomayko.com/writings/rest-to-my-wife
      3. Basics - http://net.tutsplus.com/tutorials/other/a-beginners-introduction-to-http-and-rest/
      4. Basics - http://www.ics.uci.edu/~fielding/pubs/dissertation/rest_arch_style.htm
      5. Basics - https://www.ibm.com/developerworks/webservices/library/ws-restful/
      6. Basics - http://stackoverflow.com/questions/671118/what-exactly-is-restful-programming
      7. Basics - http://rest.elkstein.org/2008/02/what-is-rest.html
      8. Basics - http://www.xfront.com/REST-Web-Services.html - Well explained characteristics
      9. Basics - http://www.infoq.com/articles/rest-introduction

      RESTful in practice
      1. http://www.codeproject.com/KB/architecture/RESTWebServicesPart1.aspx
      2. http://www.codeproject.com/KB/architecture/RESTWebServicesPart2.aspx
      3. http://duncan-cragg.org/blog/post/setting-data-rest-dialogues/
      4. http://www.xml.com/pub/a/2004/08/11/rest.html
      5. http://www.infoq.com/articles/tilkov-rest-doubts
      6. http://www.infoq.com/articles/designing-restful-http-apps-roth

      REST comparison with peers
      1. http://stackoverflow.com/questions/853620/secure-web-services-rest-over-https-vs-soap-ws-security-which-is-better
      2. http://stackoverflow.com/questions/209905/rest-and-soap
      3. http://stackoverflow.com/questions/106546/performance-of-soap-vs-xml-rpc-or-rest
      4. http://stackoverflow.com/questions/4163066/rest-vs-soap-has-rest-a-better-performance
      5. http://stackoverflow.com/questions/90451/why-would-one-use-rest-instead-of-web-services

      Discussions
      http://stackoverflow.com/questions/347661/asp-net-mvc-and-rest-uris
      http://stackoverflow.com/q/3051849/148271
      http://stackoverflow.com/questions/134871/whats-the-best-way-to-implement-an-api-in-asp-net-using-mvc
      http://stackoverflow.com/questions/4574868/securing-my-rest-api-with-oauth-while-still-allowing-authentication-via-third-par
      *http://stackoverflow.com/questions/3285704/should-a-netflix-or-twitter-style-web-service-use-rest-or-soap
      http://stackoverflow.com/questions/76595/soap-or-rest-bounty-powered-reissue
      http://msdn.microsoft.com/en-us/library/dd203052.aspx [A Guide to Designing and Building RESTful Web Services with WCF 3.5]
      http://msdn.microsoft.com/en-us/magazine/dd942839.aspx#id0070024
      http://stackoverflow.com/questions/1006309/is-the-wcf-rest-starter-kit-dead-in-the-water
      http://stackoverflow.com/questions/4769973/asp-net-mvc-rest-frameworks
      http://stackoverflow.com/questions/5666293/asp-net-mvc-restful-architecture/5666320#5666320


      *Note:-Can be implemented in WCF Web API
      http://en.wikipedia.org/wiki/HTTP_ETag


      *WCF Web API FAQ
      http://wcf.codeplex.com/wikipage?title=WCF%20Web%20API%20FAQ
      http://weblogs.asp.net/gsusx/archive/2011/05/31/getting-a-cup-of-coffee-using-the-wcf-web-apis-announcing-restbucks-net.aspx


      *oAuth
      http://oauth.net/core/1.0a/
      http://code.google.com/apis/accounts/docs/OAuth2.html
      http://hueniverse.com/2007/10/beginners-guide-to-oauth-part-i-overview/
      http://blog.apigee.com/detail/when_to_use_oauth/
      http://blog.apigee.com/detail/oauth_differences/
      http://blog.apigee.com/detail/oauth_is_improving_but_still_moving/
      http://blog.xero.com/developer/api-overview/authentication/
      http://hueniverse.com/2010/05/introducing-oauth-2-0/
      http://oauth.net/2/
      ################################


      Hypertext Transfer Protocol (HTTP) Status Code Registry (might be useful)
      -------------------------------------------------------------------------------------------
      1. http://www.iana.org/assignments/http-status-codes


      RESTful Practises
      ---------------------
      1. https://fedorahosted.org/pulp/wiki/RestfulPractices

      Cloud REST API
      -------------------
      1. http://fedoraproject.org/wiki/Cloud_APIs_REST_Style_Guide

      Portable Data Formats in Represantations - [RESTful Web Service Cookbook - CHAPTER 3.9]
      -------------------------------------------------------------------------------------------------------------
      1. http://books.xmlschemata.org/relaxng/relax-CHP-8-SECT-1.html (have a look at the numeric datatype section)
      2. http://en.wikipedia.org/wiki/ISO_3166-1 (Country code represantation)
      3. http://en.wikipedia.org/wiki/ISO_4217 (alphabetic and numeric codes for denoting currency)
      4. http://www.neilvandyke.org/rfc3339-scheme/ (date, time and date-time representation)
      5. http://www.w3.org/International/articles/language-tags/ (language tags)
      6. http://www.codeproject.com/KB/dotnet/Using_time_zones_in_NET.aspx (Olson time zone database to convey time zones)

      25 Sept 2014

      Programmers' Good Reads

      This post will contain good-reads for programmers. Over time, I will add articles that I pass through in this post so that I don't loose the good things and can easily find it.


      http://damodaranaidu.wordpress.com/2014/09/21/solid-principles-c/
      http://www.codeproject.com/Articles/819100/More-Attributes-of-Highly-Effective-Programmers

      Performance
      http://www.igvita.com/2012/04/04/measuring-site-speed-with-navigation-timing/
      http://www.igvita.com/2012/07/19/latency-the-new-web-performance-bottleneck/

      Work Environment
      https://medium.com/@bchesky/dont-fuck-up-the-culture-597cde9ee9d4
      https://www.linkedin.com/today/post/article/20140727163759-5854825-micromanagers-flushing-companies-down-the-toilet-one-detail-at-a-time


      Web Application Checklist
      http://www.sitepoint.com/18-critical-oversights-web-development/

      Basics of WebApplication
      http://www.codeproject.com/Articles/839542/How-to-become-a-web-developer-that-stands-out-from

      Others
      http://devproconnections.com/development/how-market-your-software-business-guide-developers
      http://devproconnections.com/development/business-development-guidance-professional-software-developers
      http://www.infoq.com/resource/minibooks/leading-self-organising-teams/en/pdf/Leading-Self-Organising-Teams.pdf
      The Motivator Behind the Windows 2000 Development Team

      Joel's Classic Rules
      The Joel Test: 12 Steps to Better Code
      Painless Functional Specifications - Part 1: Why Bother?
      Painless Functional Specifications - Part 2: What's a Spec?
      Where do These People Get Their (Unoriginal) Ideas?
      Painless Software Schedules

      Functional Programming
      https://mitpress.mit.edu/sicp/full-text/book/book.html
      https://medium.com/@jugoncalves/functional-programming-should-be-your-1-priority-for-2015-47dd4641d6b9#.shkoeij0g

      Patterns
      http://tech.pro/blog/1402/five-patterns-to-help-you-tame-asynchronous-javascript
      http://www.codeproject.com/Articles/1009532/Learn-Csharp-Design-patterns-step-by-step-with-a-p


      jQuery to Angular JS mindshift

      Agile
      https://www.industriallogic.com/blog/stop-using-story-points/
      https://www.industriallogic.com/blog/bargain-hunting/


      GIT
      http://www.sbf5.com/~cduan/technical/git/git-2.shtml
      http://betterexplained.com/articles/aha-moments-when-learning-git/
      http://stackoverflow.com/questions/315911/git-for-beginners-the-definitive-practical-guide


      Agile

      https://www.industriallogic.com/blog/stop-using-story-points/
      https://www.industriallogic.com/blog/bargain-hunting/;l

      Pair Programming
      http://www.skorks.com/2009/07/effective-vs-ineffective-pair-programming/
      https://www.thoughtworks.com/insights/blog/effective-navigation-in-pair-programming

      JavaScript
      http://adripofjavascript.com/blog/drips/variable-and-function-hoisting

      Soft Skills
      http://www.huffingtonpost.com/dr-travis-bradberry/13-habits-of-super-persua_b_14272946.html?1485278349