Skip to content

amirhossein693/good

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

19 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Good JS πŸ“š

A comprehensive JavaScript best practices guide with interactive examples and modern coding standards

JavaScript Vue.js Tailwind CSS License

πŸš€ Features

  • 25+ JavaScript Best Practices - From basic syntax to advanced patterns
  • Interactive Examples - Live "Do" and "Don't" code demonstrations
  • Modern ES6+ Standards - Latest JavaScript features and recommendations
  • Security Best Practices - XSS prevention, input validation, and secure coding
  • Performance Optimization - Memory management, event handling, and performance tips
  • Code Quality Guidelines - Clean code principles, documentation, and formatting
  • Responsive Design - Mobile-friendly interface with Tailwind CSS
  • SEO Optimized - Search engine friendly with structured data

πŸ“– What's Included

Core JavaScript Practices

  • βœ… Strict equality (===) vs loose equality (==)
  • βœ… Modern variable declarations (const, let vs var)
  • βœ… Template literals and string interpolation
  • βœ… Arrow functions and concise syntax
  • βœ… Destructuring assignment
  • βœ… Spread and rest operators
  • βœ… Optional chaining and nullish coalescing

Async Programming

  • βœ… Async/await vs Promise chains
  • βœ… Proper error handling with try-catch
  • βœ… Promise best practices

Performance & Memory

  • βœ… Array methods vs traditional loops
  • βœ… Event delegation for dynamic content
  • βœ… RequestAnimationFrame for animations
  • βœ… Debouncing and throttling
  • βœ… WeakMap/WeakSet for memory management

Security & Validation

  • βœ… Input sanitization (XSS prevention)
  • βœ… Secure cookies and HTTPS
  • βœ… Data type and structure validation
  • βœ… Strict mode for error catching

Code Quality

  • βœ… Meaningful variable names
  • βœ… Pure functions and functional programming
  • βœ… Consistent code formatting
  • βœ… JSDoc documentation
  • βœ… Environment variables for configuration
  • βœ… Function composition
  • βœ… Object immutability with Object.freeze()

πŸ› οΈ Technologies Used

  • Frontend: Vue.js 2.x, Tailwind CSS
  • Build Tools: No build process required - pure vanilla JavaScript
  • Hosting: GitHub Pages compatible
  • Analytics: Google Analytics integration

πŸš€ Getting Started

Prerequisites

  • A modern web browser with JavaScript enabled
  • No additional dependencies required

Installation

  1. Clone the repository

    git clone https://github.com/amirhossein693/good.git
    cd good
  2. Open in browser

    # Option 1: Use a local server
    python -m http.server 8000
    # Then visit http://localhost:8000
    
    # Option 2: Open directly
    open index.html
  3. Deploy to GitHub Pages

    # Push to your repository
    git push origin main
    
    # Enable GitHub Pages in repository settings
    # Your site will be available at: https://yourusername.github.io/good

πŸ“± Usage

The application is designed to be:

  • Educational - Learn JavaScript best practices through examples
  • Reference - Quick lookup for coding standards
  • Interactive - See code examples in action
  • Mobile-friendly - Responsive design for all devices

🎯 Target Audience

  • JavaScript Beginners - Learning modern JavaScript syntax
  • Intermediate Developers - Improving code quality and performance
  • Senior Developers - Reference for team coding standards
  • Code Reviewers - Standards for code quality assessment
  • Students - Educational resource for JavaScript courses

🀝 Contributing

We welcome contributions! Here's how you can help:

Adding New Best Practices

  1. Fork the repository
  2. Add your practice to the items array in scripts.js
  3. Follow the existing format with title, slug, refs, do, and dont
  4. Include authoritative references
  5. Submit a pull request

Improving Existing Content

  • Fix typos or improve descriptions
  • Add better code examples
  • Update references to newer documentation
  • Improve accessibility or SEO

Code Style Guidelines

  • Use meaningful variable names
  • Add JSDoc comments for functions
  • Follow the existing code structure
  • Test your changes in multiple browsers

πŸ“š Learning Resources

Official Documentation

Best Practices References

Performance & Optimization

πŸ”§ Customization

Adding Your Own Practices

{
  title: 'Your Practice Title',
  slug: 'your-practice-slug',
  refs: [{
    title: 'Reference Name',
    url: 'https://example.com'
  }],
  do: {
    description: 'Why this is good',
    codes: [
      'const goodCode = "example";'
    ]
  },
  dont: {
    description: 'Why this is bad',
    codes: [
      'const badCode = "example";'
    ]
  }
}

Styling Customization

  • Modify Tailwind classes in index.html
  • Update color scheme in the CSS classes
  • Add custom animations or transitions

πŸ“Š Analytics & SEO

The site includes:

  • Google Analytics integration for usage tracking
  • SEO meta tags for better search visibility
  • Structured data for rich snippets
  • Mobile optimization for better rankings
  • Fast loading with minimal dependencies

πŸ› Troubleshooting

Common Issues

Vue.js not loading

  • Ensure you have an internet connection for CDN resources
  • Check browser console for errors

Styling issues

  • Verify Tailwind CSS is loading properly
  • Check for CSS conflicts

Code examples not displaying

  • Ensure JavaScript is enabled
  • Check browser compatibility

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

  • Vue.js Team - For the amazing reactive framework
  • Tailwind CSS - For the utility-first CSS framework
  • MDN Web Docs - For comprehensive JavaScript documentation
  • JavaScript Community - For continuous improvement of best practices

πŸ“ž Support

πŸ”„ Changelog

v2.0.0 - Major Update

  • Added 17 new best practices
  • Improved SEO and accessibility
  • Enhanced mobile responsiveness
  • Added security best practices
  • Performance optimization tips

v1.0.0 - Initial Release

  • 8 core JavaScript best practices
  • Vue.js interactive interface
  • Tailwind CSS styling
  • GitHub Pages deployment

Made with ❀️ by Amirhossein

Star ⭐ this repository if you found it helpful!

About

JavaScript Best Practices & Style Guide

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors