Showing posts with label jdk 7. Show all posts
Showing posts with label jdk 7. Show all posts

30 March 2009

Enhanced while statement proposal

A proposal for a multi‑layer while statement.

27 March 2009

'forget' keyword proposal

2026 version

An alternative proposal for control scope in Java.

26 March 2009

'final' without explicit type proposal

OVERVIEW

FEATURE SUMMARY:

MAJOR ADVANTAGE:
It allows people to concentrate on logic during operating on heavy generics and to use values which are more intuitive for them than variables.

MAJOR BENEFIT(s):

  • It allows to avoid duplicating unnecessarily types of declaration.
  • It increase a concentration on 'what I've got' than on 'what type is that' (we decrease size by one to obtain last element index, not because we can do this = it's int), while for variables we still keep concentrate on: 'what type is that' / 'what I can put there'.
  • Editing existing code to get some value from method chain is easier.
  • That method can be itself multi-thread with this, but it's a far future.
  • Using of Generics is easier.

MAJOR DISADVANTAGE:

  • Certainly, some people will overuse this solution.
  • Consider operator is easier to read.
  • It might be a problem if a person does not know how to give proper names for values.

ALTERNATIVES:
Normal variables.

20 March 2009

Glue classes proposal 0.9

OVERVIEW

FEATURE SUMMARY:

Glue classes allow to link utils direct with objects.

MAJOR ADVANTAGE:

Forgotten functionality can be not such big deal now.

MAJOR BENEFIT(s):

  • New functions can be easy localized (critically important while introduce new peoples into project).
  • Security: glue class do not see anything protected.
  • Light binding new functions with existing classes.
  • Number of used classes reduction.
  • Allow to assign methods and functions(static methods) to arrays, classes, interfaces, …
  • It's proof against same method occurs in class and delegator as well like in two delegators.
  • Allow to link gained(.jar) logic with new one, witch is impossible before final developer implements his classes.
  • Allow to project compact interfaces and do not worry about additional logic.

MAJOR DISADVANTAGE:
Do not know any ;) sorry.

ALTERNATIVES:
Utils classes, more work on project, duplicated code...

15 March 2009

Return 'this' proposal

GENESIS

It's a simplified 'This' type problem, which seems to be too much complicated as for now and need more analyses. Construction is designed not to interact with possibility that 'This' type will be introduced.

OVERVIEW

FEATURE SUMMARY:
It allows the method to return reference to 'this' object.

MAJOR ADVANTAGE:
Simplification of return this; statement.
'void' can be easy replaced with 'this'.

MAJOR BENEFIT(s): It would prevent NullPointerException, and make some 'builder' like interfaces look really clear and simple.

MAJOR DISADVANTAGE:
Returned value cannot be changed while inheritance.

ALTERNATIVES:
Self-bounded generics, This type.

14 March 2009

Read-only & Partial arrays proposal

Instrukcje

Tworzenie tablic do odczytu pozwoliło by zwiększyć szybkość jak i bezpieczeństwo pisanych programów. Była by to zwykła tablica tworzona na podstawie już istniejącej bez możliwości modyfikacji jej stanu.

Tablice częściowe tworzone na tablicach do odczytu pomogły by zmniejszyć ryzyko popełnienia błędu dostępu do niewłaściwego obszaru tablicy oraz zmniejszyło by zużycie pamięci.

12 March 2009

Glue classes proposal beta

OVERVIEW

Notice that it's beta specification: it's not described in full details, half validated (translation), and it's provided for you to pre-analyse. I still need some time to provide syntax which fully supports generics. Multi-glue classes are under consideration as well, but this may occur to be to complex to handle by any earth living programmer.

FEATURE SUMMARY:
Glue classes allow to link utils direct with objects.

MAJOR ADVANTAGE:
Forgotten functionality can be not such big deal now.

MAJOR BENEFIT(s):

  • New functions can be easy localised (critically important while introduce new peoples into project).
  • Security: glue class do not see anything protected.
  • Light binding new functions with existing classes.
  • Number of used classes reduction.
  • Allow to assign methods and functions(static methods) to arrays, classes, interfaces, …
  • It's proof against same method occurs in class and delegator as well like in two delegators.
  • Allow to link gained(.jar) logic with new one, witch is impossible before final developer implements his classes.
  • Allow to project compact interfaces and do not worry about additional logic.

MAJOR DISADVANTAGE:
Do not know any ;) sorry.

