#javadoc
Explore tagged Tumblr posts
Text
I love auto-generating javadocs.
2 notes
·
View notes
Text
A Comprehensive Guide to Java Document ArrayLists
Explore the comprehensive Java documentation for ArrayList to understand its key features, methods, and usage. Learn about dynamic array resizing, efficient element manipulation, and practical examples to enhance your Java programming skills.
0 notes
Text
hour 1: the display on my computer was bugging out so i went to update the drivers on my graphics card. this caused my computer to have a random catastrophic shutdown. every time i turned it on it got stuck on the boot screen and couldnt load windows. No amount of fucking with the bios settings got the bootloader to fucking work like it should. For a lovely moment there it seemed like i entirely bricked my computer. I only got my computer working again because windows randomly started running and crashed far enough in that i could access the advanced repair options and reinstate a backup . Good fucking lord
hour 2: what the fuck is a comparator and why is it indistinguishable from a class
hour 3: oh its a just a class
hour 4: Existential spiral about the fact that i forgot how binary search works and why is this my major and why am i trapped in hell and
hour 5: WHY DO I NEED TO OUTPUT THE THEORETICAL COMPLEXITY WE ALL KNOW ITS K + LOG_2 N [explodes]
i hope colin's having fun not participating in whats ostensibly a group project
#im like#2/3rds of the way through this project#and in a perfect world#there would be Another Person i could send these files to#and be like alright idiot :) Figure the rest out#and yet#here i am#writing javadocs
5 notes
·
View notes
Text
this is how you do javadoc right?
3 notes
·
View notes
Text
refactoring
I lied when I said I was going to work next on loading a 3-D model. Sorry, old habit! Actually, I went straight into refactoring. Let me explain...
The English Wikipedia defines refactoring as "the process of restructuring existing computer code . . . without changing its external behavior", which is fairly accurate, though lacking in motivation.
My back-of-mind definition would be "changes to code whose primary purpose is not to add features or solve issues, but to make the codebase easier to maintain".
Back when I worked for corporations, I got in the habit of never mentioning refactoring around anyone who wasn't a software developer. If my boss (or my boss's boss) knew I was making changes (and spending work hours) on something other than approved features or known issues, awkward questions would arise. (Like, do we have a billing code for that?)
Anyone who's worked intimately with a large software project knows that if changes are made only for features and issues, the project will accumulate "technical debt" that makes it difficult to maintain: hard to explain/learn/understand/remember how it works and hard to make changes without introducing bugs.
Both of today's refactorings focussed on the BaseApplication class, which became unwieldy weeks ago. Last night the source file for the class reached 1901 lines of Java code (not counting blanks, comments, and javadoc). I don't place a hard limit on lines of code in a class, but a file containing 1901 LoCs positively screams technical debt. It's especially painful these days, since I'm working on a laptop with a tiny screen and using a track pad instead of a mouse. (I spend lots of time scrolling back and forth, hunting for the lines I need to change.) Cramming as much as possible into a single file makes some sense for a tutorial, but I see the V-Sport project as something I'll be maintaining for many years.
First I split off all the code that deals with physical devices and put that in a new PhysicalDevice class. The change greatly clarified which properties of the physical device matter and how that information is accessed.
Then I split off all the code that deals with texture data into a new Texture class. The new class bundles up 3 related Vulkan resources and provides a clear lifecycle of create/use/destroy. I expect it to minimize duplication of code when the project transitions (sometime in the near future) from a single texture to multiple textures.
I'm subjectively pleased with how smoothly today's refactoring went. One measure of its success is that BaseApplication shrank from 1901 to 1650 lines of code. Still plenty of room for improvement, though!
#refactoring#making progress#software engineering#3d graphics#vulkan#technical debt#java#coding#software development#lying#tutorial#locs
26 notes
·
View notes
Text
Just released version 0.3 of tungsten-types on Github.
Please watch, comment, etc.
5 notes
·
View notes
Text
Chú Thích, Dấu Ngoặc, Dấu Chấm Phẩy trong Java - Hướng dẫn chi tiết
Trong lập trình Java, việc sử dụng đúng chú thích, dấu ngoặc, và dấu chấm phẩy là yếu tố quan trọng để đảm bảo mã nguồn dễ đọc, dễ hi���u và hoạt động chính xác. Những thành phần này không chỉ giúp mã nguồn trở nên rõ ràng mà còn hỗ trợ lập trình viên tránh được các lỗi cú pháp phổ biến. Bài viết này sẽ cung cấp hướng dẫn chi tiết về cách sử dụng chú thích, dấu ngoặc, và dấu chấm phẩy trong Java, cùng với các ví dụ thực tế và đề xuất hình ảnh minh họa.
1. Chú Thích trong Java - Công cụ hỗ trợ lập trình viên
Chú thích (comments) trong Java là các dòng văn bản được thêm vào mã nguồn để giải thích hoặc ghi chú, giúp lập trình viên và người đọc hiểu rõ hơn về chức năng của đoạn mã. Chú thích không được trình biên dịch (compiler) xử lý, do đó chúng không ảnh hưởng đến hiệu suất chương trình. Trong Java, có ba loại chú thích chính:
1.1. Chú thích một dòng
Sử dụng ký hiệu // để viết chú thích trên một dòng. Ví dụ:// Đây là chú thích một dòng int x = 10; // Gán giá trị 10 cho biến x
1.2. Chú thích nhiều dòng
Sử dụng cặp ký hiệu /* */ để viết chú thích trên nhiều dòng.
Ví dụ:
/* Đây là chú thích nhiều dòng Dùng để giải thích một đoạn mã phức tạp */
public class Main {
public static void main(String[] args) {
System.out.println("Hello, World!");
}
}
1.3. Chú thích tài liệu (Javadoc)
Chú thích dạng tài liệu sử dụng ký hiệu /** */ và thường được dùng để tạo tài liệu API.
Ví dụ:
/** Hàm này tính tổng hai số *
@param a Số thứ nhất *
@param b Số thứ hai *
@return Tổng của a và b */
public int sum(int a, int b) {
return a + b;
}
Chú thich một dòng
2. Dấu Ngoặc trong Java - Cấu trúc mã nguồn
Dấu ngoặc trong Java bao gồm dấu ngoặc tròn (), dấu ngoặc vuông [], và dấu ngoặc nhọn {}. Mỗi loại có vai trò riêng trong việc tổ chức và thực thi mã nguồn.
2.1. Dấu ngoặc tròn ()
Dấu ngoặc tròn được sử dụng trong:
Định nghĩa phương thức: Chỉ định tham số của phương thức.
Gọi phương thức: Truyền đối số khi gọi phương thức.
Câu lệnh điều kiện hoặc vòng lặp: Bao quanh điều kiện. Ví dụ:
public void sayHello(String name) {
// Dấu ngoặc tròn chứa tham số
System.out.println("Hello, " + name);
}
if (x > 0) {
// Dấu ngoặc tròn chứa điều kiện
System.out.println("x is positive");
}
2.2. Dấu ngoặc vuông []
Dấu ngoặc vuông chủ yếu được dùng để khai báo và truy cập mảng. Ví dụ:int[] numbers = new int[5]; // Khai báo mảng numbers[0] = 10; // Truy cập phần tử đầu tiên
2.3. Dấu ngoặc nhọn {}
Dấu ngoặc nhọn được sử dụng để:
Xác định khối mã (block) của lớp, phương thức, hoặc câu lệnh.
Đảm bảo các dòng mã liên quan được nhóm lại. Ví dụ:
public class Example {
public static void main(String[] args) {
// Khối mã của phương thức for (int i = 0; i < 5; i++)
{
// Khối mã của vòng lặp System.out.println(i);
}
}
}
Lưu ý: Việc quên đóng dấu ngoặc hoặc sử dụng sai có thể dẫn đến lỗi cú pháp. Hãy luôn kiểm tra cẩn thận.
Dấu ngoặc nhọn trong Java
3. Dấu Chấm Phẩy trong Java - Kết thúc câu lệnh
Dấu chấm phẩy ; trong Java được sử dụng để kết thúc một câu lệnh (statement). Nó báo hiệu cho trình biên dịch rằng một câu lệnh đã hoàn tất. Việc thiếu dấu chấm phẩy hoặc sử dụng sai vị trí có thể gây lỗi cú pháp. Ví dụ:int x = 10; // Dấu chấm phẩy kết thúc câu lệnh System.out.println(x); // Dấu chấm phẩy sau lời gọi phương thức
3.1. Trường hợp không cần dấu chấm phẩy
Sau khối mã trong dấu ngoặc nhọn {}.
Trong chú thích hoặc chuỗi văn bản.
Ví dụ:
public class Main {
public static void main(String[] args) {
// Không cần dấu chấm phẩy sau dấu ngoặc nhọn System.out.println("Hello");
// Cần dấu chấm phẩy
}
// Không cần dấu chấm phẩy
}
3.2. Lỗi phổ biến liên quan đến dấu chấm phẩy
Thiếu dấu chấm phẩy: Gây lỗi biên dịch.
Dư dấu chấm phẩy: Trong một số trường hợp (như sau vòng lặp for), có thể dẫn đến hành vi không mong muốn.
Ví dụ lỗi:
for (int i = 0; i < 5; i++); {
// Dấu chấm phẩy dư System.out.println(i);
// Không in gì vì vòng lặp kết thúc ngay
}
4. Mẹo sử dụng hiệu quả Chú Thích, Dấu Ngoặc, Dấu Chấm Phẩy
Chú thích rõ ràng: Viết chú thích ngắn gọn, tập trung vào mục đích của mã, tránh giải thích những điều hiển nhiên.
Kiểm tra dấu ngoặc: Sử dụng IDE có tính năng tự động kiểm tra cặp dấu ngoặc để tránh lỗi.
Đảm bảo dấu chấm phẩy: Luôn kiểm tra xem mỗi câu lệnh đã kết thúc bằng dấu chấm phẩy chưa.
Tận dụng công cụ: Các IDE như IntelliJ IDEA hoặc VS Code có thể tự động phát hiện và sửa lỗi liên quan đến dấu ngoặc và dấu chấm phẩy.
Đoạn mã Java được tô màu cú pháp
5. Kết luận
Hiểu và sử dụng đúng chú thích, dấu ngoặc, và dấu chấm phẩy trong Java là kỹ năng cơ bản nhưng quan trọng đối với mọi lập trình viên. Chú thích giúp mã nguồn dễ hiểu, dấu ngoặc tổ chức cấu trúc mã, và dấu chấm phẩy đảm bảo tính chính xác của câu lệnh. Bằng cách áp dụng các mẹo và ví dụ trong bài viết này, bạn sẽ viết mã Java sạch hơn, chuyên nghiệp hơn và tránh được các lỗi phổ biến.
Hãy bắt đầu thực hành ngay hôm nay để làm chủ các thành phần này trong Java! Nếu bạn có thắc mắc, hãy để lại câu hỏi để được giải ��áp.
Chú Thích, Dấu Ngoặc, Dấu Chấm Phẩy trong Java – Hướng Dẫn Chi Tiết Cho Người Mới Bắt Đầu Tìm hiểu cách sử dụng comment, dấu ngoặc {}, dấu ; và quy tắc cú pháp trong Java một cách dễ hiểu và trực quan. 🌍 Website: Java Highlight
#JavaHighlight #JavaCoBan #JavaSyntax #LapTrinhJava #JavaComments #JavaBrackets #JavaSemicolon #JavaTips #JavaLearning #JavaTutorial
#java highlight#JavaCoBan#JavaSyntax#LapTrinhJava#JavaComments#JavaBrackets#JavaSemicolon#JavaTips#JavaLearning#JavaTutorial
0 notes
Text
The Ultimate Roadmap to Web Development – Coding Brushup
In today's digital world, web development is more than just writing code—it's about creating fast, user-friendly, and secure applications that solve real-world problems. Whether you're a beginner trying to understand where to start or an experienced developer brushing up on your skills, this ultimate roadmap will guide you through everything you need to know. This blog also offers a coding brushup for Java programming, shares Java coding best practices, and outlines what it takes to become a proficient Java full stack developer.
Why Web Development Is More Relevant Than Ever
The demand for web developers continues to soar as businesses shift their presence online. According to recent industry data, the global software development market is expected to reach $1.4 trillion by 2027. A well-defined roadmap is crucial to navigate this fast-growing field effectively, especially if you're aiming for a career as a Java full stack developer.
Phase 1: The Basics – Understanding Web Development
Web development is broadly divided into three categories:
Frontend Development: What users interact with directly.
Backend Development: The server-side logic that powers applications.
Full Stack Development: A combination of both frontend and backend skills.
To start your journey, get a solid grasp of:
HTML – Structure of the web
CSS – Styling and responsiveness
JavaScript – Interactivity and functionality
These are essential even if you're focusing on Java full stack development, as modern developers are expected to understand how frontend and backend integrate.
Phase 2: Dive Deeper – Backend Development with Java
Java remains one of the most robust and secure languages for backend development. It’s widely used in enterprise-level applications, making it an essential skill for aspiring Java full stack developers.
Why Choose Java?
Platform independence via the JVM (Java Virtual Machine)
Strong memory management
Rich APIs and open-source libraries
Large and active community
Scalable and secure
If you're doing a coding brushup for Java programming, focus on mastering the core concepts:
OOP (Object-Oriented Programming)
Exception Handling
Multithreading
Collections Framework
File I/O
JDBC (Java Database Connectivity)
Java Coding Best Practices for Web Development
To write efficient and maintainable code, follow these Java coding best practices:
Use meaningful variable names: Improves readability and maintainability.
Follow design patterns: Apply Singleton, Factory, and MVC to structure your application.
Avoid hardcoding: Always use constants or configuration files.
Use Java Streams and Lambda expressions: They improve performance and readability.
Write unit tests: Use JUnit and Mockito for test-driven development.
Handle exceptions properly: Always use specific catch blocks and avoid empty catch statements.
Optimize database access: Use ORM tools like Hibernate to manage database operations.
Keep methods short and focused: One method should serve one purpose.
Use dependency injection: Leverage frameworks like Spring to decouple components.
Document your code: JavaDoc is essential for long-term project scalability.
A coding brushup for Java programming should reinforce these principles to ensure code quality and performance.
Phase 3: Frameworks and Tools for Java Full Stack Developers
As a full stack developer, you'll need to work with various tools and frameworks. Here’s what your tech stack might include:
Frontend:
HTML5, CSS3, JavaScript
React.js or Angular: Popular JavaScript frameworks
Bootstrap or Tailwind CSS: For responsive design
Backend:
Java with Spring Boot: Most preferred for building REST APIs
Hibernate: ORM tool to manage database operations
Maven/Gradle: For project management and builds
Database:
MySQL, PostgreSQL, or MongoDB
Version Control:
Git & GitHub
DevOps (Optional for advanced full stack developers):
Docker
Jenkins
Kubernetes
AWS or Azure
Learning to integrate these tools efficiently is key to becoming a competent Java full stack developer.
Phase 4: Projects & Portfolio – Putting Knowledge Into Practice
Practical experience is critical. Try building projects that demonstrate both frontend and backend integration.
Project Ideas:
Online Bookstore
Job Portal
E-commerce Website
Blog Platform with User Authentication
Incorporate Java coding best practices into every project. Use GitHub to showcase your code and document the learning process. This builds credibility and demonstrates your expertise.
Phase 5: Stay Updated & Continue Your Coding Brushup
Technology evolves rapidly. A coding brushup for Java programming should be a recurring part of your development cycle. Here’s how to stay sharp:
Follow Java-related GitHub repositories and blogs.
Contribute to open-source Java projects.
Take part in coding challenges on platforms like HackerRank or LeetCode.
Subscribe to newsletters like JavaWorld, InfoQ, or Baeldung.
By doing so, you’ll stay in sync with the latest in the Java full stack developer world.
Conclusion
Web development is a constantly evolving field that offers tremendous career opportunities. Whether you're looking to enter the tech industry or grow as a seasoned developer, following a structured roadmap can make your journey smoother and more impactful. Java remains a cornerstone in backend development, and by following Java coding best practices, engaging in regular coding brushup for Java programming, and mastering both frontend and backend skills, you can carve your path as a successful Java full stack developer.
Start today. Keep coding. Stay curious.
0 notes
Text
I’m working on some javadoc blocks dealing with device buzzers and “buzzer” is a really funny word when you look at it in isolation.
0 notes
Text
When I was at uni, one of the courses I did was a Java programming course. The rule of the IT school at my uni was that regardless of your cumulative score for a course, if you failed the exam you failed the course.
Anyway, for this computer programming class, the exam was to write programming code, by hand, on paper, with a pen, with a Si gle handwritten page of notes.
This is, of course, not at all how programming is done.
Needless to say the fail rate for the class was incredibly high (almost one in two I believe).
I end up failing the exam so have to repeat the class. However, the following year they realise "hm, maybe a nearly 50% fail rate for this course almost entirely because of the exam is a bad thing?" so for this year they tried something new: the exam would take place in a computer lab, on actual computers, where one would write the code into the IDE and then test it with the compiler. Although there was no internet access, we did have access to the full javadoc so we could see syntax and so on for particular commands.
Needless to say this was much more successful, far less stressful and the fail rate dropped to a much more reasonable level!

