Code Monkey home page Code Monkey logo

devjava-content's Introduction

Contributing to Dev.java

Dev.java is the official website for the Java platform and language maintained by the Java Platform Group at Oracle. We accept contributions from community members through this repository. Click here for examples of contributed content.

This repository contains the contribution guidelines as well as a lightweight JavaScript toolchain to build the site into static HTML.

Here are the sections of this document:

Read This First

Thank you for showing interest in contributing to Dev.java. Getting your content featured and seen by hundreds of thousands of developers worldwide, and the endorsement of the Java Platform Group, is very exciting but will require some effort.

This document will outline the steps to get there. Please read and understand the complete document and any supporting documents as well.

When referring to the editors, the document is referring directly to the Java Developer Relations team on the Java Platform Group at Oracle.

Contributing Overview

Note: the editors reserve the right to accept, or reject, any contributions. Like contributing to Java itself, the bar is high, but the outcome is your contribution and attribution on the official Java developer site.

The process at a high level is as follows:

  1. We use GitHub issues to track a contribution through its lifecycle, and pull requests to review the content itself. For more details about each stage, see the Content Lifecycle section below.
  2. Most contributions will come directly from requested content issues.
  3. All content must start in the proposed stage and will use the Issue Template "Content Proposal". This is detailed in the Proposal section below.
  4. Once proposals move to approved, you will begin working on your contribution.
  5. Reviews of your content will take place as GitHub pull requests, and once accepted, will move to the scheduled and published phases.

Content Lifecycle

We use GitHub issues to track articles from conception to publication. An article will go through the following stages, which are marked with labels:

  • requested - Content that is needed and requested, a great place to start
  • proposed - Proposed for work but not approved
  • approved - Approved for work but not started
  • in progress - Under active development
  • scheduled - Completed and waiting for deployment
  • published - Published content

Content Proposal

All content must start with a Content Proposal. This will be in the form of a GitHub issue using the Content Proposal issue template. Basic steps:

  1. Look through the requested issues and find something that you feel uniquely capable of writing
  2. Create a new issue with issue template Content Proposal. Please make sure the proposal thoroughly describes what you intend to contribute. An outline format detailing the sections and a sentence that describes what will be covered in each section, is preferred.
  3. Fill out the fields to the best of your ability
  4. Submit the issue.
  5. The editors will now review your proposal and follow up with any other information needed. The status of the issue will eventually move to either approved or rejected.

GitHub Workflow

Once your proposal has been moved to the approved stage, you can begin working on your content. Here are the steps to do this:

  1. Fork this repo
  2. Create a branch off of main for each piece of content
  3. Build the site. Please see the building the site section below.
  4. Create your content (see the Working with Content section below)
  5. Submit a pull request back to this repo

Content License

Contributors must sign the Oracle Contributor Agreement which will be verified once there is a pull request created. Contributed content is made available under the UPL license. You can find examples here.

Building the Site

There is some basic JavaScript infrastructure to help build the static site. There are two options:

Option 1: Build locally

  1. install node and npm. easiest way is nvm and nvm use in this directory.
  2. npm install
  3. npm install gulp -g
  4. gulp

A browser should launch viewing https://localhost:3000

Option 2: Use Docker

  1. docker build --tag devjava .
  2. docker run --publish 3000:3000 --init -it --rm devjava

You should then be able to open a browser and visit https://localhost:3000

(For a more dynamic development experience avoiding a Docker build after every change, you can mount the local /app folder to the container by adding option -v $PWD/app:/app/app to your docker run command. Note: $PWD may not work in Windows.)

Working with Content

See working with content guide

devjava-content's People

Contributors

ammbra avatar boyarsky avatar carimura avatar cayhorstmann avatar danthe1st avatar josepaumard avatar kabutz avatar mlvandijk avatar nipafx avatar smthelusive avatar squidxtv avatar venkats avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

devjava-content's Issues

Content license

The purpose of this repository is to provide Java-related content for everyone and allow that knowledge to be used.

However, I don't see a LICENSE file in this repository.
How is the existing content of this repository licensed?
And what about third-party/Community contributions? How do they know which license they provide their content under?
Does contributing require signing the OCA? If so, which one (or which projects) is required for this repository?

I think it might be important to sort this out before the first actual (content) contributions.

Effectively broken link in README.md

The README.md file refers to the root web page of inside.java in a manner suggesting that the target contains an announcement on accepting contributions to dev.java:

We [recently announced](https://inside.java) that we are accepting contributions to Dev.java. This repository contains a lightweight JavaScript toolchain to build the site into static HTML and guidelines for contributing to it.

I wasted at least 15 minutes trying to find the respective announcement on the target website but was unable to find it. I'd say that this link is effectively broken. The inside.java web page contains many news items, and if the respective announcement is contained in one of these many, the link in README.md should refer to that news item instead of the root page.

[Request] Regexes

I think dev.java should contain an article on regexes.

Specifically, I would suggest that such an article includes:

  • What are regexes?
  • How can regexes be used in Java?
    • using String methods (matches/replaceAll/split)
    • Compiling Patterns
    • using Matcher for finding occurences in Strings, working with groups, etc.
  • quick overview on regex features

[Request] Debugging

This request may be a bit controversial since it is not that specific to Java but I see many people learning Java experiencing issues without knowing what a debugger is and how to solve it.

We often refer to this Stack Overflow post when this question is asked in our JUG (which has a focus on helping new Java developers).

I propose to add an article that explains

Non-Goals:

  • How do (Java) debuggers work internally?
    • This could be the scope of another article but I am talking about an introductory thing.

[Request] How to read stack traces

There are currently 4 articles about exceptions on dev.java.

However, none of them seem to explain what exactly a stack trace is, how to read it and how to find out where the issue is.

I frequently see new Java users (e.g. students) being confused by (especially bigger) stack traces with no idea on how to debug them.

While this Stack Overflow post explains it quite well, I think this is a good fit and would be a helpful article (especially for referencing it to new Java developers).

I would like such an article to contain the following:

  • What is a stack trace?
  • When is a stack trace displayed on the console (or in other logs)?
  • What is a Caused By section?
  • What is a Suppressed section?
  • What should people look at/focus on when reading (bigger) stack traces?
    • Differentiating between own code and other code (in frameworks)
  • Why is it often a bad idea to use System.out.println("error"); instead of e.printStackTrace(); (or re-throwing) in a catch-block for exceptions that shouldn't happen?

Machine-readable article list

I would like to ask about adding some endpoint that emits a list of articles on dev.java, e.g. a sitemap (though it would be useful to have access to the article titles).
This would allow for building tools for finding and referring to articles without needing to scrape the site.

Potentially confusing statement about DirectoryStream

In https://dev.java/learn/java-io/file-system/listing/, it says:

Remember: The returned DirectoryStream is a stream. If you are not using a try-with-resources statement, do not forget to close the stream in the finally block. The try-with-resources statement takes care of this for you. You can learn more about stream in the Stream section.

What does "...is a stream" mean? A java.util.stream.Stream? A java.io.InputStream or java.io.OutputStream? It is neither. Maybe the author meant "...is an AutoCloseable"?

Reword "foreach" loop in "Refactoring to functional style" series introduction

@venkats contributes the Refactoring from the Imperative to the Functional Style series to dev.java.

In the series introduction/index page, there is a table containing all tutorials as well as how these are transformed.
The Imperative Style column of that table contains cells like foreach(...) { if... } even though Java uses the syntax for(TypeName variableName : someIterable).

I suggest changing this in order to not make it look like Java has a foreach keyword.

[Proposal] Java certifications

Request Issue

No response

Website Section

No response

Proposal Details

Article on Java certification. Chad ok'd idea over email

Author References

No response

[Proposal] HTTP/2 Client APIs

Request Issue

#8

Website Section

Home --> Tutorials --> HTTP Client

Proposal Details

  • Why this API and not other HTTP clients?
    • Lightweight
    • No dependencies
  • Fetching recipe data from TheMealDB
    • Building an HttpClient
    • Building an HttpRequest
    • Getting an HttpResponse
      • Method 1: synchronous
      • Method 2: asynchronous

Author References

"Know Your Java?" Content Series

Approved Content Discussed in #24

Originally posted by venkats June 12, 2023

Content Details

Greetings,

I request the feedback on the topics for an article series I'd like to write. The following are a few ideas I have in mind:

Topics:
Know Your Java?
Refactoring from Imperative to Functional Style
Making use of Pattern Matching

Details:
Know Your Java?:
12-parts articles on Know your Java? The topics will include things in Java that developers may miss, the compilers may not catch, unit tests sometimes may not detect, but is useful for developers to know. In each article, the reader will look at a sample code, try to guess the behavior, will then learn about the actual behavior, and reasons, and the ways to fix or the lessons they can learn.

Refactoring from Imperative to Functional Style
12-parts article on functional thinking. In each part, the reader will start with an imperative style code, then walk thought how to approach writing that code in functional style, and see the refactoring of the code to functional style unfold.

Making use of Pattern Matching
12-parts article on pattern matching. This series will approach how readers can apply pattern matching to solve common code from traditional to more modern Java.

Please let me know your thoughts if any of these is interesting and, if so, which one you'd suggest I focus on.

Thank you.

Website Section

No response

Is the proposal issue necessary or not?

The README mentions:

All content must start with a Content Proposal. This will be in the form of a GitHub issue using the Content Proposal issue template.

and it differentiates from requests as it seems to expect a [requested] issue before that:

Look through the requested issues and find something that you feel uniquely capable of writing

This also seems to be strengthened by the Content Proposal issue template which expects a Request Issue.

However, it seems that the [approved] label is typically put on accepted content requests (at least after this repo was opened for Community Contributions).
Furthermore, both #45 and #49 didn't seem to need a proposal issue, the request (followed by the future author being assigned to it) seemed to be sufficient.

Therefore, I propose to remove the distinction between content proposals. I would suggest to:

  • Add an issue template for requests (or remove the Request Issue field from the Content Proposal template).
  • Create a Pull Request template from the current Content Proposal template since it makes sense for PRs to mention the request issue (and all other fields from there).
  • Clean up the tags so only the tags actually being used are listed. For example, I haven't seen any usage of the [in progress] label.
  • Adapt the README to reflect this workflow.

Getting started with Java in IntelliJ

Request Issue

No response

Website Section

Learn --> Tutorials --> Your First Java App.

Proposal Details

Would be great to have a getting started with Java article and IntelliJ.

Author References

Marit van Dijk (@mlvandijk) would be great to complete this ask 😸

[Request] Explain HelloWorld

Get somebody from zero to "Hello, World":

  • brief explanation of what a JDK is and where to get it (at least partially, this already exist on the site ~> link there)
  • explanation of editing a .java file with a text editor and how to run it with java (now javac - see JEP 330)
  • shortest possible HelloWorld (ignoring JEP 445 for now)
  • brief explanation of the involved concepts with links to the articles that explain them in more detail

Add exercises at the end of each topic [Proposal]

Request Issue

No response

Website Section

Learn > Tutorials

Proposal Details

I would like a session with fixation exercises to be added to the dev.java so that we can put into practice what we have learned. It may not necessarily be a program for us to do. Sometimes it could be a quiz, I don't know. It would be very interesting <3

Author References

No response

[Request] enums

The Classes and Objects section mentions covering enumerations. However, that part is missing.

I think a page about enumerations should be added there:

  • What are enumerations?
  • How to create them?
  • What functionality do enumerations provide in Java?

[Request] Classpath Resources

A common source of confusion among (somewhat) new Java developers (especially when they are packaging their first application as a JAR) is resources on the classpath and how they are different from files.

I would request an article clarifying these things, specifically the following:

  • What's the difference between resources and files?
  • When I access a file in my source folder using java.io.File (or similar), why does it not work in a JAR deployed somewhere (in a different directory, on a different computer, ...)
    • Why should I not use files for accessing anything in the source folder?
  • What does Class#getResource/Class#getResourceAsStream do?
  • What's the difference between getClass.getResource("a.txt"), getClass().getResource("/a.txt") and getClass().getClassLoader().getResource("a.txt")?
    • Why does it not find my resource when I use the wrong one?
  • Where should I put resources?
    • with Maven/Gradle but also in plain Eclipse/IntelliJ/VSC projects

Move "Staying Aware of New Features" after "Mastering the API"

For new Java developers, the Staying Aware of New Features section isn't that useful (in my opinion).

Hence, I propose moving it down somewhere after the Mastering the API section because Getting to Know the Language and Mastering the API are the sections that seem to be most useful for new developers.

Furthermore, it might be a good idea to sort other in order of difficulty so the most basic articles are first and each article appears after the articles it depends on.
For example, the Refactoring from the Imperative to the Functional Style series seems to be more advanced compared to other topics in that section so it may be worth moving it a bit down.

Refactoring from Imperative to Functional Style

Approved from Content Discussed in #24

Originally posted by venkats June 12, 2023

Content Details

Greetings,

I request the feedback on the topics for an article series I'd like to write. The following are a few ideas I have in mind:

Topics:
Know Your Java?
Refactoring from Imperative to Functional Style
Making use of Pattern Matching

Details:
Know Your Java?:
12-parts articles on Know your Java? The topics will include things in Java that developers may miss, the compilers may not catch, unit tests sometimes may not detect, but is useful for developers to know. In each article, the reader will look at a sample code, try to guess the behavior, will then learn about the actual behavior, and reasons, and the ways to fix or the lessons they can learn.

Refactoring from Imperative to Functional Style
12-parts article on functional thinking. In each part, the reader will start with an imperative style code, then walk thought how to approach writing that code in functional style, and see the refactoring of the code to functional style unfold.

Making use of Pattern Matching
12-parts article on pattern matching. This series will approach how readers can apply pattern matching to solve common code from traditional to more modern Java.

Please let me know your thoughts if any of these is interesting and, if so, which one you'd suggest I focus on.

Thank you.

Website Section

No response

[Report mistake] : Option to launch JFR is misspelled in page "Getting Started with the JDK Flight Recorder"

This issue does not request nor propose a new content. But it stands for reporting a mistake in the website dev.java

In the page Getting Started with the JDK Flight Recorder, at the section "Enabling JFR on Startup", it is written :

To enable JFR on startup, include the VM argument -XX:StartFlightRecorder

As far as I know, the right option name is -XX:StartFlightRecording. The mistake happens thrice on the web page. The other pages are OK.

Please, can you fix it ?

Addition of some important things in Dev.java

Hello everybody! I hope you are well.

I would like to give an idea to everyone who maintains Dev.java.
I'm learning a lot there ❤️ I've already completed several topics and this makes me very excited and motivated to always want more. But I've been noticing something for a while: I noticed that there are no tutorials on networks (http) and on Databases (Maybe it's me who's not finding it, even though I've already viewed everything and haven't found it).

Could you add tutorials related to this? It would also be interesting, in addition to the already added JavaFX tutorial, Also have a tutorial related to swing? It would be interesting, since swing is easier to learn than JavaFX. Swing would be like a prelude to JavaFX.

It would also be helpful if the tutorial related to threads and concurrency were added to Dev.java.

I know that all this already exists in the documentation tutorial, but it would be nice if it were more exemplified in the dev.java website.

In advance, I am immensely grateful and, thank you very much for this great chance to learn and get to know this perfect tool that is Java ❤️❤️🥹

[Request] Writing Java applications with Eclipse

Since it seems that we already have an article about using Java in VSC and at an article about IntelliJ is in the process of being added in #62, I think another article should be added for the Eclipse IDE.

There are many people using it so it would be weird to leave it out.

Website section

Learn > Tutorials > Your First Java App

Details

I could imagine the following sections:

  • Introduction/installation
  • creating Java projects
    • possibly including build tools (I am not talking about an introduction to build tools, just about creating Maven/Gradle projects in Eclipse)
  • Debugging functionality (Debug perspective, associated buttons, etc)
  • Content assist
    • I don't think it's necessary to talk about setting auto activation keys but this is a possibility as well.
  • Differentiation between workspaces and projects
  • possibly Ctrl+1 (quick fix), Ctrl+3 (quick access)
  • Refactoring/Generation/Autoformatting
    • only a quick overview showing the options being there
    • not including any configuration of autoformatting etc

Author references

I would be interested in writing this but I am also open to other people writing it.

Modern I/O

Approved Content Discussed in #22

Originally posted by cayhorstmann June 7, 2023

Content Details

An article on the more or less recent changes in I/O libraries, showing readers to use modern one-liners instead of loops with BufferedReader. An expanded version of https://horstmann.com/unblog/2023-04-09/index.html

Website Section

Learn -> Tutorials -> Staying Aware of New Features?

"References for the latest release" pointing to 21

On /learn, the section References for the latest release contains multiple links to sites about JDK 21 even though the latest release is 22:

  • Java Documentation
  • Java API Docs
  • Java Release Notes

I propose to either update these links to 22 or change the heading to not say "latest release".

Looming Changes in Concurrency

Approved content Discussed in #21

Originally posted by cayhorstmann June 7, 2023

Content Details

An article on the state of Loom, with a focus on how to use it in practice.

Website Section

No response

[Request] Introduction to concurrency in Java

What is concurrent programming? Why do we do it? How do we do it safely? On the latter question, there's lots to explore:

  • thread pools vs virtual threads (what to use when?)
  • concurrent data structured (see #9)
  • locks, semaphores, etc.

Basically, everything in a java.util.concurrent.* package.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.