• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 00:34
CEST 06:34
KST 13:34
  • Home
  • Forum
  • Calendar
  • Streams
  • Liquipedia
  • Features
  • Store
  • EPT
  • TL+
  • StarCraft 2
  • Brood War
  • Smash
  • Heroes
  • Counter-Strike
  • Overwatch
  • Liquibet
  • Fantasy StarCraft
  • TLPD
  • StarCraft 2
  • Brood War
  • Blogs
Forum Sidebar
Events/Features
News
Featured News
Code S Season 1 - RO8 Preview5[ASL21] Ro8 Preview Pt2: Progenitors8Code S Season 1 - RO12 Group A: Rogue, Percival, Solar, Zoun13[ASL21] Ro8 Preview Pt1: Inheritors16[ASL21] Ro16 Preview Pt2: All Star10
Community News
Maestros of The Game 2 announcement and schedule !7Weekly Cups (April 27-May 4): Clem takes triple0RSL Revival: Season 5 - Qualifiers and Main Event12Code S Season 1 (2026) - RO12 Results12026 GSL Season 1 Qualifiers25
StarCraft 2
General
Code S Season 1 - RO8 Preview Behind the Blue - Team Liquid History Book Weekly Cups (April 27-May 4): Clem takes triple Blizzard Classic Cup @ BlizzCon 2026 - $100k prize pool Code S Season 1 (2026) - RO12 Results
Tourneys
Sparkling Tuna Cup - Weekly Open Tournament Sea Duckling Open (Global, Bronze-Diamond) Maestros of The Game 2 announcement and schedule ! GSL Code S Season 1 (2026) RSL Revival: Season 5 - Qualifiers and Main Event
Strategy
Custom Maps
[D]RTS in all its shapes and glory <3 [A] Nemrods 1/4 players
External Content
Mutation # 524 Death and Taxes The PondCast: SC2 News & Results Mutation # 523 Firewall Mutation # 522 Flip My Base
Brood War
General
Quality of life changes in BW that you will like ? Why there arent any 256x256 pro maps? BGH Auto Balance -> http://bghmmr.eu/ RepMastered™: replay sharing and analyzer site Tulbo's ASL S21 Ro8 Post-Review
Tourneys
[ASL21] Ro8 Day 4 [ASL21] Ro8 Day 3 Escore Tournament StarCraft Season 2 [Megathread] Daily Proleagues
Strategy
Simple Questions, Simple Answers Fighting Spirit mining rates What's the deal with APM & what's its true value Any training maps people recommend?
Other Games
General Games
Stormgate/Frost Giant Megathread Nintendo Switch Thread Daigo vs Menard Best of 10 Path of Exile OutLive 25 (RTS Game)
Dota 2
The Story of Wings Gaming
League of Legends
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Deck construction bug Heroes of StarCraft mini-set
TL Mafia
Vanilla Mini Mafia Mafia Game Mode Feedback/Ideas TL Mafia Community Thread Five o'clock TL Mafia
Community
General
US Politics Mega-thread The Letting Off Steam Thread European Politico-economics QA Mega-thread UK Politics Mega-thread Canadian Politics Mega-thread
Fan Clubs
The IdrA Fan Club
Media & Entertainment
Anime Discussion Thread [Manga] One Piece [Req][Books] Good Fantasy/SciFi books
Sports
2024 - 2026 Football Thread McBoner: A hockey love story Formula 1 Discussion
World Cup 2022
Tech Support
streaming software Strange computer issues (software) [G] How to Block Livestream Ads
TL Community
The Automated Ban List
Blogs
How EEG Data Can Predict Gam…
TrAiDoS
ramps on octagon
StaticNine
Funny Nicknames
LUCKY_NOOB
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1196 users

The Big Programming Thread - Page 744

Forum Index > General Forum
Post a Reply
Prev 1 742 743 744 745 746 1032 Next
Thread Rules
1. This is not a "do my homework for me" thread. If you have specific questions, ask, but don't post an assignment or homework problem and expect an exact solution.
2. No recruiting for your cockamamie projects (you won't replace facebook with 3 dudes you found on the internet and $20)
3. If you can't articulate why a language is bad, don't start slinging shit about it. Just remember that nothing is worse than making CSS IE6 compatible.
4. Use [code] tags to format code blocks.
Manit0u
Profile Blog Joined August 2004
Poland17743 Posts
July 21 2016 20:10 GMT
#14861
On July 22 2016 01:56 Shield wrote:
Verbosity is good as long as it's not abused. You should really read Clean Code before you go further with this discussion.


I did read it. And I still think that "readAllLines" could as well be "getLines" without any detriment to readability...
Time is precious. Waste it wisely.
Birdie
Profile Blog Joined August 2007
New Zealand4438 Posts
July 21 2016 20:20 GMT
#14862
Aren't reallyLongAndAwesomelyDescriptiveMethodNames good sometimes? If it's the most accurate way of describing the use of the function then it isn't unnecessary or useless, even if it's a bit long. Plus with autocomplete, it's not "expensive" for typing to have a longer method name.
Red classic | A butterfly dreamed he was Zhuangzi | 4.5k, heading to 5k as support!
Shield
Profile Blog Joined August 2009
Bulgaria4824 Posts
Last Edited: 2016-07-21 21:20:17
July 21 2016 21:15 GMT
#14863
On July 22 2016 05:20 Birdie wrote:
Aren't reallyLongAndAwesomelyDescriptiveMethodNames good sometimes? If it's the most accurate way of describing the use of the function then it isn't unnecessary or useless, even if it's a bit long. Plus with autocomplete, it's not "expensive" for typing to have a longer method name.


Descriptive method name is like first impression from meeting someone. Do you want to impress them or do you want to disgust them?

On July 22 2016 05:10 Manit0u wrote:
Show nested quote +
On July 22 2016 01:56 Shield wrote:
Verbosity is good as long as it's not abused. You should really read Clean Code before you go further with this discussion.


I did read it. And I still think that "readAllLines" could as well be "getLines" without any detriment to readability...


"getLines"? Which lines? If you have N lines (N = 10), how many lines? From 1 to 5? From 1 to 6? From 1 to n? readAllLines is unambigious. There is no confusion at all.
Shield
Profile Blog Joined August 2009
Bulgaria4824 Posts
Last Edited: 2016-07-21 21:20:10
July 21 2016 21:19 GMT
#14864
second post by mistake
Prillan
Profile Joined August 2011
Sweden350 Posts
Last Edited: 2016-07-21 21:24:57
July 21 2016 21:21 GMT
#14865
On July 22 2016 05:20 Birdie wrote:
Aren't reallyLongAndAwesomelyDescriptiveMethodNames good sometimes? If it's the most accurate way of describing the use of the function then it isn't unnecessary or useless, even if it's a bit long. Plus with autocomplete, it's not "expensive" for typing to have a longer method name.


In my opinion, if you need a whole sentence to name a method, it's probably the case that the method is way too complex and needs to be re-factored.

EDIT: readAllLines is a perfectly fine name. getAllLines would be fine too, but I don't particularly like getLines for the same reason as the previous poster.
TheBB's sidekick, aligulac.com | "Reality is frequently inaccurate." - Douglas Adams
Shield
Profile Blog Joined August 2009
Bulgaria4824 Posts
Last Edited: 2016-07-21 21:30:07
July 21 2016 21:26 GMT
#14866
On July 22 2016 06:21 Prillan wrote:
Show nested quote +
On July 22 2016 05:20 Birdie wrote:
Aren't reallyLongAndAwesomelyDescriptiveMethodNames good sometimes? If it's the most accurate way of describing the use of the function then it isn't unnecessary or useless, even if it's a bit long. Plus with autocomplete, it's not "expensive" for typing to have a longer method name.


In my opinion, if you need a whole sentence to name a method, it's probably the case that the method is way too complex and needs to be re-factored.


What about this one?


deserialiseResultAndRecordInDatabase(Json json)
{
SomeResult result = SomeResult::deserialise(json);
_database.recordResult(result);
}


It could be broken down into two separate methods. I agree with that, but it's not a complex method despite long name.
Nesserev
Profile Blog Joined January 2011
Belgium2760 Posts
July 21 2016 21:41 GMT
#14867
--- Nuked ---
Shield
Profile Blog Joined August 2009
Bulgaria4824 Posts
July 21 2016 22:57 GMT
#14868
On July 22 2016 06:41 Nesserev wrote:
Show nested quote +
On July 22 2016 00:00 Manit0u wrote:
This thread is the best on TL

Clearly, you have never visited the 'Korean Music Discussion' thread.

All this talk about Java's (and C#) verbosity, while there are clearly bigger gripes to be had with Java; generics are fundamentally broken, lack of constness, equals() vs. ==, mandatory checked exceptions, horrible APIs, 'package' being the default access modifier, etc.


Broken generics? What do you mean?
tofucake
Profile Blog Joined October 2009
Hyrule19210 Posts
July 21 2016 23:16 GMT
#14869
On July 22 2016 02:36 Doodsmack wrote:
Are Microsoft SQL Server skills (including T-SQL obv) valuable and future-secure?

no

Good to know, and there will always be MSSQL jobs, but Linux servers are like 98% of the internet
Liquipediaasante sana squash banana
ZenithM
Profile Joined February 2011
France15952 Posts
Last Edited: 2016-07-21 23:24:48
July 21 2016 23:21 GMT
#14870
On July 22 2016 06:21 Prillan wrote:
Show nested quote +
On July 22 2016 05:20 Birdie wrote:
Aren't reallyLongAndAwesomelyDescriptiveMethodNames good sometimes? If it's the most accurate way of describing the use of the function then it isn't unnecessary or useless, even if it's a bit long. Plus with autocomplete, it's not "expensive" for typing to have a longer method name.


In my opinion, if you need a whole sentence to name a method, it's probably the case that the method is way too complex and needs to be re-factored.

EDIT: readAllLines is a perfectly fine name. getAllLines would be fine too, but I don't particularly like getLines for the same reason as the previous poster.

I like "readAllLines" better than "getAllLines" because in the first case the I/O process is clear (probably with side effects too), and "get" in general is a really vague method prefix. I know it's idiomatic Java, but you could just name the get method "allLines" instead, like we would do in Scala.

On July 22 2016 07:57 Shield wrote:
Show nested quote +
On July 22 2016 06:41 Nesserev wrote:
On July 22 2016 00:00 Manit0u wrote:
This thread is the best on TL

Clearly, you have never visited the 'Korean Music Discussion' thread.

All this talk about Java's (and C#) verbosity, while there are clearly bigger gripes to be had with Java; generics are fundamentally broken, lack of constness, equals() vs. ==, mandatory checked exceptions, horrible APIs, 'package' being the default access modifier, etc.


Broken generics? What do you mean?

He probably means that they're just a patchwork solution and not actually designed into the JVM. Fucking casts from Object everywhere :D. Also, at the compiler level, the type system is really restrictive as far as generics go.
Manit0u
Profile Blog Joined August 2004
Poland17743 Posts
Last Edited: 2016-07-22 01:01:42
July 22 2016 00:37 GMT
#14871
On July 22 2016 08:21 ZenithM wrote:
Show nested quote +
On July 22 2016 06:21 Prillan wrote:
On July 22 2016 05:20 Birdie wrote:
Aren't reallyLongAndAwesomelyDescriptiveMethodNames good sometimes? If it's the most accurate way of describing the use of the function then it isn't unnecessary or useless, even if it's a bit long. Plus with autocomplete, it's not "expensive" for typing to have a longer method name.


In my opinion, if you need a whole sentence to name a method, it's probably the case that the method is way too complex and needs to be re-factored.

EDIT: readAllLines is a perfectly fine name. getAllLines would be fine too, but I don't particularly like getLines for the same reason as the previous poster.

I like "readAllLines" better than "getAllLines" because in the first case the I/O process is clear (probably with side effects too), and "get" in general is a really vague method prefix. I know it's idiomatic Java, but you could just name the get method "allLines" instead, like we would do in Scala.


Well, getLines is from Scala actually

http://www.scala-lang.org/api/current/index.html#scala.io.Source@getLines():Iterator[String]

Anyway, while I agree that unambiguous names are good, probably if your class/method name is long it's probably too complex or too descriptive (I find that programmers tend to be smart people and can infer quite a lot of information that isn't readily present).

