• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 05:36
CET 11:36
KST 19:36
  • 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
RSL Revival - 2025 Season Finals Preview8RSL Season 3 - Playoffs Preview0RSL Season 3 - RO16 Groups C & D Preview0RSL Season 3 - RO16 Groups A & B Preview2TL.net Map Contest #21: Winners12
Community News
Weekly Cups (Jan 5-11): Clem wins big offline, Trigger upsets0$21,000 Rongyi Cup Season 3 announced (Jan 22-Feb 7)12Weekly Cups (Dec 29-Jan 4): Protoss rolls, 2v2 returns7[BSL21] Non-Korean Championship - Starts Jan 103SC2 All-Star Invitational: Jan 17-1822
StarCraft 2
General
SC2 Spotted on the EWC 2026 list? Weekly Cups (Jan 5-11): Clem wins big offline, Trigger upsets Weekly Cups (Dec 29-Jan 4): Protoss rolls, 2v2 returns Spontaneous hotkey change zerg Chinese SC2 server to reopen; live all-star event in Hangzhou
Tourneys
$25,000 Streamerzone StarCraft Pro Series announced $21,000 Rongyi Cup Season 3 announced (Jan 22-Feb 7) WardiTV Winter Cup WardiTV Mondays SC2 AI Tournament 2026
Strategy
Simple Questions Simple Answers
Custom Maps
Map Editor closed ?
External Content
Mutation # 508 Violent Night Mutation # 507 Well Trained Mutation # 506 Warp Zone Mutation # 505 Rise From Ashes
Brood War
General
Potential ASL qualifier breakthroughs? BGH Auto Balance -> http://bghmmr.eu/ BW General Discussion StarCraft & BroodWar Campaign Speedrun Quest Data analysis on 70 million replays
Tourneys
[Megathread] Daily Proleagues [BSL21] Grand Finals - Sunday 21:00 CET [BSL21] Non-Korean Championship - Starts Jan 10 SLON Grand Finals – Season 2
Strategy
Game Theory for Starcraft Simple Questions, Simple Answers Current Meta [G] How to get started on ladder as a new Z player
Other Games
General Games
Beyond All Reason Nintendo Switch Thread Awesome Games Done Quick 2026! Mechabellum Stormgate/Frost Giant Megathread
Dota 2
Official 'what is Dota anymore' discussion
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
Community
General
US Politics Mega-thread Russo-Ukrainian War Thread European Politico-economics QA Mega-thread Things Aren’t Peaceful in Palestine Trading/Investing Thread
Fan Clubs
White-Ra Fan Club
Media & Entertainment
Anime Discussion Thread
Sports
2024 - 2026 Football Thread
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List TL+ Announced
Blogs
My 2025 Magic: The Gathering…
DARKING
Physical Exercise (HIIT) Bef…
TrAiDoS
Life Update and thoughts.
FuDDx
How do archons sleep?
8882
James Bond movies ranking - pa…
Topin
Customize Sidebar...

Website Feedback

Closed Threads



Active: 2201 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
Poland17596 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
Hyrule19188 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
Poland17596 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
Hyrule19188 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
Poland17596 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
Next event in 1h 24m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
SortOf 132
StarCraft: Brood War
Sea 4554
Rain 3153
Horang2 1105
Shuttle 558
Larva 463
Mini 433
Hyuk 423
Stork 353
actioN 274
ZerO 264
[ Show more ]
Leta 197
Mong 178
EffOrt 150
Soma 136
Zeus 120
Nal_rA 96
Hyun 95
ggaemo 87
Rush 79
JulyZerg 72
Light 71
910 71
Killer 69
hero 49
zelot 34
Mind 33
Sharp 33
Free 22
Terrorterran 18
soO 18
Sexy 18
scan(afreeca) 16
Noble 12
ajuk12(nOOB) 12
Sacsri 10
Bale 9
Dota 2
NeuroSwarm108
XcaliburYe107
ODPixel92
League of Legends
C9.Mang0449
JimRising 445
Counter-Strike
olofmeister1829
shoxiejesuss803
allub230
Super Smash Bros
Mew2King95
Other Games
summit1g7548
ceh9596
Pyrionflax273
Fuzer 176
ZerO(Twitch)10
Organizations
Other Games
gamesdonequick3084
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 14 non-featured ]
StarCraft 2
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• iopq 3
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Jankos2311
• Lourlo1090
• Stunt519
Upcoming Events
WardiTV Invitational
1h 24m
PiGosaur Cup
14h 24m
WardiTV Invitational
1d 1h
The PondCast
1d 23h
OSC
2 days
OSC
3 days
All Star Teams
3 days
INnoVation vs soO
sOs vs Scarlett
uThermal 2v2 Circuit
4 days
All Star Teams
4 days
MMA vs DongRaeGu
Rogue vs Oliveira
Sparkling Tuna Cup
4 days
[ Show More ]
OSC
5 days
Replay Cast
5 days
Wardi Open
6 days
Liquipedia Results

Completed

Proleague 2026-01-12
Big Gabe Cup #3
NA Kuram Kup

Ongoing

C-Race Season 1
IPSL Winter 2025-26
BSL 21 Non-Korean Championship
CSL 2025 WINTER (S19)
OSC Championship Season 13
Underdog Cup #3
BLAST Bounty Winter Qual
eXTREMESLAND 2025
SL Budapest Major 2025
ESL Impact League Season 8
BLAST Rivals Fall 2025
IEM Chengdu 2025
PGL Masters Bucharest 2025

Upcoming

Escore Tournament S1: W4
Acropolis #4
IPSL Spring 2026
Bellum Gens Elite Stara Zagora 2026
HSC XXVIII
Rongyi Cup S3
Thunderfire SC2 All-star 2025
Nations Cup 2026
BLAST Open Spring 2026
ESL Pro League Season 23
ESL Pro League Season 23
PGL Cluj-Napoca 2026
IEM Kraków 2026
BLAST Bounty Winter 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.