6K notes
·
View notes
Text
Project 02, Object-Oriented Programming, CSE 271
Class, File, Javadoc, JUnit In this project, you will practice how to create classes and its methods, use file to store and retrieve data, write and generate Javadoc documentation, and test using JUnit library. Create a project in Eclipse named Project_02. You are going to design multiple classes in this project. • Class Address: Create a class named Address which has the following private…
0 notes
Text
CMSC204 Solved
Assignment 1 Passwords Concepts tested by this program: ArrayList static Read Files Javadoc JUnit Tests Exceptions Create an application that will check for valid passwords. The following rules must be followed to create a valid password. 1. At least 6 characters long 2. 10 or more characters is a strong password, between 6 and 9 characters is a weak (but acceptable) password. 3. At least 1…
0 notes
Text
Homework 02 – Gone Fishing
Topics: Javadocs, inheritance, constructor chaining, copy constructor, static variables, wrapper classes, good class design Problem Description The first wave of midterms has passed, and it’s time to relax a little. You decide it’s time to go fishing, and you return with an impressive haul! You decide to apply your object-oriented programming skills to record information about your new fish…
0 notes
Text
Share tips for improving code quality and maintainability.
1. Follow Java Naming Conventions
Classes: Use PascalCase for class names (e.g., EmployeeDetails).
Methods/Variables: Use camelCase for method and variable names (e.g., calculateSalary).
Constants: Use uppercase letters with underscores for constants (e.g., MAX_LENGTH).
2. Use Proper Object-Oriented Principles
Encapsulation: Make fields private and provide public getters and setters to access them.
Inheritance: Reuse code via inheritance but avoid deep inheritance hierarchies that can create tightly coupled systems.
Polymorphism: Use polymorphism to extend functionalities without changing existing code.
3. Write Clean and Readable Code
Keep Methods Small: Each method should do one thing and do it well. If a method is too long or does too much, break it down into smaller methods.
Avoid Nested Loops/Conditionals: Too many nested loops or conditionals can make code hard to read. Extract logic into separate methods or use design patterns like the Strategy or State pattern.
4. Use Design Patterns
Leverage proven design patterns like Singleton, Factory, Observer, and Strategy to solve common problems in a standardized, maintainable way.
Avoid overcomplicating things; use patterns only when they add clarity and solve a specific problem.
5. Implement Proper Error Handling
Use exceptions appropriately. Don’t overuse them, and catch only the exceptions you can handle.
Ensure that exceptions are logged for better debugging and auditing.
Use custom exceptions to represent domain-specific issues, so they are easier to debug.
6. Utilize Java’s Stream API
The Stream API (introduced in Java 8) helps reduce boilerplate code when performing collection operations like filtering, mapping, and reducing.
It makes code more concise and expressive, which helps with readability and maintainability.
7. Write Unit Tests
Use JUnit and Mockito for unit testing and mocking dependencies.
Write test cases for all critical methods and components to ensure the behavior is as expected.
Use Test-Driven Development (TDD) to ensure code correctness from the start.
8. Use Dependency Injection
Prefer Dependency Injection (DI) for managing object creation and dependencies. This decouples components and makes testing easier (using tools like Spring Framework or Guice).
DI helps to make your classes more modular and improves maintainability.
9. Avoid Code Duplication
Use methods or utility classes to avoid repeating code.
If the same logic is used in multiple places, refactor it into a single reusable method.
10. Use Annotations
Use Java annotations (like @Override, @NotNull, @Entity, etc.) to improve code clarity and reduce boilerplate code.
Annotations help to enforce business logic and constraints without having to manually check them.
11. Leverage IDE Features
Use tools like IntelliJ IDEA or Eclipse to automatically format code and identify potential issues.
Many IDEs have integrated tools for running tests, refactoring code, and applying coding standards, so make full use of these features.
12. Optimize for Performance Without Sacrificing Readability
Only optimize performance when necessary. Premature optimization can lead to complex code that’s difficult to maintain.
Profile your code to identify bottlenecks, but prioritize clarity and maintainability over micro-optimizations.
13. Implement Proper Logging
Use a logging framework like SLF4J with Logback or Log4j2 for logging. This provides a consistent logging mechanism across the application.
Ensure that logs are meaningful, providing information about the application’s state, errors, and flow, but avoid excessive logging that clutters output.
14. Document Your Code
Use JavaDocs to generate documentation for public methods and classes.
Document not just the what but also the why behind critical decisions in the codebase.
15. Keep Your Codebase Modular
Break your project into smaller, well-defined modules, and avoid large monolithic classes.
Use packages to group related classes, ensuring that each class or module has a single responsibility.
16. Use Static Analysis Tools
Integrate tools like Checkstyle, PMD, and SonarQube to enforce coding standards, detect bugs, and ensure code quality.
These tools help you identify code smells and areas where quality can be improved.
0 notes
Text
Release frequency
Yesterday I released v7.7.0 of Minie, my open-source 3-D physics library for JMonkeyEngine. Despite excellent build automation, each release still involves a lot of manual effort:
reviewing all commits since the last release and summarizing them for the release log
updating the version number in 3 places
troubleshooting build failures (TravisCI has issues this week.)
reviewing the 400 files automatically uploaded to SonaType, to ensure nothing's missing
closing the upload
testing the release candidate to make sure it works
promoting the release candidate
creating the release tag at GitHub and uploading 26 files there
updating 7 projects that use or refer to Minie; testing, committing, and pushing those changes
updating all my documentation that refers to the latest release
post-release fixup of the Minie repo
uploading new javadoc to my website
updating the robots.txt and sitemap.xml of my website
announcing the release at the JMonkeyEngine forum
blogging about my experience of the release (you are here!)
updating the JME Library website
All this is one reason I hope to reduce my release frequency to something like 4x per year. (I imagine most developers don't want to deal with more than 4 updates per year anyway.)
On that note, I am eagerly awaiting Apache NetBeans 19, the next quarterly release of the development environment I use. NetBeans 18 was released on 30 May 2023, so 19 should appear any day now.
This summer sure flew by quickly!
#open source#software development#new release#github#accomplishments#physics simulation#documentation#upcoming releases#free tools#tempus fugit#apache#summer
2 notes
·
View notes
Text
Homework 02 – Gone Fishing
Topics: Javadocs, inheritance, constructor chaining, copy constructor, static variables, wrapper classes, good class design Problem Description The first wave of midterms has passed, and it’s time to relax a little. You decide it’s time to go fishing, and you return with an impressive haul! You decide to apply your object-oriented programming skills to record information about your new fish…
0 notes