I mean, let's just compare some simple stuff from commonly used applications (a simple controller in a web framework):

Java (Spring):

package hello;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@Controller
public class GreetingController {

@RequestMapping("/greeting")
public String greeting(@RequestParam(value="name", required=false, defaultValue="World") String name, Model model) {
model.addAttribute("name", name);
return "greeting";
}

}


Ruby (Rails):

class GreetingController < ApplicationController
def greeting
defaults = {:name => 'World'}
params = defaults.merge(params)

@greeting.name = params[:name]
end
end


Python (Django):

// non-class based views
def greeting(request, name='World'):
return render_to_response('greeting.html', {'name': request.GET['name']})

// class based views
from django.views.generic import View

class GreetingView(View):
def get(self, request, name='World'):
return render_to_response('greeting.html', {'name': request.GET['name']})


I might be a bit off with Django, haven't done anything in it for a while.

As you can see, it's definitely possible to achieve the same thing without being too verbose and without losing too much clarity on the matter.

The biggest problem that Java's verbosity poses for me is not the fact that it's hard to understand but the fact that there's simply so much more to read, which significantly increases time required to assess the code and its function. I don't know about you but I read code way more often than I write it and making this process harder isn't good for me.

In this regard Ruby is pretty awesome. Just going back to our readAllLines examples:

File.open('my_file.txt').each_line

File.readlines('my_file.txt')

File.foreach('my_file.txt')


All of them will work.
Time is precious. Waste it wisely.
berated-
Profile Blog Joined February 2007
United States1134 Posts
July 22 2016 01:10 GMT
#14872
On July 22 2016 08:16 tofucake wrote:
Show nested quote +
On July 22 2016 02:36 Doodsmack wrote:
Are Microsoft SQL Server skills (including T-SQL obv) valuable and future-secure?

no

Good to know, and there will always be MSSQL jobs, but Linux servers are like 98% of the internet


Which is probably why MS SQL is coming to linux.
tofucake
Profile Blog Joined October 2009
Hyrule19210 Posts
July 22 2016 02:06 GMT
#14873
Yeah Microsoft realized they can't compete with php/js/mysql if their shit doesn't work on Linux, which is a big part of why they are open sourcing and porting everything.
Liquipediaasante sana squash banana
RoomOfMush
Profile Joined March 2015
1296 Posts
July 22 2016 07:02 GMT
#14874
On July 22 2016 06:41 Nesserev wrote:
All this talk about Java's (and C#) verbosity, while there are clearly bigger gripes to be had with Java; generics are fundamentally broken, lack of constness, equals() vs. ==, mandatory checked exceptions, horrible APIs, 'package' being the default access modifier, etc.

What is so bad about javas generics? I have much bigger problems with C#'s generics since they dont have the wildcard operator. I often find myself wishing I could write List<?> but that is not as easy as it is in Java. The only problem with Java generics I have is the fact you can not create generic arrays or call .class on generic type parameters (for obvious reasons).

What is the lack of "constness"?

And what is the problem of "equals() vs. =="? Do you mean you have a problem with both having a different meaning in java? Because I dont know why having more options is bad compared to having two ways to do the same thing.