ALTERNATIVES:
Utils classes.

11 March 2009

Consider operator proposal

OVERVIEW

FEATURE SUMMARY:
Consider operator extends language with full value support and assign value to name and return it.

MAJOR ADVANTAGE:
It introduces natural division in variables and values.

It makes language to be more natural for human and generics easier to use.

MAJOR BENEFIT(s):

  • If we need to get a value, we can do that quite simple (without splitting expression or duplicating code).
  • Decrease number of potential bugs (value cannot be assigned).
  • It can help in splitting code to proper parts; nowdays, we need to declare variable regardless we need it or not (or make it final).
  • Decrease size of unnecessary code.
  • Method can be itself multi-thread with this, but it's far future.

MAJOR DISADVANTAGE:
Possibility to be unclear at start.

ALTERNATIVES:
Some time 'final' variables can be used, but it's more like for-each, life is better with it.

10 March 2009

Delegation proposal

OVERVIEW

FEATURE SUMMARY:
This change allow to delegate methods, interfaces and classes.

MAJOR ADVANTAGE:
It would be a first step for programmers to have something instead of inheritance, allowing to write better code.

MAJOR BENEFITS:
Java looks incomplete without something so base as delegating. Others are:

  • Code more immune for changes(if interface changes, there will be not so much to change, or I would say, changes will be on the right place, but not on all projects)
  • Decreasing costs of code modification.
  • Explicit defining MethodModifiers

MAJOR DISADVANTAGE:
Changes cost.

ALTERNATIVES:
It's nothing that cannot be implemented in a simple way, but this change does not increase delegation complex, unreadablity, and costs of support with each method.

9 March 2009

Final interfaces... proposal

Instrukcje

Interface (klasa abstrakcyjna) finalny nie mógłby zostać rozszerzony (zaimplementowany) przez żadną klasę(interface), oprócz tych określonych wprost.

8 March 2009

'forget' keyword proposal

Instrukcje

Słowo 'forget' powodowało by wymazanie zmiennej z obecnego kontekstu. Co pozwoliło by na bardziej intuicyjne operowanie logiką programu, w przypadku gdy dana zmienna nie może(powinna być) być już używana. Ma to niebanalne znaczenie gdy po jakimś czasie wracamy do napisanego kodu.

3 March 2009

'This' type

AUTHOR: Lasu aka Marek Kozieł http://lasu2string.blogspot.com/

OVERVIEW

FEATURE SUMMARY:
This type add ability to project valid interfaces(classes) for further extending/implementing. 'This' means current interface/class type or something implementing/extending it.

11 February 2009

Encapsulation though access control

Encapsulation does not necessarily means getters and setters. And have more than one aspects:

  • Inside structure control.
  • Input data validation.
  • Outside access control.
Lets consider 'Outside access control'.

While we directly do not know which class calls method, it's hard to limit context of (method) call. It is possible, but amount of work is to big now time.
Any way what solutions do we have?

4 February 2009

Using Strings and Objects in Switch case statements.

Lets consider enhancement on Sun Bug Database : 5012262

It's about letting us using String in switch.

30 December 2008

What do I need in JDK ?

I'll put some staff that I found that are much problem from time to time for me.

  • Lack of methods in File class...
  • String Comparator...
  • Thread Statics...
  • Add .shrink() for StringBuffer & StringBuilder...
  • 1st lvl type validation in standard Generics...
  • Generics variables...
  • Support for method to be able to return more than one variable...
  • Extended printStackTrace...
  • Read-Only Arrays...
  • 'forget' keyword...

28 December 2008

Null handling: Small language changes on JDK 7

The idea is about allowing people to handle null object situation as easy as possible (here by new operator). And I agree with that since even before.

27 December 2008

For-each loop: Small language changes on JDK 7

Lets talk about:

  • For-each loop over a Map
  • Control over for-each loops (index/remove)

At first, I asked myself if it's possible to obtain those targets just by a simple code.?
It's not so clear for all, but answer is YES.
However, there are still some small languages changes that would improve programming quality.

26 December 2008

String switch: Small language changes on JDK 7

According to Stephen Colebourne's Weblog: JDK 7 language changes - JavaEdge votes!
Allowing put String into switch statement is OK for me. But I cannot agree with placing that into JDK.
You can ask why. For me it's quite simple. Java is Object oriented language, while this change we make it more String or 'Script' oriented.