Checked exceptions are not a bad thing either. It is bad that they are used within the JDK, but I am very happy that I can define my own checked exceptions and force myself to use them in my code with a compiler pointing out everytime I missed one.

The package access modifier is shit though. But its a relict of the very first versions of java. Its history and the java people dont ever want to break backwards compatibility (which you can like or dislike but at least they are consistent).
Prillan
Profile Joined August 2011
Sweden350 Posts
July 22 2016 11:20 GMT
#14875
On July 22 2016 06:26 Shield wrote:
Show nested quote +
On July 22 2016 06:21 Prillan wrote:
On July 22 2016 05:20 Birdie wrote:
Aren't reallyLongAndAwesomelyDescriptiveMethodNames good sometimes? If it's the most accurate way of describing the use of the function then it isn't unnecessary or useless, even if it's a bit long. Plus with autocomplete, it's not "expensive" for typing to have a longer method name.


In my opinion, if you need a whole sentence to name a method, it's probably the case that the method is way too complex and needs to be re-factored.


What about this one?


deserialiseResultAndRecordInDatabase(Json json)
{
SomeResult result = SomeResult::deserialise(json);
_database.recordResult(result);
}


It could be broken down into two separate methods. I agree with that, but it's not a complex method despite long name.

It's not always true of course, but in this case I don't see the need of an extra function at all. I'd just write

database.record_result(deserialize(data))

or if I had to name it, store_result would be enough.

Anyways, let's not get into too many examples because we could end up doing that forever otherwise, so let me rephrase it.

In my opinion, in general, if you need a whole sentence to name a method, you could probably refactor it or rename it.

I don't think that Java is overly verbose on this, but Swift on the other hand, just wow.
TheBB's sidekick, aligulac.com | "Reality is frequently inaccurate." - Douglas Adams
Manit0u
Profile Blog Joined August 2004
Poland17743 Posts
July 22 2016 11:42 GMT
#14876
Tried to update Apache Camel to newer version, including the dependencies. Upped the versions in pom.xml, mvn clean, mvn install and now the builds fail because fucking spring-test package is using juni4 packages instead of junit38 and every single test fails to compile since 90% of the imports are now obsolete or changed.

I hate my life right now.
Time is precious. Waste it wisely.
Nesserev
Profile Blog Joined January 2011
Belgium2760 Posts
Last Edited: 2016-07-22 11:55:07
July 22 2016 11:54 GMT
#14877
--- Nuked ---
RoomOfMush
Profile Joined March 2015
1296 Posts
July 22 2016 13:01 GMT
#14878
You have the "final" keyword in java which does just that. If a variable is declared final its value will never change. If a class is declared final it can not be extended anymore. If a method is final it can not be overwritten.
Its not exactly what you are describing though.

All these things you mention can be done in java with code but are special functions build into the core of the language instead. I can see how some people can like that, but I prefer less keywords and doing things on my own by writing good code. I mean I can see these things being useful, but I never actually needed them myself.
Blitzkrieg0
Profile Blog Joined August 2010
United States13132 Posts
Last Edited: 2016-07-22 15:23:55
July 22 2016 13:14 GMT
#14879
On July 22 2016 22:01 RoomOfMush wrote:
You have the "final" keyword in java which does just that. If a variable is declared final its value will never change. If a class is declared final it can not be extended anymore. If a method is final it can not be overwritten.
Its not exactly what you are describing though.

All these things you mention can be done in java with code but are special functions build into the core of the language instead. I can see how some people can like that, but I prefer less keywords and doing things on my own by writing good code. I mean I can see these things being useful, but I never actually needed them myself.


Final and const are not equivalent at all. Setting a parameter to const says that the function will not change that value. Java's final makes it immutable so it can never be changed. For instance, I could have the following functions:

void printValue(const int value)
int addValue(int value)

Consider the situation where I pass value to printValue, addValue, and then printValue again. I can pass my int to each of these functions and const just guarantees that the value won't be changed.

If I made a final int in Java like you suggest then I wouldn't be able to call addValue. Const provides a completely different meaning.
I'll always be your shadow and veil your eyes from states of ain soph aur.
Nesserev
Profile Blog Joined January 2011
Belgium2760 Posts
Last Edited: 2016-07-22 13:30:01
July 22 2016 13:15 GMT
#14880
--- Nuked ---
Prev 1 742 743 744 745 746 1032 Next
Please log in or register to reply.
Live Events Refresh
Replay Cast
00:00
2026 GSL S1: Ro8 Group B
CranKy Ducklings123
Liquipedia
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
SpeCial 163
RuFF_SC2 163
StarCraft: Brood War
Britney 18173
Calm 4701
JulyZerg 112
Shinee 25
Bale 10
Icarus 6
Dota 2
NeuroSwarm148
League of Legends
JimRising 813
Counter-Strike
Doublelift3116
Stewie2K538
Other Games
summit1g11482
WinterStarcraft440
monkeys_forever399
Organizations
Other Games
gamesdonequick2507
Counter-Strike
PGL344
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
[ Show 12 non-featured ]
StarCraft 2
• practicex 15
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Stunt164
Upcoming Events
Sparkling Tuna Cup
5h 26m
RSL Revival
5h 26m
Cure vs Zoun
Clem vs Lambo
WardiTV Invitational
7h 26m
ByuN vs Rogue
Solar vs Ryung
Zoun vs Percival
Cure vs SHIN
BSL
14h 26m
Dewalt vs DragOn
Aether vs Jimin
GSL
1d 3h
Afreeca Starleague
1d 5h
Soma vs Leta
Wardi Open
1d 7h
Monday Night Weeklies
1d 11h
OSC
1d 19h
CranKy Ducklings
2 days
[ Show More ]
Afreeca Starleague
2 days
Light vs Flash
Replay Cast
3 days
Replay Cast
3 days
The PondCast
4 days
Replay Cast
4 days
RSL Revival
5 days
Korean StarCraft League
5 days
RSL Revival
6 days
BSL
6 days
Liquipedia Results

Completed

Escore Tournament S2: W6
WardiTV TLMC #16
Nations Cup 2026

Ongoing

BSL Season 22
ASL Season 21
CSL 2026 SPRING (S20)
IPSL Spring 2026
KCM Race Survival 2026 Season 2
Acropolis #4
KK 2v2 League Season 1
BSL 22 Non-Korean Championship
SCTL 2026 Spring
RSL Revival: Season 5
2026 GSL S1
PGL Astana 2026
BLAST Rivals Spring 2026
IEM Rio 2026
PGL Bucharest 2026
Stake Ranked Episode 1
BLAST Open Spring 2026
ESL Pro League S23 Finals
ESL Pro League S23 Stage 1&2

Upcoming

YSL S3
Escore Tournament S2: W7
Escore Tournament S2: W8
CSLAN 4
Kung Fu Cup 2026 Grand Finals
HSC XXIX
uThermal 2v2 2026 Main Event
Maestros of the Game 2
2026 GSL S2
BLAST Bounty Summer 2026: Closed Qualifier
Stake Ranked Episode 3
XSE Pro League 2026
IEM Cologne Major 2026
Stake Ranked Episode 2
CS Asia Championships 2026
Asian Champions League 2026
IEM Atlanta 2026
TLPD

1. ByuN
2. TY
3. Dark
4. Solar
5. Stats
6. Nerchio
7. sOs
8. soO
9. INnoVation
10. Elazer
1. Rain
2. Flash
3. EffOrt
4. Last
5. Bisu
6. Soulkey
7. Mini
8. Sharp
Sidebar Settings...

Advertising | Privacy Policy | Terms Of Use | Contact Us

Original banner artwork: Jim Warren
The contents of this webpage are copyright © 2026 TLnet. All Rights Reserved.